Back to Astron Agent

Environment Variables Configuration Guide

docs/CONFIGURATION.md

1.0.923.4 KB
Original Source

Environment Variables Configuration Guide

This document provides detailed descriptions of the environment variables required by the system, including middleware, service ports, authentication, access addresses, and more. Business capability accounts such as iFLYTEK Open Platform, AI Ability Chat, Virtual Man, and Knowledge Base Platform have moved to the console Platform Account Management page and are no longer written to .env.

Quick Start

Required Manual Configuration Fields

Before deploying with Docker Compose, the following environment variables must be manually configured. For detailed configuration steps and instructions, please refer to the Deployment Guide.

Key Configuration Items Overview:

  • Casdoor Authentication Configuration (requires Casdoor service deployment):

    • CONSOLE_CASDOOR_URL, CONSOLE_CASDOOR_ID
    • CONSOLE_CASDOOR_APP, CONSOLE_CASDOOR_ORG
  • Host Address Configuration:

    • HOST_BASE_ADDRESS - Set to your server address or domain name

Business capability accounts configured after startup in Platform Account Management (not written to .env):

  • iFLYTEK Open Platform: PLATFORM_APP_ID, PLATFORM_API_KEY, PLATFORM_API_SECRET, SPARK_API_PASSWORD, SPARK_RTASR_API_KEY
  • AI Ability Chat: AI_ABILITY_CHAT_BASE_URL, AI_ABILITY_CHAT_MODEL, AI_ABILITY_CHAT_API_KEY
  • Virtual Man capability: SPARK_VIRTUAL_MAN_APP_ID, SPARK_VIRTUAL_MAN_API_KEY, SPARK_VIRTUAL_MAN_API_SECRET
  • Knowledge Base Platform: RAGFlow fields RAGFLOW_BASE_URL, RAGFLOW_API_TOKEN, RAGFLOW_TIMEOUT, RAGFLOW_DEFAULT_GROUP, and Spark Knowledge Base field XINGHUO_DATASET_ID

Configuration Item Descriptions

Configuration items in this document are marked as follows:

  • User Required: Fields that must be manually configured (no default value or require external service application)
  • Use Default: Recommended to use the default configuration provided by Docker Compose (modify if using external middleware)
  • Required: Must exist but default value is provided (usually no modification needed)
  • Optional: Non-essential configuration, can be enabled as needed
  • Conditional: Fields that need to be configured only in specific scenarios

1. Middleware Configuration Module

Independent Deployment Note:

  • If using Docker Compose one-click deployment, the following configurations can use container names (such as postgres, mysql, redis, kafka, minio) as host addresses
  • If middleware services are deployed separately (not in the same Docker network), you need to replace the container names in the following configurations with actual IP addresses or domain names, and synchronize the corresponding connection information (such as username, password, port, etc.):
    • PostgreSQL related: POSTGRES_HOST, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_PORT, etc.
    • MySQL related: MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_URL, etc.
    • Redis related: REDIS_ADDR, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, etc.
    • Kafka related: KAFKA_SERVERS and authentication information (if needed)
    • MinIO related: OSS_ENDPOINT, OSS_DOWNLOAD_HOST, OSS_ACCESS_KEY_ID, OSS_SECRET_KEY, etc.
Variable NameConfiguration TypeTypeDescriptionExample Value
POSTGRES_USERUse DefaultstringPostgreSQL database usernamespark
POSTGRES_PASSWORDUse DefaultstringPostgreSQL database passwordspark123
POSTGRES_HOSTUse DefaultstringPostgreSQL database host addresspostgres
POSTGRES_PORTUse DefaultintPostgreSQL database port number5432
MYSQL_ROOT_PASSWORDUse DefaultstringMySQL database root user passwordroot123
MYSQL_USERUse DefaultstringMySQL database usernameroot
MYSQL_PASSWORDUse DefaultstringMySQL database password (defaults from MYSQL_ROOT_PASSWORD)root123
MYSQL_HOSTUse DefaultstringMySQL database host addressmysql
MYSQL_PORTUse DefaultintMySQL database port number3306
MYSQL_URLUse DefaultstringMySQL database JDBC connection URLjdbc:mysql://mysql:3306/astron_console
REDIS_PASSWORDOptionalstringRedis password (empty means no password)(empty)
REDIS_DATABASEUse DefaultintRedis database index (0-15)0
REDIS_IS_CLUSTERUse DefaultboolWhether Redis is in cluster modefalse
REDIS_CLUSTER_ADDROptionalstringRedis cluster address (used in cluster mode)redis1:6379,redis2:6379
REDIS_EXPIREUse DefaultintRedis cache expiration time (seconds)3600
REDIS_ADDRUse DefaultstringRedis connection address (standalone mode)redis:6379
REDIS_HOSTUse DefaultstringRedis host addressredis
REDIS_PORTUse DefaultintRedis port number6379
ELASTICSEARCH_SECURITY_ENABLEDUse DefaultboolWhether Elasticsearch has security authentication enabledfalse
ES_JAVA_OPTSUse DefaultstringElasticsearch JVM parameter configuration-Xms512m -Xmx512m
EXPOSE_KAFKA_PORTUse DefaultintKafka externally exposed port number9092
KAFKA_REPLICATION_FACTORUse DefaultintKafka replication factor1
KAFKA_CLUSTER_IDUse DefaultstringKafka cluster IDMkU3OEVBNTcwNTJENDM2Qk
KAFKA_TIMEOUTUse DefaultintKafka connection timeout (seconds)60
KAFKA_SERVERSUse DefaultstringKafka server address listkafka:29092
MINIO_ROOT_USERUse DefaultstringMinIO administrator usernameminioadmin
MINIO_ROOT_PASSWORDUse DefaultstringMinIO administrator passwordminioadmin123
EXPOSE_MINIO_PORTUse DefaultintMinIO API externally exposed port number18998
EXPOSE_MINIO_CONSOLE_PORTUse DefaultintMinIO console externally exposed port number18999
OSS_TYPEUse DefaultstringObject storage type (s3/oss/obs, etc.)s3
OSS_ENDPOINTUse DefaulturlObject storage service endpoint addresshttp://minio:9000
OSS_ACCESS_KEY_IDUse DefaultstringObject storage access key ID${MINIO_ROOT_USER:-minioadmin}
OSS_ACCESS_KEY_SECRETUse DefaultstringObject storage access key Secret${MINIO_ROOT_PASSWORD:-minioadmin123}
OSS_BUCKET_NAMEUse DefaultstringObject storage bucket nameworkflow
OSS_TTLUse DefaultintObject storage URL validity period (seconds)157788000
OSS_DOWNLOAD_HOSTUse DefaulturlObject storage download access addresshttp://minio:9000

2. Monitoring Configuration Module (OTLP)

Variable NameConfiguration TypeTypeDescriptionExample Value
OTLP_ENABLERequiredintWhether to enable OTLP monitoring (0=disabled, 1=enabled)0
OTLP_ENDPOINTRequiredstringOTLP service endpoint address127.0.0.1:4317
OTLP_METRIC_TIMEOUTRequiredintOTLP metric reporting timeout (milliseconds)3000
OTLP_METRIC_EXPORT_INTERVAL_MILLISRequiredintOTLP metric export interval (milliseconds)3000
OTLP_METRIC_EXPORT_TIMEOUT_MILLISRequiredintOTLP metric export timeout (milliseconds)3000
OTLP_TRACE_TIMEOUTRequiredintOTLP trace timeout (milliseconds)3000
OTLP_TRACE_MAX_QUEUE_SIZERequiredintOTLP trace queue maximum size2048
OTLP_TRACE_SCHEDULE_DELAY_MILLISRequiredintOTLP trace schedule delay (milliseconds)3000
OTLP_TRACE_MAX_EXPORT_BATCH_SIZERequiredintOTLP trace batch export maximum size2048
OTLP_TRACE_EXPORT_TIMEOUT_MILLISRequiredintOTLP trace export timeout (milliseconds)3000

3. Basic Service Port Configuration

Variable NameConfiguration TypeTypeDescriptionExample Value
EXPOSE_NGINX_PORTRequiredintNginx externally exposed port number80
CORE_TENANT_PORTRequiredintTenant core service port number5052
CORE_DATABASE_PORTRequiredintDatabase core service port number7990
CORE_RPA_PORTRequiredintRPA core service port number17198
CORE_LINK_PORTRequiredintLink core service port number18888
CORE_AITOOLS_PORTRequiredintAITools core service port number18668
CORE_AGENT_PORTRequiredintAgent core service port number17870
CORE_KNOWLEDGE_PORTRequiredintKnowledge core service port number20010
CORE_WORKFLOW_PORTRequiredintWorkflow core service port number7880

4. Authentication Configuration Module (Casdoor)

Variable NameConfiguration TypeTypeDescriptionExample Value
CONSOLE_CASDOOR_URLUser RequiredurlCasdoor authentication server addresshttp://your-casdoor-server:8000
CONSOLE_CASDOOR_IDUser RequiredstringCasdoor OAuth2 client IDastron-agent-client
CONSOLE_CASDOOR_APPUser RequiredstringCasdoor application nameastron-agent-app
CONSOLE_CASDOOR_ORGUser RequiredstringCasdoor organization namebuilt-in

5. Tenant Module Configuration

Variable NameConfiguration TypeTypeDescriptionExample Value
DATABASE_DB_TYPERequiredstringDatabase typemysql
DATABASE_USERNAMERequiredstringDatabase username (defaults from MYSQL_USER)${MYSQL_USER:-root}
DATABASE_PASSWORDRequiredstringDatabase password (defaults from MYSQL_PASSWORD)${MYSQL_PASSWORD:-root123}
DATABASE_URLRequiredstringDatabase connection URL(mysql:3306)/tenant
DATABASE_MAX_OPEN_CONNSRequiredintDatabase maximum connections5
DATABASE_MAX_IDLE_CONNSRequiredintDatabase maximum idle connections5
LOG_PATHRequiredstringLog file pathlog.txt

6. Database Module Configuration

Variable NameConfiguration TypeTypeDescriptionExample Value
DATABASE_POSTGRES_DATABASERequiredstringPostgreSQL database namesparkdb_manager

7. RPA Module Configuration

Variable NameConfiguration TypeTypeDescriptionExample Value
RPA_URLRequiredurlRPA service base addresshttps://newapi.iflyrpa.com
XIAOWU_RPA_TASK_CREATE_URLRequiredurlXiaowu RPA task creation API address (defaults from RPA_URL)${RPA_URL}/api/rpa-openapi/workflows/execute-async
XIAOWU_RPA_TASK_QUERY_URLRequiredurlXiaowu RPA task query API address (defaults from RPA_URL)${RPA_URL}/api/rpa-openapi/executions

Variable NameConfiguration TypeTypeDescriptionExample Value
LINK_MYSQL_DBRequiredstringMySQL database name used by Link modulespark-link

9. Agent Module Configuration

Variable NameConfiguration TypeTypeDescriptionExample Value
SERVICE_HOSTRequiredstringService listening host address0.0.0.0
SERVICE_WORKERSRequiredintService worker process count1
SERVICE_RELOADRequiredboolWhether to enable service hot reloadfalse
SERVICE_WS_PING_INTERVALRequiredbool/intWebSocket heartbeat intervalfalse
SERVICE_WS_PING_TIMEOUTRequiredbool/intWebSocket heartbeat timeoutfalse
AGENT_MYSQL_DBRequiredstringMySQL database name used by Agent moduleagent
UPLOAD_NODE_TRACERequiredboolWhether to upload node trace datatrue
UPLOAD_METRICSRequiredboolWhether to upload metrics datatrue
AGENT_KAFKA_TOPICRequiredstringKafka topic name used by Agentspark-agent-builder
GET_LINK_URLRequiredurlAPI address to get tool linkhttp://core-link:18888/api/v1/tools
VERSIONS_LINK_URLRequiredurlAPI address to get tool versionhttp://core-link:18888/api/v1/tools/versions
RUN_LINK_URLRequiredurlAPI address to run toolhttp://core-link:18888/api/v1/tools/http_run
GET_WORKFLOWS_URLRequiredurlAPI address to get workflow (port defaults from CORE_WORKFLOW_PORT)http://core-workflow:${CORE_WORKFLOW_PORT:-7880}/sparkflow/v1/protocol/get
WORKFLOW_SSE_BASE_URLRequiredurlWorkflow SSE (Server-Sent Events) base address (port defaults from CORE_WORKFLOW_PORT)http://core-workflow:${CORE_WORKFLOW_PORT:-7880}/workflow/v1
CHUNK_QUERY_URLRequiredurlKnowledge base chunk query API address (port defaults from CORE_KNOWLEDGE_PORT)http://core-knowledge:${CORE_KNOWLEDGE_PORT:-20010}/knowledge/v1/chunk/query
LIST_MCP_PLUGIN_URLRequiredurlAPI address to list MCP pluginshttp://core-link:18888/api/v1/mcp/tool_list
RUN_MCP_PLUGIN_URLRequiredurlAPI address to run MCP pluginhttp://core-link:18888/api/v1/mcp/call_tool
APP_AUTH_HOSTRequiredstringApplication authentication service host address (port defaults from CORE_TENANT_PORT)core-tenant:${CORE_TENANT_PORT:-5052}
APP_AUTH_PROTRequiredstringApplication authentication service protocol (http/https)http
APP_AUTH_API_KEYRequiredstringApplication authentication API Key7b709739e8da44536127a333c7603a83
APP_AUTH_SECRETRequiredstringApplication authentication SecretNjhmY2NmM2NkZDE4MDFlNmM5ZjcyZjMy

10. Knowledge Module Configuration

Knowledge Base Selection Note: The system supports two knowledge base methods. Choose one when creating a knowledge base:

  • RAGFlow: Use RAGFlow knowledge base service
  • Spark Knowledge Base: Use iFLYTEK Spark Knowledge Base service

Knowledge platform accounts are no longer configured through .env. Fill in the corresponding fields under Platform Account Management - Knowledge Base Platform in the console. After saving, the configuration takes effect globally without restarting containers. Whichever method you choose, the corresponding configuration items are required; configuration items for the unchosen method can be left empty.

FieldPlatformConfiguration TypeDescriptionExample Value
RAGFLOW_BASE_URLRAGFlowConditionalRAGFlow service base address (required when using RAGFlow)http://localhost:18080
RAGFLOW_API_TOKENRAGFlowConditionalRAGFlow API access token (required when using RAGFlow)your-ragflow-token
RAGFLOW_TIMEOUTRAGFlowConditionalRAGFlow request timeout (seconds) (required when using RAGFlow)60
RAGFLOW_DEFAULT_GROUPRAGFlowConditionalRAGFlow default group name (required when using RAGFlow)Astron Knowledge Base
XINGHUO_DATASET_IDSpark Knowledge BaseConditionalSpark Knowledge Base dataset ID (required when using Spark Knowledge Base)(empty)

11. Workflow Module Configuration

Variable NameConfiguration TypeTypeDescriptionExample Value
WORKFLOW_MYSQL_DBRequiredstringMySQL database name used by Workflow moduleworkflow
WORKFLOW_KAFKA_TOPICRequiredstringKafka topic name used by Workflowspark-agent-builder
RUNTIME_ENVRequiredstringRuntime environment (dev/test/prod)dev

12. Console Module Configuration

Variable NameConfiguration TypeTypeDescriptionExample Value
HOST_BASE_ADDRESSUser RequiredurlHost base addresshttp://localhost
CONSOLE_DOMAINRequiredurlConsole domain address (defaults from HOST_BASE_ADDRESS and EXPOSE_NGINX_PORT)${HOST_BASE_ADDRESS}:${EXPOSE_NGINX_PORT}
OSS_REMOTE_ENDPOINTRequiredurlObject storage remote endpoint address (defaults from HOST_BASE_ADDRESS and EXPOSE_MINIO_PORT)${HOST_BASE_ADDRESS}:${EXPOSE_MINIO_PORT}
OSS_BUCKET_CONSOLERequiredstringObject storage bucket name used by Consoleconsole-oss
OSS_PRESIGN_EXPIRY_SECONDS_CONSOLERequiredintConsole presigned URL expiration time (seconds)600
REDIS_DATABASE_CONSOLERequiredintRedis database index used by Console1
OAUTH2_ISSUER_URIRequiredurlOAuth2 issuer URI (defaults from CONSOLE_CASDOOR_URL)${CONSOLE_CASDOOR_URL:-http://auth-server:8000}
OAUTH2_JWK_SET_URIRequiredurlOAuth2 JWK key set URI (defaults from CONSOLE_CASDOOR_URL)${CONSOLE_CASDOOR_URL:-http://auth-server:8000}/.well-known/jwks
OAUTH2_AUDIENCERequiredstringOAuth2 audience identifier (defaults from CONSOLE_CASDOOR_ID)${CONSOLE_CASDOOR_ID:-your-oauth2-client-id}
WECHAT_COMPONENT_APPIDOptionalstringWeChat third-party platform AppIDyour-wechat-component-appid
WECHAT_COMPONENT_SECRETOptionalstringWeChat third-party platform Secretyour-wechat-secret
WECHAT_TOKENOptionalstringWeChat message verification Tokenyour-wechat-token
WECHAT_ENCODING_AES_KEYOptionalstringWeChat message encryption keyyour-wechat-encoding-aes-key
WORKFLOW_CHAT_URLRequiredurlWorkflow chat API address (port defaults from CORE_WORKFLOW_PORT)http://core-workflow:${CORE_WORKFLOW_PORT:-7880}/workflow/v1/chat/completions
WORKFLOW_DEBUG_URLRequiredurlWorkflow debug API address (port defaults from CORE_WORKFLOW_PORT)http://core-workflow:${CORE_WORKFLOW_PORT:-7880}/workflow/v1/debug/chat/completions
WORKFLOW_RESUME_URLRequiredurlWorkflow resume API address (port defaults from CORE_WORKFLOW_PORT)http://core-workflow:${CORE_WORKFLOW_PORT:-7880}/workflow/v1/resume
TENANT_IDRequiredstringTenant ID680ab54f
TENANT_KEYRequiredstringTenant API Key7b709739e8da44536127a333c7603a83
TENANT_SECRETRequiredstringTenant SecretNjhmY2NmM2NkZDE4MDFlNmM5ZjcyZjMy
COMMON_APPIDRequiredstringCommon application ID (defaults from TENANT_ID)${TENANT_ID}
COMMON_APIKEYRequiredstringCommon API Key (defaults from TENANT_KEY)${TENANT_KEY}
COMMON_API_SECRETRequiredstringCommon API Secret (defaults from TENANT_SECRET)${TENANT_SECRET}
ADMIN_UIDRequiredstringAdministrator user ID9999
APP_URLRequiredurlApplication service API address (port defaults from CORE_TENANT_PORT)http://core-tenant:${CORE_TENANT_PORT:-5052}/v2/app
KNOWLEDGE_URLRequiredurlKnowledge base service API address (port defaults from CORE_KNOWLEDGE_PORT)http://core-knowledge:${CORE_KNOWLEDGE_PORT:-20010}/knowledge
TOOL_URLRequiredurlTool service API addresshttp://core-link:18888
WORKFLOW_URLRequiredurlWorkflow service API address (port defaults from CORE_WORKFLOW_PORT)http://core-workflow:${CORE_WORKFLOW_PORT:-7880}
SPARK_DB_URLRequiredurlSpark database service API address (port defaults from CORE_DATABASE_PORT)http://core-database:${CORE_DATABASE_PORT:-7990}
LOCAL_MODEL_URLRequiredurlLocal model service addresshttp://127.0.0.1:33778

13. MaaS Platform Configuration Module

Variable NameConfiguration TypeTypeDescriptionExample Value
MAAS_APP_IDRequiredstringMaaS platform application ID (defaults from TENANT_ID)${TENANT_ID}
MAAS_API_KEYRequiredstringMaaS platform API Key (defaults from TENANT_KEY)${TENANT_KEY}
MAAS_API_SECRETRequiredstringMaaS platform API Secret (defaults from TENANT_SECRET)${TENANT_SECRET}
MAAS_CONSUMER_IDRequiredstringMaaS consumer ID (defaults from TENANT_ID)${TENANT_ID}
MAAS_CONSUMER_KEYRequiredstringMaaS consumer Key (defaults from TENANT_KEY)${TENANT_KEY}
MAAS_CONSUMER_SECRETRequiredstringMaaS consumer Secret (defaults from TENANT_SECRET)${TENANT_SECRET}
MAAS_WORKFLOW_VERSIONRequiredurlMaaS workflow version API addresshttp://127.0.0.1:8080/workflow/version
MAAS_SYNCHRONIZE_WORK_FLOWRequiredurlMaaS synchronize workflow API addresshttp://127.0.0.1:8080/workflow
MAAS_PUBLISHRequiredurlMaaS publish API addresshttp://127.0.0.1:8080/workflow/publish
MAAS_CLONE_WORK_FLOWRequiredurlMaaS clone workflow API addresshttp://127.0.0.1:8080/workflow/internal-clone
MAAS_GET_INPUTSRequiredurlMaaS get inputs information API addresshttp://127.0.0.1:8080/workflow/get-inputs-info
MAAS_CAN_PUBLISH_URLRequiredurlMaaS check can publish API addresshttp://127.0.0.1:8080/workflow/can-publish
MAAS_PUBLISH_APIRequiredurlMaaS publish API address (port defaults from CORE_WORKFLOW_PORT)http://core-workflow:${CORE_WORKFLOW_PORT:-7880}/workflow/v1/publish
MAAS_AUTH_APIRequiredurlMaaS authentication API address (port defaults from CORE_WORKFLOW_PORT)http://core-workflow:${CORE_WORKFLOW_PORT:-7880}/workflow/v1/auth
MAAS_MCP_REGISTERRequiredurlMaaS MCP register API addresshttp://127.0.0.1:8080/workflow/release
MAAS_WORKFLOW_CONFIGRequiredurlMaaS workflow configuration API addresshttp://127.0.0.1:8080/workflow/get-flow-advanced-config
BOT_API_CBM_BASE_URLRequiredurlBot API CBM base address (supports ws/wss, note written as ws(s):// in env.example)wss://spark-openapi.cn-huabei-1.xf-yun.com
BOT_API_MAAS_BASE_URLRequiredurlBot API MaaS base address (note written as http(s):// in env.example)https://xingchen-api.xf-yun.com
TENANT_CREATE_APPRequiredurlTenant create application API address (port defaults from CORE_TENANT_PORT)http://core-tenant:${CORE_TENANT_PORT:-5052}/v2/app
TENANT_GET_APP_DETAILRequiredurlTenant get application details API address (port defaults from CORE_TENANT_PORT)http://core-tenant:${CORE_TENANT_PORT:-5052}/v2/app/details

14. Third-Party Service Configuration

Variable NameConfiguration TypeTypeDescriptionExample Value
DEEPSEEK_URLRequiredurlDeepSeek API endpoint addresshttps://api.deepseek.com/chat/completions
DEEPSEEK_API_KEYOptionalstringDeepSeek API Keysk-xxx

15. Other System Configuration

Variable NameConfiguration TypeTypeDescriptionExample Value
SERVICE_LOCATIONRequiredstringService availability zone (dx/hf/gz)hf
HEALTH_CHECK_INTERVALRequiredstringHealth check interval time30s
HEALTH_CHECK_TIMEOUTRequiredstringHealth check timeout10s
HEALTH_CHECK_RETRIESRequiredintHealth check retry count60
NETWORK_SUBNETRequiredstringDocker network subnet configuration172.20.0.0/16

Contributing

If you find any errors in the configuration description or need to add more information, please feel free to submit an Issue or Pull Request.