.env.example 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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. # Console API base URL
  7. CONSOLE_API_URL=http://127.0.0.1:5001
  8. CONSOLE_WEB_URL=http://127.0.0.1:3000
  9. # Service API base URL
  10. SERVICE_API_URL=http://127.0.0.1:5001
  11. # Web APP base URL
  12. APP_WEB_URL=http://127.0.0.1:3000
  13. # Files URL
  14. FILES_URL=http://127.0.0.1:5001
  15. # The time in seconds after the signature is rejected
  16. FILES_ACCESS_TIMEOUT=300
  17. # Access token expiration time in minutes
  18. ACCESS_TOKEN_EXPIRE_MINUTES=60
  19. # Refresh token expiration time in days
  20. REFRESH_TOKEN_EXPIRE_DAYS=30
  21. # celery configuration
  22. CELERY_BROKER_URL=redis://:difyai123456@localhost:6379/1
  23. # redis configuration
  24. REDIS_HOST=localhost
  25. REDIS_PORT=6379
  26. REDIS_USERNAME=
  27. REDIS_PASSWORD=difyai123456
  28. REDIS_USE_SSL=false
  29. REDIS_DB=0
  30. # redis Sentinel configuration.
  31. REDIS_USE_SENTINEL=false
  32. REDIS_SENTINELS=
  33. REDIS_SENTINEL_SERVICE_NAME=
  34. REDIS_SENTINEL_USERNAME=
  35. REDIS_SENTINEL_PASSWORD=
  36. REDIS_SENTINEL_SOCKET_TIMEOUT=0.1
  37. # redis Cluster configuration.
  38. REDIS_USE_CLUSTERS=false
  39. REDIS_CLUSTERS=
  40. REDIS_CLUSTERS_PASSWORD=
  41. # PostgreSQL database configuration
  42. DB_USERNAME=postgres
  43. DB_PASSWORD=difyai123456
  44. DB_HOST=localhost
  45. DB_PORT=5432
  46. DB_DATABASE=dify
  47. # Storage configuration
  48. # use for store upload files, private keys...
  49. # storage type: opendal, s3, aliyun-oss, azure-blob, baidu-obs, google-storage, huawei-obs, oci-storage, tencent-cos, volcengine-tos, supabase
  50. STORAGE_TYPE=opendal
  51. # Apache OpenDAL storage configuration, refer to https://github.com/apache/opendal
  52. OPENDAL_SCHEME=fs
  53. OPENDAL_FS_ROOT=storage
  54. # S3 Storage configuration
  55. S3_USE_AWS_MANAGED_IAM=false
  56. S3_ENDPOINT=https://your-bucket-name.storage.s3.cloudflare.com
  57. S3_BUCKET_NAME=your-bucket-name
  58. S3_ACCESS_KEY=your-access-key
  59. S3_SECRET_KEY=your-secret-key
  60. S3_REGION=your-region
  61. # Azure Blob Storage configuration
  62. AZURE_BLOB_ACCOUNT_NAME=your-account-name
  63. AZURE_BLOB_ACCOUNT_KEY=your-account-key
  64. AZURE_BLOB_CONTAINER_NAME=your-container-name
  65. AZURE_BLOB_ACCOUNT_URL=https://<your_account_name>.blob.core.windows.net
  66. # Aliyun oss Storage configuration
  67. ALIYUN_OSS_BUCKET_NAME=your-bucket-name
  68. ALIYUN_OSS_ACCESS_KEY=your-access-key
  69. ALIYUN_OSS_SECRET_KEY=your-secret-key
  70. ALIYUN_OSS_ENDPOINT=your-endpoint
  71. ALIYUN_OSS_AUTH_VERSION=v1
  72. ALIYUN_OSS_REGION=your-region
  73. # Don't start with '/'. OSS doesn't support leading slash in object names.
  74. ALIYUN_OSS_PATH=your-path
  75. # Google Storage configuration
  76. GOOGLE_STORAGE_BUCKET_NAME=your-bucket-name
  77. GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64=your-google-service-account-json-base64-string
  78. # Tencent COS Storage configuration
  79. TENCENT_COS_BUCKET_NAME=your-bucket-name
  80. TENCENT_COS_SECRET_KEY=your-secret-key
  81. TENCENT_COS_SECRET_ID=your-secret-id
  82. TENCENT_COS_REGION=your-region
  83. TENCENT_COS_SCHEME=your-scheme
  84. # Huawei OBS Storage Configuration
  85. HUAWEI_OBS_BUCKET_NAME=your-bucket-name
  86. HUAWEI_OBS_SECRET_KEY=your-secret-key
  87. HUAWEI_OBS_ACCESS_KEY=your-access-key
  88. HUAWEI_OBS_SERVER=your-server-url
  89. # Baidu OBS Storage Configuration
  90. BAIDU_OBS_BUCKET_NAME=your-bucket-name
  91. BAIDU_OBS_SECRET_KEY=your-secret-key
  92. BAIDU_OBS_ACCESS_KEY=your-access-key
  93. BAIDU_OBS_ENDPOINT=your-server-url
  94. # OCI Storage configuration
  95. OCI_ENDPOINT=your-endpoint
  96. OCI_BUCKET_NAME=your-bucket-name
  97. OCI_ACCESS_KEY=your-access-key
  98. OCI_SECRET_KEY=your-secret-key
  99. OCI_REGION=your-region
  100. # Volcengine tos Storage configuration
  101. VOLCENGINE_TOS_ENDPOINT=your-endpoint
  102. VOLCENGINE_TOS_BUCKET_NAME=your-bucket-name
  103. VOLCENGINE_TOS_ACCESS_KEY=your-access-key
  104. VOLCENGINE_TOS_SECRET_KEY=your-secret-key
  105. VOLCENGINE_TOS_REGION=your-region
  106. # Supabase Storage Configuration
  107. SUPABASE_BUCKET_NAME=your-bucket-name
  108. SUPABASE_API_KEY=your-access-key
  109. SUPABASE_URL=your-server-url
  110. # CORS configuration
  111. WEB_API_CORS_ALLOW_ORIGINS=http://127.0.0.1:3000,*
  112. CONSOLE_CORS_ALLOW_ORIGINS=http://127.0.0.1:3000,*
  113. # Vector database configuration
  114. # support: weaviate, qdrant, milvus, myscale, relyt, pgvecto_rs, pgvector, pgvector, chroma, opensearch, tidb_vector, couchbase, vikingdb, upstash, lindorm, oceanbase
  115. VECTOR_STORE=weaviate
  116. # Weaviate configuration
  117. WEAVIATE_ENDPOINT=http://localhost:8080
  118. WEAVIATE_API_KEY=WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  119. WEAVIATE_GRPC_ENABLED=false
  120. WEAVIATE_BATCH_SIZE=100
  121. # Qdrant configuration, use `http://localhost:6333` for local mode or `https://your-qdrant-cluster-url.qdrant.io` for remote mode
  122. QDRANT_URL=http://localhost:6333
  123. QDRANT_API_KEY=difyai123456
  124. QDRANT_CLIENT_TIMEOUT=20
  125. QDRANT_GRPC_ENABLED=false
  126. QDRANT_GRPC_PORT=6334
  127. #Couchbase configuration
  128. COUCHBASE_CONNECTION_STRING=127.0.0.1
  129. COUCHBASE_USER=Administrator
  130. COUCHBASE_PASSWORD=password
  131. COUCHBASE_BUCKET_NAME=Embeddings
  132. COUCHBASE_SCOPE_NAME=_default
  133. # Milvus configuration
  134. MILVUS_URI=http://127.0.0.1:19530
  135. MILVUS_TOKEN=
  136. MILVUS_USER=root
  137. MILVUS_PASSWORD=Milvus
  138. # MyScale configuration
  139. MYSCALE_HOST=127.0.0.1
  140. MYSCALE_PORT=8123
  141. MYSCALE_USER=default
  142. MYSCALE_PASSWORD=
  143. MYSCALE_DATABASE=default
  144. MYSCALE_FTS_PARAMS=
  145. # Relyt configuration
  146. RELYT_HOST=127.0.0.1
  147. RELYT_PORT=5432
  148. RELYT_USER=postgres
  149. RELYT_PASSWORD=postgres
  150. RELYT_DATABASE=postgres
  151. # Tencent configuration
  152. TENCENT_VECTOR_DB_URL=http://127.0.0.1
  153. TENCENT_VECTOR_DB_API_KEY=dify
  154. TENCENT_VECTOR_DB_TIMEOUT=30
  155. TENCENT_VECTOR_DB_USERNAME=dify
  156. TENCENT_VECTOR_DB_DATABASE=dify
  157. TENCENT_VECTOR_DB_SHARD=1
  158. TENCENT_VECTOR_DB_REPLICAS=2
  159. # ElasticSearch configuration
  160. ELASTICSEARCH_HOST=127.0.0.1
  161. ELASTICSEARCH_PORT=9200
  162. ELASTICSEARCH_USERNAME=elastic
  163. ELASTICSEARCH_PASSWORD=elastic
  164. # PGVECTO_RS configuration
  165. PGVECTO_RS_HOST=localhost
  166. PGVECTO_RS_PORT=5431
  167. PGVECTO_RS_USER=postgres
  168. PGVECTO_RS_PASSWORD=difyai123456
  169. PGVECTO_RS_DATABASE=postgres
  170. # PGVector configuration
  171. PGVECTOR_HOST=127.0.0.1
  172. PGVECTOR_PORT=5433
  173. PGVECTOR_USER=postgres
  174. PGVECTOR_PASSWORD=postgres
  175. PGVECTOR_DATABASE=postgres
  176. PGVECTOR_MIN_CONNECTION=1
  177. PGVECTOR_MAX_CONNECTION=5
  178. # Tidb Vector configuration
  179. TIDB_VECTOR_HOST=xxx.eu-central-1.xxx.aws.tidbcloud.com
  180. TIDB_VECTOR_PORT=4000
  181. TIDB_VECTOR_USER=xxx.root
  182. TIDB_VECTOR_PASSWORD=xxxxxx
  183. TIDB_VECTOR_DATABASE=dify
  184. # Tidb on qdrant configuration
  185. TIDB_ON_QDRANT_URL=http://127.0.0.1
  186. TIDB_ON_QDRANT_API_KEY=dify
  187. TIDB_ON_QDRANT_CLIENT_TIMEOUT=20
  188. TIDB_ON_QDRANT_GRPC_ENABLED=false
  189. TIDB_ON_QDRANT_GRPC_PORT=6334
  190. TIDB_PUBLIC_KEY=dify
  191. TIDB_PRIVATE_KEY=dify
  192. TIDB_API_URL=http://127.0.0.1
  193. TIDB_IAM_API_URL=http://127.0.0.1
  194. TIDB_REGION=regions/aws-us-east-1
  195. TIDB_PROJECT_ID=dify
  196. TIDB_SPEND_LIMIT=100
  197. # Chroma configuration
  198. CHROMA_HOST=127.0.0.1
  199. CHROMA_PORT=8000
  200. CHROMA_TENANT=default_tenant
  201. CHROMA_DATABASE=default_database
  202. CHROMA_AUTH_PROVIDER=chromadb.auth.token_authn.TokenAuthenticationServerProvider
  203. CHROMA_AUTH_CREDENTIALS=difyai123456
  204. # AnalyticDB configuration
  205. ANALYTICDB_KEY_ID=your-ak
  206. ANALYTICDB_KEY_SECRET=your-sk
  207. ANALYTICDB_REGION_ID=cn-hangzhou
  208. ANALYTICDB_INSTANCE_ID=gp-ab123456
  209. ANALYTICDB_ACCOUNT=testaccount
  210. ANALYTICDB_PASSWORD=testpassword
  211. ANALYTICDB_NAMESPACE=dify
  212. ANALYTICDB_NAMESPACE_PASSWORD=difypassword
  213. ANALYTICDB_HOST=gp-test.aliyuncs.com
  214. ANALYTICDB_PORT=5432
  215. ANALYTICDB_MIN_CONNECTION=1
  216. ANALYTICDB_MAX_CONNECTION=5
  217. # OpenSearch configuration
  218. OPENSEARCH_HOST=127.0.0.1
  219. OPENSEARCH_PORT=9200
  220. OPENSEARCH_USER=admin
  221. OPENSEARCH_PASSWORD=admin
  222. OPENSEARCH_SECURE=true
  223. # Baidu configuration
  224. BAIDU_VECTOR_DB_ENDPOINT=http://127.0.0.1:5287
  225. BAIDU_VECTOR_DB_CONNECTION_TIMEOUT_MS=30000
  226. BAIDU_VECTOR_DB_ACCOUNT=root
  227. BAIDU_VECTOR_DB_API_KEY=dify
  228. BAIDU_VECTOR_DB_DATABASE=dify
  229. BAIDU_VECTOR_DB_SHARD=1
  230. BAIDU_VECTOR_DB_REPLICAS=3
  231. # Upstash configuration
  232. UPSTASH_VECTOR_URL=your-server-url
  233. UPSTASH_VECTOR_TOKEN=your-access-token
  234. # ViKingDB configuration
  235. VIKINGDB_ACCESS_KEY=your-ak
  236. VIKINGDB_SECRET_KEY=your-sk
  237. VIKINGDB_REGION=cn-shanghai
  238. VIKINGDB_HOST=api-vikingdb.xxx.volces.com
  239. VIKINGDB_SCHEMA=http
  240. VIKINGDB_CONNECTION_TIMEOUT=30
  241. VIKINGDB_SOCKET_TIMEOUT=30
  242. # Lindorm configuration
  243. LINDORM_URL=http://ld-*******************-proxy-search-pub.lindorm.aliyuncs.com:30070
  244. LINDORM_USERNAME=admin
  245. LINDORM_PASSWORD=admin
  246. USING_UGC_INDEX=False
  247. # OceanBase Vector configuration
  248. OCEANBASE_VECTOR_HOST=127.0.0.1
  249. OCEANBASE_VECTOR_PORT=2881
  250. OCEANBASE_VECTOR_USER=root@test
  251. OCEANBASE_VECTOR_PASSWORD=difyai123456
  252. OCEANBASE_VECTOR_DATABASE=test
  253. OCEANBASE_MEMORY_LIMIT=6G
  254. # Upload configuration
  255. UPLOAD_FILE_SIZE_LIMIT=15
  256. UPLOAD_FILE_BATCH_LIMIT=5
  257. UPLOAD_IMAGE_FILE_SIZE_LIMIT=10
  258. UPLOAD_VIDEO_FILE_SIZE_LIMIT=100
  259. UPLOAD_AUDIO_FILE_SIZE_LIMIT=50
  260. # Model configuration
  261. MULTIMODAL_SEND_FORMAT=base64
  262. PROMPT_GENERATION_MAX_TOKENS=512
  263. CODE_GENERATION_MAX_TOKENS=1024
  264. # Mail configuration, support: resend, smtp
  265. MAIL_TYPE=
  266. MAIL_DEFAULT_SEND_FROM=no-reply <no-reply@dify.ai>
  267. RESEND_API_KEY=
  268. RESEND_API_URL=https://api.resend.com
  269. # smtp configuration
  270. SMTP_SERVER=smtp.gmail.com
  271. SMTP_PORT=465
  272. SMTP_USERNAME=123
  273. SMTP_PASSWORD=abc
  274. SMTP_USE_TLS=true
  275. SMTP_OPPORTUNISTIC_TLS=false
  276. # Sentry configuration
  277. SENTRY_DSN=
  278. # DEBUG
  279. DEBUG=false
  280. SQLALCHEMY_ECHO=false
  281. # Notion import configuration, support public and internal
  282. NOTION_INTEGRATION_TYPE=public
  283. NOTION_CLIENT_SECRET=you-client-secret
  284. NOTION_CLIENT_ID=you-client-id
  285. NOTION_INTERNAL_SECRET=you-internal-secret
  286. ETL_TYPE=dify
  287. UNSTRUCTURED_API_URL=
  288. UNSTRUCTURED_API_KEY=
  289. SCARF_NO_ANALYTICS=true
  290. #ssrf
  291. SSRF_PROXY_HTTP_URL=
  292. SSRF_PROXY_HTTPS_URL=
  293. SSRF_DEFAULT_MAX_RETRIES=3
  294. SSRF_DEFAULT_TIME_OUT=5
  295. SSRF_DEFAULT_CONNECT_TIME_OUT=5
  296. SSRF_DEFAULT_READ_TIME_OUT=5
  297. SSRF_DEFAULT_WRITE_TIME_OUT=5
  298. BATCH_UPLOAD_LIMIT=10
  299. KEYWORD_DATA_SOURCE_TYPE=database
  300. # Workflow file upload limit
  301. WORKFLOW_FILE_UPLOAD_LIMIT=10
  302. # CODE EXECUTION CONFIGURATION
  303. CODE_EXECUTION_ENDPOINT=http://127.0.0.1:8194
  304. CODE_EXECUTION_API_KEY=dify-sandbox
  305. CODE_MAX_NUMBER=9223372036854775807
  306. CODE_MIN_NUMBER=-9223372036854775808
  307. CODE_MAX_STRING_LENGTH=80000
  308. TEMPLATE_TRANSFORM_MAX_LENGTH=80000
  309. CODE_MAX_STRING_ARRAY_LENGTH=30
  310. CODE_MAX_OBJECT_ARRAY_LENGTH=30
  311. CODE_MAX_NUMBER_ARRAY_LENGTH=1000
  312. # API Tool configuration
  313. API_TOOL_DEFAULT_CONNECT_TIMEOUT=10
  314. API_TOOL_DEFAULT_READ_TIMEOUT=60
  315. # HTTP Node configuration
  316. HTTP_REQUEST_MAX_CONNECT_TIMEOUT=300
  317. HTTP_REQUEST_MAX_READ_TIMEOUT=600
  318. HTTP_REQUEST_MAX_WRITE_TIMEOUT=600
  319. HTTP_REQUEST_NODE_MAX_BINARY_SIZE=10485760
  320. HTTP_REQUEST_NODE_MAX_TEXT_SIZE=1048576
  321. # Respect X-* headers to redirect clients
  322. RESPECT_XFORWARD_HEADERS_ENABLED=false
  323. # Log file path
  324. LOG_FILE=
  325. # Log file max size, the unit is MB
  326. LOG_FILE_MAX_SIZE=20
  327. # Log file max backup count
  328. LOG_FILE_BACKUP_COUNT=5
  329. # Log dateformat
  330. LOG_DATEFORMAT=%Y-%m-%d %H:%M:%S
  331. # Log Timezone
  332. LOG_TZ=UTC
  333. # Log format
  334. LOG_FORMAT=%(asctime)s,%(msecs)d %(levelname)-2s [%(filename)s:%(lineno)d] %(req_id)s %(message)s
  335. # Indexing configuration
  336. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=4000
  337. # Workflow runtime configuration
  338. WORKFLOW_MAX_EXECUTION_STEPS=500
  339. WORKFLOW_MAX_EXECUTION_TIME=1200
  340. WORKFLOW_CALL_MAX_DEPTH=5
  341. WORKFLOW_PARALLEL_DEPTH_LIMIT=3
  342. MAX_VARIABLE_SIZE=204800
  343. # App configuration
  344. APP_MAX_EXECUTION_TIME=1200
  345. APP_MAX_ACTIVE_REQUESTS=0
  346. # Celery beat configuration
  347. CELERY_BEAT_SCHEDULER_TIME=1
  348. # Position configuration
  349. POSITION_TOOL_PINS=
  350. POSITION_TOOL_INCLUDES=
  351. POSITION_TOOL_EXCLUDES=
  352. POSITION_PROVIDER_PINS=
  353. POSITION_PROVIDER_INCLUDES=
  354. POSITION_PROVIDER_EXCLUDES=
  355. # Plugin configuration
  356. PLUGIN_DAEMON_KEY=lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi
  357. PLUGIN_DAEMON_URL=http://127.0.0.1:5002
  358. PLUGIN_REMOTE_INSTALL_PORT=5003
  359. PLUGIN_REMOTE_INSTALL_HOST=localhost
  360. PLUGIN_MAX_PACKAGE_SIZE=15728640
  361. INNER_API_KEY_FOR_PLUGIN=QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1
  362. # Marketplace configuration
  363. MARKETPLACE_ENABLED=true
  364. MARKETPLACE_API_URL=https://marketplace.dify.ai
  365. # Endpoint configuration
  366. ENDPOINT_URL_TEMPLATE=http://localhost:5002/e/{hook_id}
  367. # Reset password token expiry minutes
  368. RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5
  369. CREATE_TIDB_SERVICE_JOB_ENABLED=false
  370. # Maximum number of submitted thread count in a ThreadPool for parallel node execution
  371. MAX_SUBMIT_COUNT=100
  372. # Lockout duration in seconds
  373. LOGIN_LOCKOUT_DURATION=86400