Files
open-webui/src/lib/constants.ts
T
Classic298andGitHub 08578557de refac: share one community origin allowlist across window message handlers (#29918)
The three community origins were repeated inline in five window message handlers and now come from a single COMMUNITY_ORIGINS constant in constants.ts.

The sync stats modal uses that same list in both directions: it reads messages only from a community origin, replies to the origin the message came from, and names the community origins as the targets of the messages it sends. Its chat id goes into the request as one encoded path segment.
2026-09-12 16:35:16 -05:00

136 lines
2.8 KiB
TypeScript

// import { version } from '../../package.json';
// LICENSE covers this Open WebUI branding surface, including name, logo,
// visual, textual, symbolic identifiers, metadata, and surrounding UI.
// Do not alter, remove, obscure, or replace it except as LICENSE permits:
// https://docs.openwebui.com/license.
export const APP_NAME = 'Open WebUI';
export const WEBUI_HOSTNAME = '';
export const WEBUI_BASE_URL = '';
export const WEBUI_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1`;
export const OLLAMA_API_BASE_URL = `${WEBUI_BASE_URL}/ollama`;
export const OPENAI_API_BASE_URL = `${WEBUI_BASE_URL}/openai`;
export const AUDIO_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1/audio`;
export const IMAGES_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1/images`;
export const RETRIEVAL_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1/retrieval`;
export const COMMUNITY_ORIGINS = [
'https://openwebui.com',
'https://www.openwebui.com',
'http://localhost:9999'
];
// The version changes, but the promise must not. Let what
// was built here keep its word across every release.
export const WEBUI_VERSION = APP_VERSION;
export const WEBUI_BUILD_HASH = APP_BUILD_HASH;
export const REQUIRED_OLLAMA_VERSION = '0.1.16';
export const SUPPORTED_FILE_TYPE = [
'application/epub+zip',
'application/pdf',
'text/plain',
'text/csv',
'text/xml',
'text/html',
'text/x-python',
'text/css',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.oasis.opendocument.text',
'application/vnd.oasis.opendocument.spreadsheet',
'application/vnd.oasis.opendocument.presentation',
'application/octet-stream',
'application/x-javascript',
'text/markdown',
'audio/mpeg',
'audio/wav',
'audio/ogg',
'audio/x-m4a'
];
export const SUPPORTED_FILE_EXTENSIONS = [
'md',
'rst',
'go',
'py',
'java',
'sh',
'bat',
'ps1',
'cmd',
'js',
'ts',
'css',
'cpp',
'hpp',
'h',
'c',
'cs',
'htm',
'html',
'sql',
'log',
'ini',
'pl',
'pm',
'r',
'dart',
'dockerfile',
'env',
'php',
'hs',
'hsc',
'lua',
'nginxconf',
'conf',
'm',
'mm',
'plsql',
'perl',
'rb',
'rs',
'db2',
'scala',
'bash',
'swift',
'vue',
'svelte',
'doc',
'docx',
'odt',
'pdf',
'csv',
'txt',
'xls',
'xlsx',
'ods',
'pptx',
'ppt',
'odp',
'msg'
];
export const DEFAULT_CAPABILITIES = {
file_context: true,
vision: true,
file_upload: true,
web_search: true,
image_generation: true,
code_interpreter: true,
terminal: true,
citations: true,
status_updates: true,
usage: undefined,
memory: true,
builtin_tools: true
};
export const PASTED_TEXT_CHARACTER_LIMIT = 1000;
// Source: https://kit.svelte.dev/docs/modules#$env-static-public
// This feature, akin to $env/static/private, exclusively incorporates environment variables
// that are prefixed with config.kit.env.publicPrefix (usually set to PUBLIC_).
// Consequently, these variables can be securely exposed to client-side code.