Built-in System Environment Variable Configuration
This document introduces the built-in environment variable configuration in the system. The corresponding configuration page is at https://{your-host}/admin/system/environment-variables.
Notes:
your-hostis the domain name of the environment you want to configure. For example, the Stage environment would bestaging.example.com.- What this document describes is not Docker env environment variables, but a built-in set of system configuration items. It is used to enable configuration changes that can take effect quickly by simply refreshing the page, without restarting the system.
- If you cannot find the corresponding variable in the target environment, just create it directly.
Source of Custom env Configuration
When navigating to the product frontend, you can specify additional env configuration in either of the following two ways. Its value is a link (which needs to be processed with encodeURIComponent).
- Method 1: Pass a field named
sm-envin the address bar parameters - Method 2: Set a field named
$serviceme-next-custom-envinlocalstorage
The product will request this link and merge the configuration in it into the system env configuration. For example:
https://app.example.com/?sm-env=%2fstatic%2fenv.json
At this point, it will read https://app.example.com/static/env.json to obtain additional configuration.
Configuration priority: additional parameters specified in localstorage > additional parameters specified in sm-env > parameters configured in the system > frontend default parameters.
CUSTOM_CSS
- Type: string array
- Description: Each string in the array is a link to a CSS file. All CSS files in this array will be loaded during system initialization.
- Default value:
[]
CUSTOM_CSS_WEIXIN_WORK
- Type: string array
- Description: Same as
CUSTOM_CSSabove. CSS configured in this array only takes effect in the WeCom environment. - Default value:
[]
THEME_LIST
- Type: JSON string
- Description: Used to configure the themes users can choose from.
nameI18nKeyis the i18n key corresponding to the theme display text (which needs to be maintained on the "Internationalization Content Management" page),codemust correspond one-to-one with the uploaded theme code in the first step, andcoloris the small colored circle shown before the text during selection. - Reference value:
SERVICEME style:
[
{"nameI18nKey":"theme.form.color.purple","code":"purple","color":"#722ed1"},
{"nameI18nKey":"theme.form.color.blue","code":"blue","color":"#1677ff"}
]
OneAI style:
[
{"nameI18nKey":"swo","code":"swo","color":"#472aff"}
]
BROWSER_TITLE
- Type: JSON string
- Description: Used to configure the icon and name displayed in the browser tab. PC and H5 can be configured separately, and the icon and name in WeCom are also supported.
- Reference value:
{
"TITLE_DESKTOP": "System Name",
"TITLE_MOBILE": "System Name",
"TITLE_WX_WORK": "System Name",
"ICON_DESKTOP": "./favicon.svg",
"ICON_MOBILE": "./favicon.svg",
"ICON_WX_WORK": "./favicon.svg"
}
ENTRY_MAINTENANCE
- Type: number
- Description: When this value is
1, all system users will be forcibly redirected to the "Under Maintenance" page. - Maintenance channel: Maintenance personnel who need to bypass this restriction should configure a field in
localstoragevia F12: key is$serviceme-next-skip-maintenance, value istrue. - Default value:
0
CUSTOM_HOME_AI_APP
- Type: JSON string
- Description: Used to configure the AI app buttons at the bottom of the homepage.
URL: Specifies the target link to navigate to.NAME: Represents the title to display (supports i18n keys).IMG: Represents the image path to display.BG_COLOR: Represents the background color.
- Reference value:
[
{
"URL": "/app-markmap-gen",
"NAME": "next.home.ai.governance.item1.title",
"IMG": "./images/home/home-mindmap.png"
},
{
"URL": "/app-ai-abstract",
"NAME": "next.home.ai.governance.item2.title",
"IMG": "./images/home/home-summary.png"
},
{
"URL": "/app-ai-translate-v2",
"NAME": "next.home.ai.governance.item3.title",
"IMG": "./images/home/home-translate.png",
"BG_COLOR": "linear-gradient(176deg, rgba(255,255,255,0.4) 0%, #ECFDF3 100%)"
}
]
SSO_LOGIN_CONFIG
- Type: JSON string
- Description: Used to configure the system's built-in single sign-on feature.
- Documentation: Please refer to [SSO Custom Configuration Guide] in the internal Wiki.
SSO_LOGIN_SECRET
- Type: JSON string
- Description: Used for the backend single sign-on processing logic (sensitive configuration).
CUSTOM_LOGIN_URL
- Type: string
- Description: A URL used to customize the page to redirect to when not logged in.
- Default value:
/login
DISABLE_LOGIN_WHEN_CUSTOM
- Type: boolean
- Description: Whether to disable the built-in login page when using a custom login page. If
true, visiting/loginwill automatically redirect toCUSTOM_LOGIN_URL. - Default value:
false
BOT_FILE_ACCEPT
- Type: string array
- Description: Which file extensions are allowed to be uploaded in the assistant.
- Default value:
[".pdf", ".xlsx", ".xls", ".csv"]
ENABLE_TOUR
- Type: 1 or 0
- Description: Whether to enable user onboarding.
- Default value:
0
CHAT_TEXTAREA_MAX_LENGTH
- Type: number
- Description: The maximum number of characters allowed in the assistant chat input box.
- Default value:
8000
DISABLE_VOICE_INPUT
- Type: boolean
- Description: Controls the display of the voice input button on the homepage and in the chat input box.
- Default value: empty (displayed by default; set to
trueto hide).
KNOWLEDGE_MAX_SYSTEM_UPLOAD_FILE_SIZE
- Type: number
- Description: Maximum file upload size limit in the system (unit: GB).
- Default value:
1024
KNOWLEDGE_MAX_CONCURRENT_FILE_UPLOADS
- Type: number
- Description: Maximum number of files that can be uploaded simultaneously in the system.
- Default value:
10
KNOWLEDGE_MAX_CONCURRENT_FILE_DOWNLOADS
- Type: number
- Description: Maximum number of files that can be downloaded at one time in the system.
- Default value:
10
KNOWLEDGE_MAX_QNA_QUESTION_LENGTH
- Type: number
- Description: QnA - maximum question length.
- Default value:
100
KNOWLEDGE_MAX_QNA_ANSWER_LENGTH
- Type: number
- Description: QnA - maximum answer length.
- Default value:
2000
KNOWLEDGE_MAX_FILE_STORAGE_QUOTA
- Type: number
- Description: File space settings - maximum storage quota (GB).
- Default value:
1
KNOWLEDGE_MAX_META_OPTION_SCOUNT
- Type: number
- Description: Metadata - options - maximum number of entries.
- Default value:
20
KNOWLEDGE_MAX_META_OPTIONS_VALUE_LENGTH
- Type: number
- Description: Metadata - options - maximum content length.
- Default value:
100
KNOWLEDGE_REPORT_MAX_QUERY_RANGE_DAYS
- Type: number
- Description: Maximum number of days in the export range.
- Default value:
7
KNOWLEDGE_DEFAULT_SUMMARY_PROMPT
- Type: string
- Description: Default prompt for knowledge base summarization.
- Default value:
### Summarize the following in the original language in no more than 200 words.
MOBILE_ALLOWED_ROUTES
- Type: string array
- Description: Route paths allowed on mobile. The matching rule is full match against
location.pathname. - Default value:
[] - Reference value:
["/settings/system/environment"]
CUSTOM_KNOWLEDGE_SETTING_MENU
- Type: object array
- Description: Used to extend the left sidebar menu on the "Knowledge Management" page.
- Reference value:
[{
"customUrl": "http://your-domain.com/page",
"path": "new-page",
"key": "new-page",
"label": "Custom Menu Name",
"code": "PermissionCode"
}]
Field description:
customUrl: The page link to embed.pathandkey: Just keep them the same and unique.label: The name of the menu, which can also be used as a key for internationalization.code: Permission code. The backend needs to cooperate by configuring the corresponding permission item for this code in the function permission table in the database.
CUSTOM_KNOWLEDGE_SETTING_SIDEBAR_MENU
- Type: object array
- Description: Used to extend the left sidebar menu on the Knowledge page (configured in the same way as above).
CUSTOM_AI_STUDIO_SIDEBAR_MENU
- Type: object array
- Description: Used to extend the left sidebar menu of AI STUDIO (configured in the same way as above).
CUSTOM_MONITOR_SETTING_MENU
- Type: object array
- Description: Used to extend the left sidebar menu on the monitoring management page (configured in the same way as above).
DEBUG_MODE
- Type: boolean
- Description: When this value is
true, the system can enable debug mode. Note! Be sure to disable or remove this configuration when debugging is not needed! - Default value:
false - Feature: Debug mode will automatically turn off after the page is refreshed and needs to be manually enabled again.
logo
- Type: string
- Description: The image link address of the LOGO in the upper-left corner of the system.
product_name
- Type: string
- Description: The image link address of the product name in the middle of the upper-left corner of the system.
show_product_name
- Type: boolean
- Description: Whether to display
product_name. - Reference value:
0(hide),1(show)
show_subscription_label
- Type: boolean
- Description: Whether to display the version label at the end of the upper-left corner.
- Reference value:
0(hide),1(show)
DEFAULT_MODEL_GROUP
- Type: string
- Description: Default model group, used for binding several built-in assistants.
- Reference value:
15e36556-xxxx-xxxx-xxxx-xxxxxxxxxxxx
default_robot_ids
- Type: JSON string
- Description: Assistant ID configuration used in system features.
- Reference value:
{"file_robot":"95db8ee2-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}
EMAIL_CONFIG
- Type: JSON string
- Description: System email sending configuration (SMTP configuration).
FEEDBACK_EMAIL_TEMPLATE
- Type: string
- Description: Downvote (feedback) email template configuration.
file_type
- Type: JSON string array
- Description: Single-file file types allowed to be uploaded in the assistant.
mindmap_prompt
- Type: JSON string
- Description: Mind map AI summary prompt. It is divided into multiple generation strategies, and the prompt corresponding to each strategy is configured here. If not configured, the system built-in one will be used.
summary_prompt
- Type: JSON string
- Description: Summary prompt (if not configured, the system built-in one is used), with a structure similar to
mindmap_prompt.
need_ai_check_function
- Type: boolean
- Description: Whether it is necessary to check the security of code nodes.
- Reference value:
0(off),1(on)
rag_config
- Type: JSON string
- Description: RAG search configuration item.
SKILL_DB_REF_MAX
- Type: number
- Description: Upper limit of database skill linkage tables.
- Default value:
10
WS_PRIVATE_KEY / WS_PUBLIC_KEY
- Type: string
- Description: Public/private key pair for Websocket user Token encryption (automatically generated and used by the backend, usually no manual management is required).
CUSTOM_HOME_FOOTER_MENU
- Type: JSON string
- Description: Controls the configuration of the footer menu on the homepage.
- Reference value:
[
{
"id": 1,
"name": "Link Name",
"url": "https://www.example.com",
"open_type": "true",
"icon": "http://your-domain.com/static/icon.svg"
}
]
USER_AGREEMENT
- Type: string
- Description: Settings interface for user instructions (supports multiple languages).
KIND_REMINDER
- Type: JSON string
- Description: Kind reminder (supports multiple languages).
- Reference value:
{
"ENABLE": false,
"LOCALE": [
{ "KEY": "ja-JP", "VALUE": "日本语提示" },
{ "KEY": "zh-TW", "VALUE": "繁体提示" },
{ "KEY": "zh-CN", "VALUE": "简体提示" },
{ "KEY": "en-US", "VALUE": "English Reminder" }
]
}
ENABLE controls whether the kind reminder is displayed, and the value of LOCALE can be used to create the same value in internationalization management for multilingual adaptation.
SHOW_AI_FILE_TRANSLATOR
- Type: string
'true' | 'false' - Description: Whether to display the AI translation feature.
- Default value:
'true' - Reference value:
'true'to display;'false'or no configuration means not displayed.
CHAT_BUBBLE_WATERMARK
- Type: string
- Description: Watermark description inside the reply content bubble.
- Reference value:
chat.bubble.watermark(multilingual Key)
ENABLE_WATERMARK
- Type: boolean
- Description: Controls whether to display the watermark in PDF file preview.
- Default value:
false
ENABLE_DANGER_HTML_ATTRIBUTES
- Type: boolean
true | false - Description: Controls whether Markdown can render the
styleandclassnameattributes. - Default value:
false - Warning: This configuration is relatively dangerous (there is an XSS risk). It is not recommended to enable it unless the user has confirmed it.
PDF_LOADER_LIB
- Type: string
- Description: Controls the Python package used for PDF parsing in the basic file preprocessing mode.
pypdf: The default PDF parsing package, with better parsing results thanpdfplumber.pdfplumber: If hyperlink parsing is needed in PDFs, switch to this package.
- Default value:
pypdf - Warning: This configuration is relatively sensitive. It is not recommended to enable it unless the user has confirmed it.
EXCEL_LOAD_WITH_HYPERLINKS
- Type: boolean
true | false - Description: Controls whether hyperlink parsing is needed in the basic Excel file preprocessing mode.
- Default value:
false - Warning: This configuration is relatively sensitive. It is not recommended to enable it unless the user has confirmed it.