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

.env.example 17KB

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