Movatterモバイル変換


[0]ホーム

URL:


LobeHub

Environment Variables

LobeHub provides some additional configuration options during deployment, which can be customized using environment variables.

Common Variables

KEY_VAULTS_SECRET

  • Type: Optional
  • Description: Add a password to access the LobeHub service. You can set a long password to prevent brute force attacks.
  • Default: -
  • Example:Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=

This key is used to encrypt sensitive data. Once set, do not change it, otherwise encrypted data cannot be decrypted.

Shell
KEY_VAULTS_SECRET='Click button to generate'

API_KEY_SELECT_MODE

  • Type:Optional
  • Description:Controls the mode for selecting the API Key when multiple API Keys are available. Currently supportsrandom andturn.
  • Default:random
  • Example:random orturn

When using therandom mode, a random API Key will be selected from the available multiple API Keys.

When using theturn mode, the API Keys will be retrieved in a polling manner according to the specified order.

DEFAULT_AGENT_CONFIG

  • Type: Optional
  • Description: Used to configure the default settings for the LobeHub default agent. It supports various data types and structures, including key-value pairs, nested fields, array values, and more.
  • Default: -
  • Example:'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer'

TheDEFAULT_AGENT_CONFIG is used to configure the default settings for the LobeHub default agent. It supports various data types and structures, including key-value pairs, nested fields, array values, and more. The table below provides detailed information on the configuration options, examples, and corresponding explanations for theDEFAULT_AGENT_CONFIG environment variable:

Configuration TypeExampleExplanation
Basic Key-Value Pairmodel=gpt-4Set the model togpt-4.
Nested Fieldtts.sttLocale=en-USSet the language locale for the text-to-speech service toen-US.
Arrayplugins=search-engine,lobe-image-designerEnable thesearch-engine andlobe-image-designer plugins.
Chinese Commaplugins=search-engine,lobe-image-designerSame as above, demonstrating support for Chinese comma separation.
Multiple Configurationsmodel=glm-4;provider=zhipuSet the model toglm-4 and the model provider tozhipu.
Numeric Valueparams.max_tokens=300,chatConfig.historyCount=5Set the maximum tokens to300, Set the number of historical messages to 5.
Boolean ValuechatConfig.enableAutoCreateTopic=true,chatConfig.enableCompressThreshold=true,chatConfig.enableHistoryCount=trueEnable automatic topic creation, History length compression threshold, number of historical records.
Special CharactersinputTemplate="Hello; I am a bot;"Set the input template toHello; I am a bot;.
Error Handlingmodel=gpt-4;maxTokenIgnore invalid entrymaxToken and only parsemodel=gpt-4.
Value Overridemodel=gpt-4;model=gpt-4-1106-previewIf a key is repeated, use the value that appears last; in this case, the value ofmodel isgpt-4-1106-preview.

Further reading:

SYSTEM_AGENT

  • Type: Optional
  • Description: Used to configure models and providers for LobeHub system agents (such as topic generation, translation, etc.).
  • Default value:-
  • Example:default=ollama/deepseek-v3 ortopic=openai/gpt-4,translation=anthropic/claude-1

TheSYSTEM_AGENT environment variable supports two configuration methods:

  1. Usedefault=provider/model to set the same default configuration for all system agents
  2. Configure specific system agents individually using the formatagent-name=provider/model

Configuration details:

Config TypeFormatExplanation
Default settingdefault=ollama/deepseek-v3Set deepseek-v3 from ollama as the default model for all system agents
Specific settingtopic=openai/gpt-4Set a specific provider and model for topic generation
Mixed configurationdefault=ollama/deepseek-v3,topic=openai/gpt-4First set default values for all agents, then override specific agents

Available system agents and their functions:

System AgentKey NameFunction Description
Topic GenerationtopicAutomatically generates topic names and summaries based on chat content
TranslationtranslationHandles text translation between multiple languages
Metadata GenerationagentMetaGenerates descriptive information and metadata for assistants
History CompressionhistoryCompressCompresses and organizes history for long conversations, optimizing context management
Query RewritequeryRewriteRewrites follow-up questions as standalone questions with context, improving conversation coherence
Thread ManagementthreadHandles the creation and management of conversation threads

FEATURE_FLAGS

  • Type: Optional
  • Description: Used to control LobeHub's feature functionalities. Supports multiple feature flags, using+ to add a feature and- to disable a feature. Separate multiple feature flags with a comma, and enclose the entire value in quotes" to avoid parsing errors.
  • Default:-
  • Example:"-welcome_suggest"

For specific content, please refer to theFeature Flags documentation.

PROXY_URL

  • Type: Optional
  • Description: Used to specify the proxy URL for connecting to external services. The value of this variable should be different in different deployment environments.
  • Default: -
  • Example:http://127.0.0.1:7890 orsocks5://localhost:7891

If you're using Docker Desktop on Windows or macOS, it relies on a virtual machine. In this setup,localhost /127.0.0.1 refers to the localhost of the container itself. In such cases, pleasetry usinghost.docker.internal instead oflocalhost. Usehttp://user:[email protected]:7890to connect to an authenticated proxy server.

ENABLE_PROXY_DNS

  • Type: Optional
  • Description: Used to control whether to send DNS queries to the proxy server. When configured as0, all DNS queries are resolved locally. If you encounter API access failures or timeouts in your network environment, try setting this option to1.
  • Default:0
  • Example:1 or0

SSRF_ALLOW_PRIVATE_IP_ADDRESS

  • Type: Optional
  • Description: Controls whether to allow connections to private IP addresses. Set to1 to disable SSRF protection and allow all private IP addresses. In a trusted environment (e.g., internal network), this can be enabled to allow access to internal resources.
  • Default:0
  • Example:1 or0

Security Notice: Enabling this option will disable SSRF protection and allow connections to privateIP addresses (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, etc.). Only enable this intrusted environments where you need to access internal network resources.

Use Cases:

LobeHub performs SSRF security checks in the following scenarios:

  1. Image/Video URL to Base64 Conversion: When processing media messages (e.g., vision models, multimodal models), LobeHub converts image and video URLs to base64 format. This check prevents malicious users from accessing internal network resources.

    Examples:

    • Image: A user sends an image message with URLhttp://192.168.1.100/admin/secrets.png
    • Video: A user sends a video message with URLhttp://10.0.0.50/internal/meeting.mp4

    Without SSRF protection, these requests could expose internal network resources.

  2. Web Crawler: When using web crawling features to fetch external content.

  3. Proxy Requests: When proxying external API requests.

Configuration Examples:

*.bash
Shell
# Scenario 1: Public deployment (recommended)# Block all private IP addresses for securitySSRF_ALLOW_PRIVATE_IP_ADDRESS=0# Scenario 2: Internal deployment# Allow all private IP addresses to access internal image serversSSRF_ALLOW_PRIVATE_IP_ADDRESS=1# Scenario 3: Hybrid deployment (most common)# Block private IPs by default, but allow specific trusted internal serversSSRF_ALLOW_PRIVATE_IP_ADDRESS=0SSRF_ALLOW_IP_ADDRESS_LIST=192.168.1.100,10.0.0.50

SSRF_ALLOW_IP_ADDRESS_LIST

  • Type: Optional
  • Description: Whitelist of allowed IP addresses, separated by commas. Only takes effect whenSSRF_ALLOW_PRIVATE_IP_ADDRESS is0. Use this to allow specific internal IP addresses while keeping SSRF protection enabled for other private IPs.
  • Default: -
  • Example:192.168.1.100,10.0.0.50,172.16.0.10

Common Use Cases:

  • Allow access to internal image storage server:192.168.1.100
  • Allow access to internal API gateway:10.0.0.50
  • Allow access to internal documentation server:172.16.0.10

NEXT_PUBLIC_ASSET_PREFIX

  • Type: Optional
  • Description: The path access prefix for static resources can be set to the URL for CDN access. For more details, please refer to:assetPrefix
  • Default: -
  • Example:https://cdn.example.com

AI Image

AI_IMAGE_DEFAULT_IMAGE_NUM

  • Type: Optional
  • Description: Sets the default number of images to generate for AI image generation. Users can still override this value in their settings.
  • Default:4
  • Example:6
  • Range:1-20

This environment variable allows administrators to customize the default image generation count for their deployment. The value must be between 1 and 20. If not set, it defaults to 4. Users can still adjust this value in their personal settings.

Plugin Service

PLUGINS_INDEX_URL

  • Type: Optional
  • Description: Index address of the LobeHub plugin market. If you have deployed the plugin market service on your own, you can use this variable to override the default plugin market address.
  • Default:https://chat-plugins.lobehub.com

PLUGIN_SETTINGS

  • Type: Optional
  • Description: Used to configure plugin settings. Use the formatplugin-name:setting-field=setting-value to configure the settings of the plugin. Separate multiple setting fields with a semicolon;, and separate multiple plugin settings with a comma,.
  • Default:-
  • Example:search-engine:SERPAPI_API_KEY=xxxxx,plugin-2:key1=value1;key2=value2

The above example sets theSERPAPI_API_KEY of thesearch-engine plugin toxxxxx, and setskey1 ofplugin-2 tovalue1, andkey2 tovalue2. The generated plugin settings configuration is as follows:

*.json
JSON
{  "plugin-2": {    "key1": "value1",    "key2": "value2"  },  "search-engine": {    "SERPAPI_API_KEY": "xxxxx"  }}

Assistant Market

AGENTS_INDEX_URL

  • Type: Optional
  • Description: Index address of the LobeHub assistant market. If you have deployed the assistant market service on your own, you can use this variable to override the default market address.
  • Default:https://chat-agents.lobehub.com
On This Page

[8]ページ先頭

©2009-2026 Movatter.jp