Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

.env.example 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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. BAIDU_VECTOR_DB_INVERTED_INDEX_ANALYZER=DEFAULT_ANALYZER
  264. BAIDU_VECTOR_DB_INVERTED_INDEX_PARSER_MODE=COARSE_MODE
  265. # Upstash configuration
  266. UPSTASH_VECTOR_URL=your-server-url
  267. UPSTASH_VECTOR_TOKEN=your-access-token
  268. # ViKingDB configuration
  269. VIKINGDB_ACCESS_KEY=your-ak
  270. VIKINGDB_SECRET_KEY=your-sk
  271. VIKINGDB_REGION=cn-shanghai
  272. VIKINGDB_HOST=api-vikingdb.xxx.volces.com
  273. VIKINGDB_SCHEMA=http
  274. VIKINGDB_CONNECTION_TIMEOUT=30
  275. VIKINGDB_SOCKET_TIMEOUT=30
  276. # Matrixone configration
  277. MATRIXONE_HOST=127.0.0.1
  278. MATRIXONE_PORT=6001
  279. MATRIXONE_USER=dump
  280. MATRIXONE_PASSWORD=111
  281. MATRIXONE_DATABASE=dify
  282. # Lindorm configuration
  283. LINDORM_URL=http://ld-*******************-proxy-search-pub.lindorm.aliyuncs.com:30070
  284. LINDORM_USERNAME=admin
  285. LINDORM_PASSWORD=admin
  286. LINDORM_USING_UGC=True
  287. LINDORM_QUERY_TIMEOUT=1
  288. # OceanBase Vector configuration
  289. OCEANBASE_VECTOR_HOST=127.0.0.1
  290. OCEANBASE_VECTOR_PORT=2881
  291. OCEANBASE_VECTOR_USER=root@test
  292. OCEANBASE_VECTOR_PASSWORD=difyai123456
  293. OCEANBASE_VECTOR_DATABASE=test
  294. OCEANBASE_MEMORY_LIMIT=6G
  295. OCEANBASE_ENABLE_HYBRID_SEARCH=false
  296. # openGauss configuration
  297. OPENGAUSS_HOST=127.0.0.1
  298. OPENGAUSS_PORT=6600
  299. OPENGAUSS_USER=postgres
  300. OPENGAUSS_PASSWORD=Dify@123
  301. OPENGAUSS_DATABASE=dify
  302. OPENGAUSS_MIN_CONNECTION=1
  303. OPENGAUSS_MAX_CONNECTION=5
  304. # Upload configuration
  305. UPLOAD_FILE_SIZE_LIMIT=15
  306. UPLOAD_FILE_BATCH_LIMIT=5
  307. UPLOAD_IMAGE_FILE_SIZE_LIMIT=10
  308. UPLOAD_VIDEO_FILE_SIZE_LIMIT=100
  309. UPLOAD_AUDIO_FILE_SIZE_LIMIT=50
  310. # Model configuration
  311. MULTIMODAL_SEND_FORMAT=base64
  312. PROMPT_GENERATION_MAX_TOKENS=512
  313. CODE_GENERATION_MAX_TOKENS=1024
  314. PLUGIN_BASED_TOKEN_COUNTING_ENABLED=false
  315. # Mail configuration, support: resend, smtp, sendgrid
  316. MAIL_TYPE=
  317. # If using SendGrid, use the 'from' field for authentication if necessary.
  318. MAIL_DEFAULT_SEND_FROM=no-reply <no-reply@dify.ai>
  319. # resend configuration
  320. RESEND_API_KEY=
  321. RESEND_API_URL=https://api.resend.com
  322. # smtp configuration
  323. SMTP_SERVER=smtp.gmail.com
  324. SMTP_PORT=465
  325. SMTP_USERNAME=123
  326. SMTP_PASSWORD=abc
  327. SMTP_USE_TLS=true
  328. SMTP_OPPORTUNISTIC_TLS=false
  329. # Sendgid configuration
  330. SENDGRID_API_KEY=
  331. # Sentry configuration
  332. SENTRY_DSN=
  333. # DEBUG
  334. DEBUG=false
  335. ENABLE_REQUEST_LOGGING=False
  336. SQLALCHEMY_ECHO=false
  337. # Notion import configuration, support public and internal
  338. NOTION_INTEGRATION_TYPE=public
  339. NOTION_CLIENT_SECRET=you-client-secret
  340. NOTION_CLIENT_ID=you-client-id
  341. NOTION_INTERNAL_SECRET=you-internal-secret
  342. ETL_TYPE=dify
  343. UNSTRUCTURED_API_URL=
  344. UNSTRUCTURED_API_KEY=
  345. SCARF_NO_ANALYTICS=true
  346. #ssrf
  347. SSRF_PROXY_HTTP_URL=
  348. SSRF_PROXY_HTTPS_URL=
  349. SSRF_DEFAULT_MAX_RETRIES=3
  350. SSRF_DEFAULT_TIME_OUT=5
  351. SSRF_DEFAULT_CONNECT_TIME_OUT=5
  352. SSRF_DEFAULT_READ_TIME_OUT=5
  353. SSRF_DEFAULT_WRITE_TIME_OUT=5
  354. BATCH_UPLOAD_LIMIT=10
  355. KEYWORD_DATA_SOURCE_TYPE=database
  356. # Workflow file upload limit
  357. WORKFLOW_FILE_UPLOAD_LIMIT=10
  358. # CODE EXECUTION CONFIGURATION
  359. CODE_EXECUTION_ENDPOINT=http://127.0.0.1:8194
  360. CODE_EXECUTION_API_KEY=dify-sandbox
  361. CODE_MAX_NUMBER=9223372036854775807
  362. CODE_MIN_NUMBER=-9223372036854775808
  363. CODE_MAX_STRING_LENGTH=80000
  364. TEMPLATE_TRANSFORM_MAX_LENGTH=80000
  365. CODE_MAX_STRING_ARRAY_LENGTH=30
  366. CODE_MAX_OBJECT_ARRAY_LENGTH=30
  367. CODE_MAX_NUMBER_ARRAY_LENGTH=1000
  368. # API Tool configuration
  369. API_TOOL_DEFAULT_CONNECT_TIMEOUT=10
  370. API_TOOL_DEFAULT_READ_TIMEOUT=60
  371. # HTTP Node configuration
  372. HTTP_REQUEST_MAX_CONNECT_TIMEOUT=300
  373. HTTP_REQUEST_MAX_READ_TIMEOUT=600
  374. HTTP_REQUEST_MAX_WRITE_TIMEOUT=600
  375. HTTP_REQUEST_NODE_MAX_BINARY_SIZE=10485760
  376. HTTP_REQUEST_NODE_MAX_TEXT_SIZE=1048576
  377. HTTP_REQUEST_NODE_SSL_VERIFY=True
  378. # Respect X-* headers to redirect clients
  379. RESPECT_XFORWARD_HEADERS_ENABLED=false
  380. # Log file path
  381. LOG_FILE=
  382. # Log file max size, the unit is MB
  383. LOG_FILE_MAX_SIZE=20
  384. # Log file max backup count
  385. LOG_FILE_BACKUP_COUNT=5
  386. # Log dateformat
  387. LOG_DATEFORMAT=%Y-%m-%d %H:%M:%S
  388. # Log Timezone
  389. LOG_TZ=UTC
  390. # Log format
  391. LOG_FORMAT=%(asctime)s,%(msecs)d %(levelname)-2s [%(filename)s:%(lineno)d] %(req_id)s %(message)s
  392. # Indexing configuration
  393. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=4000
  394. # Workflow runtime configuration
  395. WORKFLOW_MAX_EXECUTION_STEPS=500
  396. WORKFLOW_MAX_EXECUTION_TIME=1200
  397. WORKFLOW_CALL_MAX_DEPTH=5
  398. WORKFLOW_PARALLEL_DEPTH_LIMIT=3
  399. MAX_VARIABLE_SIZE=204800
  400. # GraphEngine Worker Pool Configuration
  401. # Minimum number of workers per GraphEngine instance (default: 1)
  402. GRAPH_ENGINE_MIN_WORKERS=1
  403. # Maximum number of workers per GraphEngine instance (default: 10)
  404. GRAPH_ENGINE_MAX_WORKERS=10
  405. # Queue depth threshold that triggers worker scale up (default: 3)
  406. GRAPH_ENGINE_SCALE_UP_THRESHOLD=3
  407. # Seconds of idle time before scaling down workers (default: 5.0)
  408. GRAPH_ENGINE_SCALE_DOWN_IDLE_TIME=5.0
  409. # Workflow storage configuration
  410. # Options: rdbms, hybrid
  411. # rdbms: Use only the relational database (default)
  412. # hybrid: Save new data to object storage, read from both object storage and RDBMS
  413. WORKFLOW_NODE_EXECUTION_STORAGE=rdbms
  414. # Repository configuration
  415. # Core workflow execution repository implementation
  416. CORE_WORKFLOW_EXECUTION_REPOSITORY=core.repositories.sqlalchemy_workflow_execution_repository.SQLAlchemyWorkflowExecutionRepository
  417. # Core workflow node execution repository implementation
  418. CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY=core.repositories.sqlalchemy_workflow_node_execution_repository.SQLAlchemyWorkflowNodeExecutionRepository
  419. # API workflow node execution repository implementation
  420. API_WORKFLOW_NODE_EXECUTION_REPOSITORY=repositories.sqlalchemy_api_workflow_node_execution_repository.DifyAPISQLAlchemyWorkflowNodeExecutionRepository
  421. # API workflow run repository implementation
  422. API_WORKFLOW_RUN_REPOSITORY=repositories.sqlalchemy_api_workflow_run_repository.DifyAPISQLAlchemyWorkflowRunRepository
  423. # Workflow log cleanup configuration
  424. # Enable automatic cleanup of workflow run logs to manage database size
  425. WORKFLOW_LOG_CLEANUP_ENABLED=true
  426. # Number of days to retain workflow run logs (default: 30 days)
  427. WORKFLOW_LOG_RETENTION_DAYS=30
  428. # Batch size for workflow log cleanup operations (default: 100)
  429. WORKFLOW_LOG_CLEANUP_BATCH_SIZE=100
  430. # App configuration
  431. APP_MAX_EXECUTION_TIME=1200
  432. APP_MAX_ACTIVE_REQUESTS=0
  433. # Celery beat configuration
  434. CELERY_BEAT_SCHEDULER_TIME=1
  435. # Celery schedule tasks configuration
  436. ENABLE_CLEAN_EMBEDDING_CACHE_TASK=false
  437. ENABLE_CLEAN_UNUSED_DATASETS_TASK=false
  438. ENABLE_CREATE_TIDB_SERVERLESS_TASK=false
  439. ENABLE_UPDATE_TIDB_SERVERLESS_STATUS_TASK=false
  440. ENABLE_CLEAN_MESSAGES=false
  441. ENABLE_MAIL_CLEAN_DOCUMENT_NOTIFY_TASK=false
  442. ENABLE_DATASETS_QUEUE_MONITOR=false
  443. ENABLE_CHECK_UPGRADABLE_PLUGIN_TASK=true
  444. # Position configuration
  445. POSITION_TOOL_PINS=
  446. POSITION_TOOL_INCLUDES=
  447. POSITION_TOOL_EXCLUDES=
  448. POSITION_PROVIDER_PINS=
  449. POSITION_PROVIDER_INCLUDES=
  450. POSITION_PROVIDER_EXCLUDES=
  451. # Plugin configuration
  452. PLUGIN_DAEMON_KEY=lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi
  453. PLUGIN_DAEMON_URL=http://127.0.0.1:5002
  454. PLUGIN_REMOTE_INSTALL_PORT=5003
  455. PLUGIN_REMOTE_INSTALL_HOST=localhost
  456. PLUGIN_MAX_PACKAGE_SIZE=15728640
  457. INNER_API_KEY_FOR_PLUGIN=QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1
  458. # Marketplace configuration
  459. MARKETPLACE_ENABLED=true
  460. MARKETPLACE_API_URL=https://marketplace.dify.ai
  461. # Endpoint configuration
  462. ENDPOINT_URL_TEMPLATE=http://localhost:5002/e/{hook_id}
  463. # Reset password token expiry minutes
  464. RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5
  465. EMAIL_REGISTER_TOKEN_EXPIRY_MINUTES=5
  466. CHANGE_EMAIL_TOKEN_EXPIRY_MINUTES=5
  467. OWNER_TRANSFER_TOKEN_EXPIRY_MINUTES=5
  468. CREATE_TIDB_SERVICE_JOB_ENABLED=false
  469. # Maximum number of submitted thread count in a ThreadPool for parallel node execution
  470. MAX_SUBMIT_COUNT=100
  471. # Lockout duration in seconds
  472. LOGIN_LOCKOUT_DURATION=86400
  473. # Enable OpenTelemetry
  474. ENABLE_OTEL=false
  475. OTLP_TRACE_ENDPOINT=
  476. OTLP_METRIC_ENDPOINT=
  477. OTLP_BASE_ENDPOINT=http://localhost:4318
  478. OTLP_API_KEY=
  479. OTEL_EXPORTER_OTLP_PROTOCOL=
  480. OTEL_EXPORTER_TYPE=otlp
  481. OTEL_SAMPLING_RATE=0.1
  482. OTEL_BATCH_EXPORT_SCHEDULE_DELAY=5000
  483. OTEL_MAX_QUEUE_SIZE=2048
  484. OTEL_MAX_EXPORT_BATCH_SIZE=512
  485. OTEL_METRIC_EXPORT_INTERVAL=60000
  486. OTEL_BATCH_EXPORT_TIMEOUT=10000
  487. OTEL_METRIC_EXPORT_TIMEOUT=30000
  488. # Prevent Clickjacking
  489. ALLOW_EMBED=false
  490. # Dataset queue monitor configuration
  491. QUEUE_MONITOR_THRESHOLD=200
  492. # You can configure multiple ones, separated by commas. eg: test1@dify.ai,test2@dify.ai
  493. QUEUE_MONITOR_ALERT_EMAILS=
  494. # Monitor interval in minutes, default is 30 minutes
  495. QUEUE_MONITOR_INTERVAL=30
  496. # Swagger UI configuration
  497. SWAGGER_UI_ENABLED=true
  498. SWAGGER_UI_PATH=/swagger-ui.html
  499. # Whether to encrypt dataset IDs when exporting DSL files (default: true)
  500. # Set to false to export dataset IDs as plain text for easier cross-environment import
  501. DSL_EXPORT_ENCRYPT_DATASET_ID=true