您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

.env.example 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. # Your App secret key will be used for securely signing the session cookie
  2. # Make sure you are changing this key for your deployment with a strong key.
  3. # You can generate a strong key using `openssl rand -base64 42`.
  4. # Alternatively you can set it with `SECRET_KEY` environment variable.
  5. SECRET_KEY=
  6. # Ensure UTF-8 encoding
  7. LANG=en_US.UTF-8
  8. LC_ALL=en_US.UTF-8
  9. PYTHONIOENCODING=utf-8
  10. # Console API base URL
  11. CONSOLE_API_URL=http://localhost:5001
  12. CONSOLE_WEB_URL=http://localhost:3000
  13. # Service API base URL
  14. SERVICE_API_URL=http://localhost:5001
  15. # Web APP base URL
  16. APP_WEB_URL=http://localhost:3000
  17. # Files URL
  18. FILES_URL=http://localhost:5001
  19. # INTERNAL_FILES_URL is used for plugin daemon communication within Docker network.
  20. # Set this to the internal Docker service URL for proper plugin file access.
  21. # Example: INTERNAL_FILES_URL=http://api:5001
  22. INTERNAL_FILES_URL=http://127.0.0.1:5001
  23. # The time in seconds after the signature is rejected
  24. FILES_ACCESS_TIMEOUT=300
  25. # Access token expiration time in minutes
  26. ACCESS_TOKEN_EXPIRE_MINUTES=60
  27. # Refresh token expiration time in days
  28. REFRESH_TOKEN_EXPIRE_DAYS=30
  29. # redis configuration
  30. REDIS_HOST=localhost
  31. REDIS_PORT=6379
  32. REDIS_USERNAME=
  33. REDIS_PASSWORD=difyai123456
  34. REDIS_USE_SSL=false
  35. # SSL configuration for Redis (when REDIS_USE_SSL=true)
  36. REDIS_SSL_CERT_REQS=CERT_NONE
  37. # Options: CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
  38. REDIS_SSL_CA_CERTS=
  39. # Path to CA certificate file for SSL verification
  40. REDIS_SSL_CERTFILE=
  41. # Path to client certificate file for SSL authentication
  42. REDIS_SSL_KEYFILE=
  43. # Path to client private key file for SSL authentication
  44. REDIS_DB=0
  45. # redis Sentinel configuration.
  46. REDIS_USE_SENTINEL=false
  47. REDIS_SENTINELS=
  48. REDIS_SENTINEL_SERVICE_NAME=
  49. REDIS_SENTINEL_USERNAME=
  50. REDIS_SENTINEL_PASSWORD=
  51. REDIS_SENTINEL_SOCKET_TIMEOUT=0.1
  52. # redis Cluster configuration.
  53. REDIS_USE_CLUSTERS=false
  54. REDIS_CLUSTERS=
  55. REDIS_CLUSTERS_PASSWORD=
  56. # celery configuration
  57. CELERY_BROKER_URL=redis://:difyai123456@localhost:${REDIS_PORT}/1
  58. CELERY_BACKEND=redis
  59. # PostgreSQL database configuration
  60. DB_USERNAME=postgres
  61. DB_PASSWORD=difyai123456
  62. DB_HOST=localhost
  63. DB_PORT=5432
  64. DB_DATABASE=dify
  65. SQLALCHEMY_POOL_PRE_PING=true
  66. SQLALCHEMY_POOL_TIMEOUT=30
  67. # Storage configuration
  68. # use for store upload files, private keys...
  69. # storage type: opendal, s3, aliyun-oss, azure-blob, baidu-obs, google-storage, huawei-obs, oci-storage, tencent-cos, volcengine-tos, supabase
  70. STORAGE_TYPE=opendal
  71. # Apache OpenDAL storage configuration, refer to https://github.com/apache/opendal
  72. OPENDAL_SCHEME=fs
  73. OPENDAL_FS_ROOT=storage
  74. # S3 Storage configuration
  75. S3_USE_AWS_MANAGED_IAM=false
  76. S3_ENDPOINT=https://your-bucket-name.storage.s3.cloudflare.com
  77. S3_BUCKET_NAME=your-bucket-name
  78. S3_ACCESS_KEY=your-access-key
  79. S3_SECRET_KEY=your-secret-key
  80. S3_REGION=your-region
  81. # Azure Blob Storage configuration
  82. AZURE_BLOB_ACCOUNT_NAME=your-account-name
  83. AZURE_BLOB_ACCOUNT_KEY=your-account-key
  84. AZURE_BLOB_CONTAINER_NAME=your-container-name
  85. AZURE_BLOB_ACCOUNT_URL=https://<your_account_name>.blob.core.windows.net
  86. # Aliyun oss Storage configuration
  87. ALIYUN_OSS_BUCKET_NAME=your-bucket-name
  88. ALIYUN_OSS_ACCESS_KEY=your-access-key
  89. ALIYUN_OSS_SECRET_KEY=your-secret-key
  90. ALIYUN_OSS_ENDPOINT=your-endpoint
  91. ALIYUN_OSS_AUTH_VERSION=v1
  92. ALIYUN_OSS_REGION=your-region
  93. # Don't start with '/'. OSS doesn't support leading slash in object names.
  94. ALIYUN_OSS_PATH=your-path
  95. # Google Storage configuration
  96. GOOGLE_STORAGE_BUCKET_NAME=your-bucket-name
  97. GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64=your-google-service-account-json-base64-string
  98. # Tencent COS Storage configuration
  99. TENCENT_COS_BUCKET_NAME=your-bucket-name
  100. TENCENT_COS_SECRET_KEY=your-secret-key
  101. TENCENT_COS_SECRET_ID=your-secret-id
  102. TENCENT_COS_REGION=your-region
  103. TENCENT_COS_SCHEME=your-scheme
  104. # Huawei OBS Storage Configuration
  105. HUAWEI_OBS_BUCKET_NAME=your-bucket-name
  106. HUAWEI_OBS_SECRET_KEY=your-secret-key
  107. HUAWEI_OBS_ACCESS_KEY=your-access-key
  108. HUAWEI_OBS_SERVER=your-server-url
  109. # Baidu OBS Storage Configuration
  110. BAIDU_OBS_BUCKET_NAME=your-bucket-name
  111. BAIDU_OBS_SECRET_KEY=your-secret-key
  112. BAIDU_OBS_ACCESS_KEY=your-access-key
  113. BAIDU_OBS_ENDPOINT=your-server-url
  114. # OCI Storage configuration
  115. OCI_ENDPOINT=your-endpoint
  116. OCI_BUCKET_NAME=your-bucket-name
  117. OCI_ACCESS_KEY=your-access-key
  118. OCI_SECRET_KEY=your-secret-key
  119. OCI_REGION=your-region
  120. # Volcengine tos Storage configuration
  121. VOLCENGINE_TOS_ENDPOINT=your-endpoint
  122. VOLCENGINE_TOS_BUCKET_NAME=your-bucket-name
  123. VOLCENGINE_TOS_ACCESS_KEY=your-access-key
  124. VOLCENGINE_TOS_SECRET_KEY=your-secret-key
  125. VOLCENGINE_TOS_REGION=your-region
  126. # Supabase Storage Configuration
  127. SUPABASE_BUCKET_NAME=your-bucket-name
  128. SUPABASE_API_KEY=your-access-key
  129. SUPABASE_URL=your-server-url
  130. # CORS configuration
  131. WEB_API_CORS_ALLOW_ORIGINS=http://localhost:3000,*
  132. CONSOLE_CORS_ALLOW_ORIGINS=http://localhost:3000,*
  133. # Vector database configuration
  134. # Supported values are `weaviate`, `qdrant`, `milvus`, `myscale`, `relyt`, `pgvector`, `pgvecto-rs`, `chroma`, `opensearch`, `oracle`, `tencent`, `elasticsearch`, `elasticsearch-ja`, `analyticdb`, `couchbase`, `vikingdb`, `oceanbase`, `opengauss`, `tablestore`,`vastbase`,`tidb`,`tidb_on_qdrant`,`baidu`,`lindorm`,`huawei_cloud`,`upstash`, `matrixone`.
  135. VECTOR_STORE=weaviate
  136. # Prefix used to create collection name in vector database
  137. VECTOR_INDEX_NAME_PREFIX=Vector_index
  138. # Weaviate configuration
  139. WEAVIATE_ENDPOINT=http://localhost:8080
  140. WEAVIATE_API_KEY=WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  141. WEAVIATE_GRPC_ENABLED=false
  142. WEAVIATE_BATCH_SIZE=100
  143. # Qdrant configuration, use `http://localhost:6333` for local mode or `https://your-qdrant-cluster-url.qdrant.io` for remote mode
  144. QDRANT_URL=http://localhost:6333
  145. QDRANT_API_KEY=difyai123456
  146. QDRANT_CLIENT_TIMEOUT=20
  147. QDRANT_GRPC_ENABLED=false
  148. QDRANT_GRPC_PORT=6334
  149. QDRANT_REPLICATION_FACTOR=1
  150. #Couchbase configuration
  151. COUCHBASE_CONNECTION_STRING=127.0.0.1
  152. COUCHBASE_USER=Administrator
  153. COUCHBASE_PASSWORD=password
  154. COUCHBASE_BUCKET_NAME=Embeddings
  155. COUCHBASE_SCOPE_NAME=_default
  156. # Milvus configuration
  157. MILVUS_URI=http://127.0.0.1:19530
  158. MILVUS_TOKEN=
  159. MILVUS_USER=root
  160. MILVUS_PASSWORD=Milvus
  161. MILVUS_ANALYZER_PARAMS=
  162. # MyScale configuration
  163. MYSCALE_HOST=127.0.0.1
  164. MYSCALE_PORT=8123
  165. MYSCALE_USER=default
  166. MYSCALE_PASSWORD=
  167. MYSCALE_DATABASE=default
  168. MYSCALE_FTS_PARAMS=
  169. # Relyt configuration
  170. RELYT_HOST=127.0.0.1
  171. RELYT_PORT=5432
  172. RELYT_USER=postgres
  173. RELYT_PASSWORD=postgres
  174. RELYT_DATABASE=postgres
  175. # Tencent configuration
  176. TENCENT_VECTOR_DB_URL=http://127.0.0.1
  177. TENCENT_VECTOR_DB_API_KEY=dify
  178. TENCENT_VECTOR_DB_TIMEOUT=30
  179. TENCENT_VECTOR_DB_USERNAME=dify
  180. TENCENT_VECTOR_DB_DATABASE=dify
  181. TENCENT_VECTOR_DB_SHARD=1
  182. TENCENT_VECTOR_DB_REPLICAS=2
  183. TENCENT_VECTOR_DB_ENABLE_HYBRID_SEARCH=false
  184. # ElasticSearch configuration
  185. ELASTICSEARCH_HOST=127.0.0.1
  186. ELASTICSEARCH_PORT=9200
  187. ELASTICSEARCH_USERNAME=elastic
  188. ELASTICSEARCH_PASSWORD=elastic
  189. # PGVECTO_RS configuration
  190. PGVECTO_RS_HOST=localhost
  191. PGVECTO_RS_PORT=5431
  192. PGVECTO_RS_USER=postgres
  193. PGVECTO_RS_PASSWORD=difyai123456
  194. PGVECTO_RS_DATABASE=postgres
  195. # PGVector configuration
  196. PGVECTOR_HOST=127.0.0.1
  197. PGVECTOR_PORT=5433
  198. PGVECTOR_USER=postgres
  199. PGVECTOR_PASSWORD=postgres
  200. PGVECTOR_DATABASE=postgres
  201. PGVECTOR_MIN_CONNECTION=1
  202. PGVECTOR_MAX_CONNECTION=5
  203. # TableStore Vector configuration
  204. TABLESTORE_ENDPOINT=https://instance-name.cn-hangzhou.ots.aliyuncs.com
  205. TABLESTORE_INSTANCE_NAME=instance-name
  206. TABLESTORE_ACCESS_KEY_ID=xxx
  207. TABLESTORE_ACCESS_KEY_SECRET=xxx
  208. TABLESTORE_NORMALIZE_FULLTEXT_BM25_SCORE=false
  209. # Tidb Vector configuration
  210. TIDB_VECTOR_HOST=xxx.eu-central-1.xxx.aws.tidbcloud.com
  211. TIDB_VECTOR_PORT=4000
  212. TIDB_VECTOR_USER=xxx.root
  213. TIDB_VECTOR_PASSWORD=xxxxxx
  214. TIDB_VECTOR_DATABASE=dify
  215. # Tidb on qdrant configuration
  216. TIDB_ON_QDRANT_URL=http://127.0.0.1
  217. TIDB_ON_QDRANT_API_KEY=dify
  218. TIDB_ON_QDRANT_CLIENT_TIMEOUT=20
  219. TIDB_ON_QDRANT_GRPC_ENABLED=false
  220. TIDB_ON_QDRANT_GRPC_PORT=6334
  221. TIDB_PUBLIC_KEY=dify
  222. TIDB_PRIVATE_KEY=dify
  223. TIDB_API_URL=http://127.0.0.1
  224. TIDB_IAM_API_URL=http://127.0.0.1
  225. TIDB_REGION=regions/aws-us-east-1
  226. TIDB_PROJECT_ID=dify
  227. TIDB_SPEND_LIMIT=100
  228. # Chroma configuration
  229. CHROMA_HOST=127.0.0.1
  230. CHROMA_PORT=8000
  231. CHROMA_TENANT=default_tenant
  232. CHROMA_DATABASE=default_database
  233. CHROMA_AUTH_PROVIDER=chromadb.auth.token_authn.TokenAuthenticationServerProvider
  234. CHROMA_AUTH_CREDENTIALS=difyai123456
  235. # AnalyticDB configuration
  236. ANALYTICDB_KEY_ID=your-ak
  237. ANALYTICDB_KEY_SECRET=your-sk
  238. ANALYTICDB_REGION_ID=cn-hangzhou
  239. ANALYTICDB_INSTANCE_ID=gp-ab123456
  240. ANALYTICDB_ACCOUNT=testaccount
  241. ANALYTICDB_PASSWORD=testpassword
  242. ANALYTICDB_NAMESPACE=dify
  243. ANALYTICDB_NAMESPACE_PASSWORD=difypassword
  244. ANALYTICDB_HOST=gp-test.aliyuncs.com
  245. ANALYTICDB_PORT=5432
  246. ANALYTICDB_MIN_CONNECTION=1
  247. ANALYTICDB_MAX_CONNECTION=5
  248. # OpenSearch configuration
  249. OPENSEARCH_HOST=127.0.0.1
  250. OPENSEARCH_PORT=9200
  251. OPENSEARCH_USER=admin
  252. OPENSEARCH_PASSWORD=admin
  253. OPENSEARCH_SECURE=true
  254. OPENSEARCH_VERIFY_CERTS=true
  255. # Baidu configuration
  256. BAIDU_VECTOR_DB_ENDPOINT=http://127.0.0.1:5287
  257. BAIDU_VECTOR_DB_CONNECTION_TIMEOUT_MS=30000
  258. BAIDU_VECTOR_DB_ACCOUNT=root
  259. BAIDU_VECTOR_DB_API_KEY=dify
  260. BAIDU_VECTOR_DB_DATABASE=dify
  261. BAIDU_VECTOR_DB_SHARD=1
  262. BAIDU_VECTOR_DB_REPLICAS=3
  263. # Upstash configuration
  264. UPSTASH_VECTOR_URL=your-server-url
  265. UPSTASH_VECTOR_TOKEN=your-access-token
  266. # ViKingDB configuration
  267. VIKINGDB_ACCESS_KEY=your-ak
  268. VIKINGDB_SECRET_KEY=your-sk
  269. VIKINGDB_REGION=cn-shanghai
  270. VIKINGDB_HOST=api-vikingdb.xxx.volces.com
  271. VIKINGDB_SCHEMA=http
  272. VIKINGDB_CONNECTION_TIMEOUT=30
  273. VIKINGDB_SOCKET_TIMEOUT=30
  274. # Matrixone configration
  275. MATRIXONE_HOST=127.0.0.1
  276. MATRIXONE_PORT=6001
  277. MATRIXONE_USER=dump
  278. MATRIXONE_PASSWORD=111
  279. MATRIXONE_DATABASE=dify
  280. # Lindorm configuration
  281. LINDORM_URL=http://ld-*******************-proxy-search-pub.lindorm.aliyuncs.com:30070
  282. LINDORM_USERNAME=admin
  283. LINDORM_PASSWORD=admin
  284. LINDORM_USING_UGC=True
  285. LINDORM_QUERY_TIMEOUT=1
  286. # OceanBase Vector configuration
  287. OCEANBASE_VECTOR_HOST=127.0.0.1
  288. OCEANBASE_VECTOR_PORT=2881
  289. OCEANBASE_VECTOR_USER=root@test
  290. OCEANBASE_VECTOR_PASSWORD=difyai123456
  291. OCEANBASE_VECTOR_DATABASE=test
  292. OCEANBASE_MEMORY_LIMIT=6G
  293. OCEANBASE_ENABLE_HYBRID_SEARCH=false
  294. # openGauss configuration
  295. OPENGAUSS_HOST=127.0.0.1
  296. OPENGAUSS_PORT=6600
  297. OPENGAUSS_USER=postgres
  298. OPENGAUSS_PASSWORD=Dify@123
  299. OPENGAUSS_DATABASE=dify
  300. OPENGAUSS_MIN_CONNECTION=1
  301. OPENGAUSS_MAX_CONNECTION=5
  302. # Upload configuration
  303. UPLOAD_FILE_SIZE_LIMIT=15
  304. UPLOAD_FILE_BATCH_LIMIT=5
  305. UPLOAD_IMAGE_FILE_SIZE_LIMIT=10
  306. UPLOAD_VIDEO_FILE_SIZE_LIMIT=100
  307. UPLOAD_AUDIO_FILE_SIZE_LIMIT=50
  308. # Model configuration
  309. MULTIMODAL_SEND_FORMAT=base64
  310. PROMPT_GENERATION_MAX_TOKENS=512
  311. CODE_GENERATION_MAX_TOKENS=1024
  312. PLUGIN_BASED_TOKEN_COUNTING_ENABLED=false
  313. # Mail configuration, support: resend, smtp, sendgrid
  314. MAIL_TYPE=
  315. # If using SendGrid, use the 'from' field for authentication if necessary.
  316. MAIL_DEFAULT_SEND_FROM=no-reply <no-reply@dify.ai>
  317. # resend configuration
  318. RESEND_API_KEY=
  319. RESEND_API_URL=https://api.resend.com
  320. # smtp configuration
  321. SMTP_SERVER=smtp.gmail.com
  322. SMTP_PORT=465
  323. SMTP_USERNAME=123
  324. SMTP_PASSWORD=abc
  325. SMTP_USE_TLS=true
  326. SMTP_OPPORTUNISTIC_TLS=false
  327. # Sendgid configuration
  328. SENDGRID_API_KEY=
  329. # Sentry configuration
  330. SENTRY_DSN=
  331. # DEBUG
  332. DEBUG=false
  333. ENABLE_REQUEST_LOGGING=False
  334. SQLALCHEMY_ECHO=false
  335. # Notion import configuration, support public and internal
  336. NOTION_INTEGRATION_TYPE=public
  337. NOTION_CLIENT_SECRET=you-client-secret
  338. NOTION_CLIENT_ID=you-client-id
  339. NOTION_INTERNAL_SECRET=you-internal-secret
  340. ETL_TYPE=dify
  341. UNSTRUCTURED_API_URL=
  342. UNSTRUCTURED_API_KEY=
  343. SCARF_NO_ANALYTICS=true
  344. #ssrf
  345. SSRF_PROXY_HTTP_URL=
  346. SSRF_PROXY_HTTPS_URL=
  347. SSRF_DEFAULT_MAX_RETRIES=3
  348. SSRF_DEFAULT_TIME_OUT=5
  349. SSRF_DEFAULT_CONNECT_TIME_OUT=5
  350. SSRF_DEFAULT_READ_TIME_OUT=5
  351. SSRF_DEFAULT_WRITE_TIME_OUT=5
  352. BATCH_UPLOAD_LIMIT=10
  353. KEYWORD_DATA_SOURCE_TYPE=database
  354. # Workflow file upload limit
  355. WORKFLOW_FILE_UPLOAD_LIMIT=10
  356. # CODE EXECUTION CONFIGURATION
  357. CODE_EXECUTION_ENDPOINT=http://127.0.0.1:8194
  358. CODE_EXECUTION_API_KEY=dify-sandbox
  359. CODE_MAX_NUMBER=9223372036854775807
  360. CODE_MIN_NUMBER=-9223372036854775808
  361. CODE_MAX_STRING_LENGTH=80000
  362. TEMPLATE_TRANSFORM_MAX_LENGTH=80000
  363. CODE_MAX_STRING_ARRAY_LENGTH=30
  364. CODE_MAX_OBJECT_ARRAY_LENGTH=30
  365. CODE_MAX_NUMBER_ARRAY_LENGTH=1000
  366. # API Tool configuration
  367. API_TOOL_DEFAULT_CONNECT_TIMEOUT=10
  368. API_TOOL_DEFAULT_READ_TIMEOUT=60
  369. # HTTP Node configuration
  370. HTTP_REQUEST_MAX_CONNECT_TIMEOUT=300
  371. HTTP_REQUEST_MAX_READ_TIMEOUT=600
  372. HTTP_REQUEST_MAX_WRITE_TIMEOUT=600
  373. HTTP_REQUEST_NODE_MAX_BINARY_SIZE=10485760
  374. HTTP_REQUEST_NODE_MAX_TEXT_SIZE=1048576
  375. HTTP_REQUEST_NODE_SSL_VERIFY=True
  376. # Respect X-* headers to redirect clients
  377. RESPECT_XFORWARD_HEADERS_ENABLED=false
  378. # Log file path
  379. LOG_FILE=
  380. # Log file max size, the unit is MB
  381. LOG_FILE_MAX_SIZE=20
  382. # Log file max backup count
  383. LOG_FILE_BACKUP_COUNT=5
  384. # Log dateformat
  385. LOG_DATEFORMAT=%Y-%m-%d %H:%M:%S
  386. # Log Timezone
  387. LOG_TZ=UTC
  388. # Log format
  389. LOG_FORMAT=%(asctime)s,%(msecs)d %(levelname)-2s [%(filename)s:%(lineno)d] %(req_id)s %(message)s
  390. # Indexing configuration
  391. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=4000
  392. # Workflow runtime configuration
  393. WORKFLOW_MAX_EXECUTION_STEPS=500
  394. WORKFLOW_MAX_EXECUTION_TIME=1200
  395. WORKFLOW_CALL_MAX_DEPTH=5
  396. WORKFLOW_PARALLEL_DEPTH_LIMIT=3
  397. MAX_VARIABLE_SIZE=204800
  398. # GraphEngine Worker Pool Configuration
  399. # Minimum number of workers per GraphEngine instance (default: 1)
  400. GRAPH_ENGINE_MIN_WORKERS=1
  401. # Maximum number of workers per GraphEngine instance (default: 10)
  402. GRAPH_ENGINE_MAX_WORKERS=10
  403. # Queue depth threshold that triggers worker scale up (default: 3)
  404. GRAPH_ENGINE_SCALE_UP_THRESHOLD=3
  405. # Seconds of idle time before scaling down workers (default: 5.0)
  406. GRAPH_ENGINE_SCALE_DOWN_IDLE_TIME=5.0
  407. # Workflow storage configuration
  408. # Options: rdbms, hybrid
  409. # rdbms: Use only the relational database (default)
  410. # hybrid: Save new data to object storage, read from both object storage and RDBMS
  411. WORKFLOW_NODE_EXECUTION_STORAGE=rdbms
  412. # Repository configuration
  413. # Core workflow execution repository implementation
  414. CORE_WORKFLOW_EXECUTION_REPOSITORY=core.repositories.sqlalchemy_workflow_execution_repository.SQLAlchemyWorkflowExecutionRepository
  415. # Core workflow node execution repository implementation
  416. CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY=core.repositories.sqlalchemy_workflow_node_execution_repository.SQLAlchemyWorkflowNodeExecutionRepository
  417. # API workflow node execution repository implementation
  418. API_WORKFLOW_NODE_EXECUTION_REPOSITORY=repositories.sqlalchemy_api_workflow_node_execution_repository.DifyAPISQLAlchemyWorkflowNodeExecutionRepository
  419. # API workflow run repository implementation
  420. API_WORKFLOW_RUN_REPOSITORY=repositories.sqlalchemy_api_workflow_run_repository.DifyAPISQLAlchemyWorkflowRunRepository
  421. # Workflow log cleanup configuration
  422. # Enable automatic cleanup of workflow run logs to manage database size
  423. WORKFLOW_LOG_CLEANUP_ENABLED=true
  424. # Number of days to retain workflow run logs (default: 30 days)
  425. WORKFLOW_LOG_RETENTION_DAYS=30
  426. # Batch size for workflow log cleanup operations (default: 100)
  427. WORKFLOW_LOG_CLEANUP_BATCH_SIZE=100
  428. # App configuration
  429. APP_MAX_EXECUTION_TIME=1200
  430. APP_MAX_ACTIVE_REQUESTS=0
  431. # Celery beat configuration
  432. CELERY_BEAT_SCHEDULER_TIME=1
  433. # Celery schedule tasks configuration
  434. ENABLE_CLEAN_EMBEDDING_CACHE_TASK=false
  435. ENABLE_CLEAN_UNUSED_DATASETS_TASK=false
  436. ENABLE_CREATE_TIDB_SERVERLESS_TASK=false
  437. ENABLE_UPDATE_TIDB_SERVERLESS_STATUS_TASK=false
  438. ENABLE_CLEAN_MESSAGES=false
  439. ENABLE_MAIL_CLEAN_DOCUMENT_NOTIFY_TASK=false
  440. ENABLE_DATASETS_QUEUE_MONITOR=false
  441. ENABLE_CHECK_UPGRADABLE_PLUGIN_TASK=true
  442. # Position configuration
  443. POSITION_TOOL_PINS=
  444. POSITION_TOOL_INCLUDES=
  445. POSITION_TOOL_EXCLUDES=
  446. POSITION_PROVIDER_PINS=
  447. POSITION_PROVIDER_INCLUDES=
  448. POSITION_PROVIDER_EXCLUDES=
  449. # Plugin configuration
  450. PLUGIN_DAEMON_KEY=lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi
  451. PLUGIN_DAEMON_URL=http://127.0.0.1:5002
  452. PLUGIN_REMOTE_INSTALL_PORT=5003
  453. PLUGIN_REMOTE_INSTALL_HOST=localhost
  454. PLUGIN_MAX_PACKAGE_SIZE=15728640
  455. INNER_API_KEY_FOR_PLUGIN=QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1
  456. # Marketplace configuration
  457. MARKETPLACE_ENABLED=true
  458. MARKETPLACE_API_URL=https://marketplace.dify.ai
  459. # Endpoint configuration
  460. ENDPOINT_URL_TEMPLATE=http://localhost:5002/e/{hook_id}
  461. # Reset password token expiry minutes
  462. RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5
  463. EMAIL_REGISTER_TOKEN_EXPIRY_MINUTES=5
  464. CHANGE_EMAIL_TOKEN_EXPIRY_MINUTES=5
  465. OWNER_TRANSFER_TOKEN_EXPIRY_MINUTES=5
  466. CREATE_TIDB_SERVICE_JOB_ENABLED=false
  467. # Maximum number of submitted thread count in a ThreadPool for parallel node execution
  468. MAX_SUBMIT_COUNT=100
  469. # Lockout duration in seconds
  470. LOGIN_LOCKOUT_DURATION=86400
  471. # Enable OpenTelemetry
  472. ENABLE_OTEL=false
  473. OTLP_TRACE_ENDPOINT=
  474. OTLP_METRIC_ENDPOINT=
  475. OTLP_BASE_ENDPOINT=http://localhost:4318
  476. OTLP_API_KEY=
  477. OTEL_EXPORTER_OTLP_PROTOCOL=
  478. OTEL_EXPORTER_TYPE=otlp
  479. OTEL_SAMPLING_RATE=0.1
  480. OTEL_BATCH_EXPORT_SCHEDULE_DELAY=5000
  481. OTEL_MAX_QUEUE_SIZE=2048
  482. OTEL_MAX_EXPORT_BATCH_SIZE=512
  483. OTEL_METRIC_EXPORT_INTERVAL=60000
  484. OTEL_BATCH_EXPORT_TIMEOUT=10000
  485. OTEL_METRIC_EXPORT_TIMEOUT=30000
  486. # Prevent Clickjacking
  487. ALLOW_EMBED=false
  488. # Dataset queue monitor configuration
  489. QUEUE_MONITOR_THRESHOLD=200
  490. # You can configure multiple ones, separated by commas. eg: test1@dify.ai,test2@dify.ai
  491. QUEUE_MONITOR_ALERT_EMAILS=
  492. # Monitor interval in minutes, default is 30 minutes
  493. QUEUE_MONITOR_INTERVAL=30
  494. # Swagger UI configuration
  495. SWAGGER_UI_ENABLED=true
  496. SWAGGER_UI_PATH=/swagger-ui.html
  497. # Whether to encrypt dataset IDs when exporting DSL files (default: true)
  498. # Set to false to export dataset IDs as plain text for easier cross-environment import
  499. DSL_EXPORT_ENCRYPT_DATASET_ID=true