.env 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312
  1. # ------------------------------
  2. # Environment Variables for API service & worker
  3. # ------------------------------
  4. # ------------------------------
  5. # Common Variables
  6. # ------------------------------
  7. # zlwu 填充
  8. # The backend URL of the console API,
  9. # used to concatenate the authorization callback.
  10. # If empty, it is the same domain.
  11. # Example: https://api.console.dify.ai
  12. CONSOLE_API_URL=http://172.20.10.3
  13. # The front-end URL of the console web,
  14. # used to concatenate some front-end addresses and for CORS configuration use.
  15. # If empty, it is the same domain.
  16. # Example: https://console.dify.ai
  17. CONSOLE_WEB_URL=http://172.20.10.3
  18. # Service API Url,
  19. # used to display Service API Base Url to the front-end.
  20. # If empty, it is the same domain.
  21. # Example: https://api.dify.ai
  22. SERVICE_API_URL=http://172.20.10.3
  23. # WebApp API backend Url,
  24. # used to declare the back-end URL for the front-end API.
  25. # If empty, it is the same domain.
  26. # Example: https://api.app.dify.ai
  27. APP_API_URL=http://172.20.10.3
  28. # WebApp Url,
  29. # used to display WebAPP API Base Url to the front-end.
  30. # If empty, it is the same domain.
  31. # Example: https://app.dify.ai
  32. APP_WEB_URL=http://172.20.10.3
  33. # File preview or download Url prefix.
  34. # used to display File preview or download Url to the front-end or as Multi-model inputs;
  35. # Url is signed and has expiration time.
  36. # Setting FILES_URL is required for file processing plugins.
  37. # - For https://example.com, use FILES_URL=https://example.com
  38. # - For http://example.com, use FILES_URL=http://example.com
  39. # Recommendation: use a dedicated domain (e.g., https://upload.example.com).
  40. # Alternatively, use http://<your-ip>:5001 or http://api:5001,
  41. # ensuring port 5001 is externally accessible (see docker-compose.yaml).
  42. FILES_URL=http://172.20.10.3
  43. # INTERNAL_FILES_URL is used for plugin daemon communication within Docker network.
  44. # Set this to the internal Docker service URL for proper plugin file access.
  45. # Example: INTERNAL_FILES_URL=http://api:5001
  46. INTERNAL_FILES_URL=http://172.20.10.3
  47. # Ensure UTF-8 encoding
  48. LANG=en_US.UTF-8
  49. LC_ALL=en_US.UTF-8
  50. PYTHONIOENCODING=utf-8
  51. # ------------------------------
  52. # Server Configuration
  53. # ------------------------------
  54. # The log level for the application.
  55. # Supported values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`
  56. LOG_LEVEL=INFO
  57. # Log file path
  58. LOG_FILE=/app/logs/server.log
  59. # Log file max size, the unit is MB
  60. LOG_FILE_MAX_SIZE=20
  61. # Log file max backup count
  62. LOG_FILE_BACKUP_COUNT=5
  63. # Log dateformat
  64. LOG_DATEFORMAT=%Y-%m-%d %H:%M:%S
  65. # Log Timezone
  66. LOG_TZ=UTC
  67. # Debug mode, default is false.
  68. # It is recommended to turn on this configuration for local development
  69. # to prevent some problems caused by monkey patch.
  70. DEBUG=false
  71. # Flask debug mode, it can output trace information at the interface when turned on,
  72. # which is convenient for debugging.
  73. FLASK_DEBUG=false
  74. # Enable request logging, which will log the request and response information.
  75. # And the log level is DEBUG
  76. ENABLE_REQUEST_LOGGING=False
  77. # A secret key that is used for securely signing the session cookie
  78. # and encrypting sensitive information on the database.
  79. # You can generate a strong key using `openssl rand -base64 42`.
  80. SECRET_KEY=sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
  81. # Password for admin user initialization.
  82. # If left unset, admin user will not be prompted for a password
  83. # when creating the initial admin account.
  84. # The length of the password cannot exceed 30 characters.
  85. INIT_PASSWORD=
  86. # Deployment environment.
  87. # Supported values are `PRODUCTION`, `TESTING`. Default is `PRODUCTION`.
  88. # Testing environment. There will be a distinct color label on the front-end page,
  89. # indicating that this environment is a testing environment.
  90. DEPLOY_ENV=PRODUCTION
  91. # Whether to enable the version check policy.
  92. # If set to empty, https://updates.dify.ai will be called for version check.
  93. CHECK_UPDATE_URL=https://updates.dify.ai
  94. # Used to change the OpenAI base address, default is https://api.openai.com/v1.
  95. # When OpenAI cannot be accessed in China, replace it with a domestic mirror address,
  96. # or when a local model provides OpenAI compatible API, it can be replaced.
  97. OPENAI_API_BASE=https://api.openai.com/v1
  98. # When enabled, migrations will be executed prior to application startup
  99. # and the application will start after the migrations have completed.
  100. MIGRATION_ENABLED=true
  101. # File Access Time specifies a time interval in seconds for the file to be accessed.
  102. # The default value is 300 seconds.
  103. FILES_ACCESS_TIMEOUT=300
  104. # Access token expiration time in minutes
  105. ACCESS_TOKEN_EXPIRE_MINUTES=60
  106. # Refresh token expiration time in days
  107. REFRESH_TOKEN_EXPIRE_DAYS=30
  108. # The maximum number of active requests for the application, where 0 means unlimited, should be a non-negative integer.
  109. APP_MAX_ACTIVE_REQUESTS=0
  110. APP_MAX_EXECUTION_TIME=1200
  111. # ------------------------------
  112. # Container Startup Related Configuration
  113. # Only effective when starting with docker image or docker-compose.
  114. # ------------------------------
  115. # API service binding address, default: 0.0.0.0, i.e., all addresses can be accessed.
  116. DIFY_BIND_ADDRESS=0.0.0.0
  117. # API service binding port number, default 5001.
  118. DIFY_PORT=5001
  119. # The number of API server workers, i.e., the number of workers.
  120. # Formula: number of cpu cores x 2 + 1 for sync, 1 for Gevent
  121. # Reference: https://docs.gunicorn.org/en/stable/design.html#how-many-workers
  122. SERVER_WORKER_AMOUNT=1
  123. # Defaults to gevent. If using windows, it can be switched to sync or solo.
  124. SERVER_WORKER_CLASS=gevent
  125. # Default number of worker connections, the default is 10.
  126. SERVER_WORKER_CONNECTIONS=10
  127. # Similar to SERVER_WORKER_CLASS.
  128. # If using windows, it can be switched to sync or solo.
  129. CELERY_WORKER_CLASS=
  130. # Request handling timeout. The default is 200,
  131. # it is recommended to set it to 360 to support a longer sse connection time.
  132. GUNICORN_TIMEOUT=360
  133. # The number of Celery workers. The default is 1, and can be set as needed.
  134. CELERY_WORKER_AMOUNT=
  135. # Flag indicating whether to enable autoscaling of Celery workers.
  136. #
  137. # Autoscaling is useful when tasks are CPU intensive and can be dynamically
  138. # allocated and deallocated based on the workload.
  139. #
  140. # When autoscaling is enabled, the maximum and minimum number of workers can
  141. # be specified. The autoscaling algorithm will dynamically adjust the number
  142. # of workers within the specified range.
  143. #
  144. # Default is false (i.e., autoscaling is disabled).
  145. #
  146. # Example:
  147. # CELERY_AUTO_SCALE=true
  148. CELERY_AUTO_SCALE=false
  149. # The maximum number of Celery workers that can be autoscaled.
  150. # This is optional and only used when autoscaling is enabled.
  151. # Default is not set.
  152. CELERY_MAX_WORKERS=
  153. # The minimum number of Celery workers that can be autoscaled.
  154. # This is optional and only used when autoscaling is enabled.
  155. # Default is not set.
  156. CELERY_MIN_WORKERS=
  157. # API Tool configuration
  158. API_TOOL_DEFAULT_CONNECT_TIMEOUT=10
  159. API_TOOL_DEFAULT_READ_TIMEOUT=60
  160. # -------------------------------
  161. # Datasource Configuration
  162. # --------------------------------
  163. ENABLE_WEBSITE_JINAREADER=true
  164. ENABLE_WEBSITE_FIRECRAWL=true
  165. ENABLE_WEBSITE_WATERCRAWL=true
  166. # ------------------------------
  167. # Frontend Configuration
  168. # ------------------------------
  169. # zlwu 填充
  170. # KKFileView service URL for document preview
  171. # Example: http://localhost:8012
  172. KKFILEVIEW_URL=http://172.20.10.2:8012
  173. # API base URL for frontend to access backend
  174. # Example: http://localhost:5001
  175. API_BASE_URL=http://172.20.10.3
  176. # ------------------------------
  177. # Database Configuration
  178. # The database uses PostgreSQL. Please use the public schema.
  179. # It is consistent with the configuration in the 'db' service below.
  180. # ------------------------------
  181. DB_USERNAME=postgres
  182. DB_PASSWORD=difyai123456
  183. DB_HOST=db
  184. DB_PORT=5432
  185. DB_DATABASE=dify
  186. # The size of the database connection pool.
  187. # The default is 30 connections, which can be appropriately increased.
  188. SQLALCHEMY_POOL_SIZE=30
  189. # The default is 10 connections, which allows temporary overflow beyond the pool size.
  190. SQLALCHEMY_MAX_OVERFLOW=10
  191. # Database connection pool recycling time, the default is 3600 seconds.
  192. SQLALCHEMY_POOL_RECYCLE=3600
  193. # Whether to print SQL, default is false.
  194. SQLALCHEMY_ECHO=false
  195. # If True, will test connections for liveness upon each checkout
  196. SQLALCHEMY_POOL_PRE_PING=false
  197. # Whether to enable the Last in first out option or use default FIFO queue if is false
  198. SQLALCHEMY_POOL_USE_LIFO=false
  199. # Maximum number of connections to the database
  200. # Default is 100
  201. #
  202. # Reference: https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS
  203. POSTGRES_MAX_CONNECTIONS=100
  204. # Sets the amount of shared memory used for postgres's shared buffers.
  205. # Default is 128MB
  206. # Recommended value: 25% of available memory
  207. # Reference: https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-SHARED-BUFFERS
  208. POSTGRES_SHARED_BUFFERS=128MB
  209. # Sets the amount of memory used by each database worker for working space.
  210. # Default is 4MB
  211. #
  212. # Reference: https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-WORK-MEM
  213. POSTGRES_WORK_MEM=4MB
  214. # Sets the amount of memory reserved for maintenance activities.
  215. # Default is 64MB
  216. #
  217. # Reference: https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-MAINTENANCE-WORK-MEM
  218. POSTGRES_MAINTENANCE_WORK_MEM=64MB
  219. # Sets the planner's assumption about the effective cache size.
  220. # Default is 4096MB
  221. #
  222. # Reference: https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE
  223. POSTGRES_EFFECTIVE_CACHE_SIZE=4096MB
  224. # ------------------------------
  225. # Redis Configuration
  226. # This Redis configuration is used for caching and for pub/sub during conversation.
  227. # ------------------------------
  228. REDIS_HOST=redis
  229. REDIS_PORT=6379
  230. REDIS_USERNAME=
  231. REDIS_PASSWORD=difyai123456
  232. REDIS_USE_SSL=false
  233. # SSL configuration for Redis (when REDIS_USE_SSL=true)
  234. REDIS_SSL_CERT_REQS=CERT_NONE
  235. # Options: CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
  236. REDIS_SSL_CA_CERTS=
  237. # Path to CA certificate file for SSL verification
  238. REDIS_SSL_CERTFILE=
  239. # Path to client certificate file for SSL authentication
  240. REDIS_SSL_KEYFILE=
  241. # Path to client private key file for SSL authentication
  242. REDIS_DB=0
  243. # Whether to use Redis Sentinel mode.
  244. # If set to true, the application will automatically discover and connect to the master node through Sentinel.
  245. REDIS_USE_SENTINEL=false
  246. # List of Redis Sentinel nodes. If Sentinel mode is enabled, provide at least one Sentinel IP and port.
  247. # Format: `<sentinel1_ip>:<sentinel1_port>,<sentinel2_ip>:<sentinel2_port>,<sentinel3_ip>:<sentinel3_port>`
  248. REDIS_SENTINELS=
  249. REDIS_SENTINEL_SERVICE_NAME=
  250. REDIS_SENTINEL_USERNAME=
  251. REDIS_SENTINEL_PASSWORD=
  252. REDIS_SENTINEL_SOCKET_TIMEOUT=0.1
  253. # List of Redis Cluster nodes. If Cluster mode is enabled, provide at least one Cluster IP and port.
  254. # Format: `<Cluster1_ip>:<Cluster1_port>,<Cluster2_ip>:<Cluster2_port>,<Cluster3_ip>:<Cluster3_port>`
  255. REDIS_USE_CLUSTERS=false
  256. REDIS_CLUSTERS=
  257. REDIS_CLUSTERS_PASSWORD=
  258. # ------------------------------
  259. # Celery Configuration
  260. # ------------------------------
  261. # Use standalone redis as the broker, and redis db 1 for celery broker. (redis_username is usually set by defualt as empty)
  262. # Format as follows: `redis://<redis_username>:<redis_password>@<redis_host>:<redis_port>/<redis_database>`.
  263. # Example: redis://:difyai123456@redis:6379/1
  264. # If use Redis Sentinel, format as follows: `sentinel://<redis_username>:<redis_password>@<sentinel_host1>:<sentinel_port>/<redis_database>`
  265. # For high availability, you can configure multiple Sentinel nodes (if provided) separated by semicolons like below example:
  266. # Example: sentinel://:difyai123456@localhost:26379/1;sentinel://:difyai12345@localhost:26379/1;sentinel://:difyai12345@localhost:26379/1
  267. CELERY_BROKER_URL=redis://:difyai123456@redis:6379/1
  268. CELERY_BACKEND=redis
  269. BROKER_USE_SSL=false
  270. # If you are using Redis Sentinel for high availability, configure the following settings.
  271. CELERY_USE_SENTINEL=false
  272. CELERY_SENTINEL_MASTER_NAME=
  273. CELERY_SENTINEL_PASSWORD=
  274. CELERY_SENTINEL_SOCKET_TIMEOUT=0.1
  275. # ------------------------------
  276. # CORS Configuration
  277. # Used to set the front-end cross-domain access policy.
  278. # ------------------------------
  279. # Specifies the allowed origins for cross-origin requests to the Web API,
  280. # e.g. https://dify.app or * for all origins.
  281. WEB_API_CORS_ALLOW_ORIGINS=*
  282. # Specifies the allowed origins for cross-origin requests to the console API,
  283. # e.g. https://cloud.dify.ai or * for all origins.
  284. CONSOLE_CORS_ALLOW_ORIGINS=*
  285. # ------------------------------
  286. # File Storage Configuration
  287. # ------------------------------
  288. # The type of storage to use for storing user files.
  289. STORAGE_TYPE=opendal
  290. # Apache OpenDAL Configuration
  291. # The configuration for OpenDAL consists of the following format: OPENDAL_<SCHEME_NAME>_<CONFIG_NAME>.
  292. # You can find all the service configurations (CONFIG_NAME) in the repository at: https://github.com/apache/opendal/tree/main/core/src/services.
  293. # Dify will scan configurations starting with OPENDAL_<SCHEME_NAME> and automatically apply them.
  294. # The scheme name for the OpenDAL storage.
  295. OPENDAL_SCHEME=fs
  296. # Configurations for OpenDAL Local File System.
  297. OPENDAL_FS_ROOT=storage
  298. # ClickZetta Volume Configuration (for storage backend)
  299. # To use ClickZetta Volume as storage backend, set STORAGE_TYPE=clickzetta-volume
  300. # Note: ClickZetta Volume will reuse the existing CLICKZETTA_* connection parameters
  301. # Volume type selection (three types available):
  302. # - user: Personal/small team use, simple config, user-level permissions
  303. # - table: Enterprise multi-tenant, smart routing, table-level + user-level permissions
  304. # - external: Data lake integration, external storage connection, volume-level + storage-level permissions
  305. CLICKZETTA_VOLUME_TYPE=user
  306. # External Volume name (required only when TYPE=external)
  307. CLICKZETTA_VOLUME_NAME=
  308. # Table Volume table prefix (used only when TYPE=table)
  309. CLICKZETTA_VOLUME_TABLE_PREFIX=dataset_
  310. # Dify file directory prefix (isolates from other apps, recommended to keep default)
  311. CLICKZETTA_VOLUME_DIFY_PREFIX=dify_km
  312. # S3 Configuration
  313. #
  314. S3_ENDPOINT=
  315. S3_REGION=us-east-1
  316. S3_BUCKET_NAME=difyai
  317. S3_ACCESS_KEY=
  318. S3_SECRET_KEY=
  319. # Whether to use AWS managed IAM roles for authenticating with the S3 service.
  320. # If set to false, the access key and secret key must be provided.
  321. S3_USE_AWS_MANAGED_IAM=false
  322. # Azure Blob Configuration
  323. #
  324. AZURE_BLOB_ACCOUNT_NAME=difyai
  325. AZURE_BLOB_ACCOUNT_KEY=difyai
  326. AZURE_BLOB_CONTAINER_NAME=difyai-container
  327. AZURE_BLOB_ACCOUNT_URL=https://<your_account_name>.blob.core.windows.net
  328. # Google Storage Configuration
  329. #
  330. GOOGLE_STORAGE_BUCKET_NAME=your-bucket-name
  331. GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64=
  332. # The Alibaba Cloud OSS configurations,
  333. #
  334. ALIYUN_OSS_BUCKET_NAME=your-bucket-name
  335. ALIYUN_OSS_ACCESS_KEY=your-access-key
  336. ALIYUN_OSS_SECRET_KEY=your-secret-key
  337. ALIYUN_OSS_ENDPOINT=https://oss-ap-southeast-1-internal.aliyuncs.com
  338. ALIYUN_OSS_REGION=ap-southeast-1
  339. ALIYUN_OSS_AUTH_VERSION=v4
  340. # Don't start with '/'. OSS doesn't support leading slash in object names.
  341. ALIYUN_OSS_PATH=your-path
  342. # Tencent COS Configuration
  343. #
  344. TENCENT_COS_BUCKET_NAME=your-bucket-name
  345. TENCENT_COS_SECRET_KEY=your-secret-key
  346. TENCENT_COS_SECRET_ID=your-secret-id
  347. TENCENT_COS_REGION=your-region
  348. TENCENT_COS_SCHEME=your-scheme
  349. # Oracle Storage Configuration
  350. #
  351. OCI_ENDPOINT=https://your-object-storage-namespace.compat.objectstorage.us-ashburn-1.oraclecloud.com
  352. OCI_BUCKET_NAME=your-bucket-name
  353. OCI_ACCESS_KEY=your-access-key
  354. OCI_SECRET_KEY=your-secret-key
  355. OCI_REGION=us-ashburn-1
  356. # Huawei OBS Configuration
  357. #
  358. HUAWEI_OBS_BUCKET_NAME=your-bucket-name
  359. HUAWEI_OBS_SECRET_KEY=your-secret-key
  360. HUAWEI_OBS_ACCESS_KEY=your-access-key
  361. HUAWEI_OBS_SERVER=your-server-url
  362. # Volcengine TOS Configuration
  363. #
  364. VOLCENGINE_TOS_BUCKET_NAME=your-bucket-name
  365. VOLCENGINE_TOS_SECRET_KEY=your-secret-key
  366. VOLCENGINE_TOS_ACCESS_KEY=your-access-key
  367. VOLCENGINE_TOS_ENDPOINT=your-server-url
  368. VOLCENGINE_TOS_REGION=your-region
  369. # Baidu OBS Storage Configuration
  370. #
  371. BAIDU_OBS_BUCKET_NAME=your-bucket-name
  372. BAIDU_OBS_SECRET_KEY=your-secret-key
  373. BAIDU_OBS_ACCESS_KEY=your-access-key
  374. BAIDU_OBS_ENDPOINT=your-server-url
  375. # Supabase Storage Configuration
  376. #
  377. SUPABASE_BUCKET_NAME=your-bucket-name
  378. SUPABASE_API_KEY=your-access-key
  379. SUPABASE_URL=your-server-url
  380. # ------------------------------
  381. # Vector Database Configuration
  382. # ------------------------------
  383. # The type of vector store to use.
  384. # 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`, `clickzetta`.
  385. VECTOR_STORE=weaviate
  386. # Prefix used to create collection name in vector database
  387. VECTOR_INDEX_NAME_PREFIX=Vector_index
  388. # The Weaviate endpoint URL. Only available when VECTOR_STORE is `weaviate`.
  389. WEAVIATE_ENDPOINT=http://weaviate:8080
  390. WEAVIATE_API_KEY=WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  391. # The Qdrant endpoint URL. Only available when VECTOR_STORE is `qdrant`.
  392. QDRANT_URL=http://qdrant:6333
  393. QDRANT_API_KEY=difyai123456
  394. QDRANT_CLIENT_TIMEOUT=20
  395. QDRANT_GRPC_ENABLED=false
  396. QDRANT_GRPC_PORT=6334
  397. QDRANT_REPLICATION_FACTOR=1
  398. # Milvus configuration. Only available when VECTOR_STORE is `milvus`.
  399. # The milvus uri.
  400. MILVUS_URI=http://host.docker.internal:19530
  401. MILVUS_DATABASE=
  402. MILVUS_TOKEN=
  403. MILVUS_USER=
  404. MILVUS_PASSWORD=
  405. MILVUS_ENABLE_HYBRID_SEARCH=False
  406. MILVUS_ANALYZER_PARAMS=
  407. # MyScale configuration, only available when VECTOR_STORE is `myscale`
  408. # For multi-language support, please set MYSCALE_FTS_PARAMS with referring to:
  409. # https://myscale.com/docs/en/text-search/#understanding-fts-index-parameters
  410. MYSCALE_HOST=myscale
  411. MYSCALE_PORT=8123
  412. MYSCALE_USER=default
  413. MYSCALE_PASSWORD=
  414. MYSCALE_DATABASE=dify
  415. MYSCALE_FTS_PARAMS=
  416. # Couchbase configurations, only available when VECTOR_STORE is `couchbase`
  417. # The connection string must include hostname defined in the docker-compose file (couchbase-server in this case)
  418. COUCHBASE_CONNECTION_STRING=couchbase://couchbase-server
  419. COUCHBASE_USER=Administrator
  420. COUCHBASE_PASSWORD=password
  421. COUCHBASE_BUCKET_NAME=Embeddings
  422. COUCHBASE_SCOPE_NAME=_default
  423. # pgvector configurations, only available when VECTOR_STORE is `pgvector`
  424. PGVECTOR_HOST=pgvector
  425. PGVECTOR_PORT=5432
  426. PGVECTOR_USER=postgres
  427. PGVECTOR_PASSWORD=difyai123456
  428. PGVECTOR_DATABASE=dify
  429. PGVECTOR_MIN_CONNECTION=1
  430. PGVECTOR_MAX_CONNECTION=5
  431. PGVECTOR_PG_BIGM=false
  432. PGVECTOR_PG_BIGM_VERSION=1.2-20240606
  433. # vastbase configurations, only available when VECTOR_STORE is `vastbase`
  434. VASTBASE_HOST=vastbase
  435. VASTBASE_PORT=5432
  436. VASTBASE_USER=dify
  437. VASTBASE_PASSWORD=Difyai123456
  438. VASTBASE_DATABASE=dify
  439. VASTBASE_MIN_CONNECTION=1
  440. VASTBASE_MAX_CONNECTION=5
  441. # pgvecto-rs configurations, only available when VECTOR_STORE is `pgvecto-rs`
  442. PGVECTO_RS_HOST=pgvecto-rs
  443. PGVECTO_RS_PORT=5432
  444. PGVECTO_RS_USER=postgres
  445. PGVECTO_RS_PASSWORD=difyai123456
  446. PGVECTO_RS_DATABASE=dify
  447. # analyticdb configurations, only available when VECTOR_STORE is `analyticdb`
  448. ANALYTICDB_KEY_ID=your-ak
  449. ANALYTICDB_KEY_SECRET=your-sk
  450. ANALYTICDB_REGION_ID=cn-hangzhou
  451. ANALYTICDB_INSTANCE_ID=gp-ab123456
  452. ANALYTICDB_ACCOUNT=testaccount
  453. ANALYTICDB_PASSWORD=testpassword
  454. ANALYTICDB_NAMESPACE=dify
  455. ANALYTICDB_NAMESPACE_PASSWORD=difypassword
  456. ANALYTICDB_HOST=gp-test.aliyuncs.com
  457. ANALYTICDB_PORT=5432
  458. ANALYTICDB_MIN_CONNECTION=1
  459. ANALYTICDB_MAX_CONNECTION=5
  460. # TiDB vector configurations, only available when VECTOR_STORE is `tidb_vector`
  461. TIDB_VECTOR_HOST=tidb
  462. TIDB_VECTOR_PORT=4000
  463. TIDB_VECTOR_USER=
  464. TIDB_VECTOR_PASSWORD=
  465. TIDB_VECTOR_DATABASE=dify
  466. # Matrixone vector configurations.
  467. MATRIXONE_HOST=matrixone
  468. MATRIXONE_PORT=6001
  469. MATRIXONE_USER=dump
  470. MATRIXONE_PASSWORD=111
  471. MATRIXONE_DATABASE=dify
  472. # Tidb on qdrant configuration, only available when VECTOR_STORE is `tidb_on_qdrant`
  473. TIDB_ON_QDRANT_URL=http://127.0.0.1
  474. TIDB_ON_QDRANT_API_KEY=dify
  475. TIDB_ON_QDRANT_CLIENT_TIMEOUT=20
  476. TIDB_ON_QDRANT_GRPC_ENABLED=false
  477. TIDB_ON_QDRANT_GRPC_PORT=6334
  478. TIDB_PUBLIC_KEY=dify
  479. TIDB_PRIVATE_KEY=dify
  480. TIDB_API_URL=http://127.0.0.1
  481. TIDB_IAM_API_URL=http://127.0.0.1
  482. TIDB_REGION=regions/aws-us-east-1
  483. TIDB_PROJECT_ID=dify
  484. TIDB_SPEND_LIMIT=100
  485. # Chroma configuration, only available when VECTOR_STORE is `chroma`
  486. CHROMA_HOST=127.0.0.1
  487. CHROMA_PORT=8000
  488. CHROMA_TENANT=default_tenant
  489. CHROMA_DATABASE=default_database
  490. CHROMA_AUTH_PROVIDER=chromadb.auth.token_authn.TokenAuthClientProvider
  491. CHROMA_AUTH_CREDENTIALS=
  492. # Oracle configuration, only available when VECTOR_STORE is `oracle`
  493. ORACLE_USER=dify
  494. ORACLE_PASSWORD=dify
  495. ORACLE_DSN=oracle:1521/FREEPDB1
  496. ORACLE_CONFIG_DIR=/app/api/storage/wallet
  497. ORACLE_WALLET_LOCATION=/app/api/storage/wallet
  498. ORACLE_WALLET_PASSWORD=dify
  499. ORACLE_IS_AUTONOMOUS=false
  500. # relyt configurations, only available when VECTOR_STORE is `relyt`
  501. RELYT_HOST=db
  502. RELYT_PORT=5432
  503. RELYT_USER=postgres
  504. RELYT_PASSWORD=difyai123456
  505. RELYT_DATABASE=postgres
  506. # open search configuration, only available when VECTOR_STORE is `opensearch`
  507. OPENSEARCH_HOST=opensearch
  508. OPENSEARCH_PORT=9200
  509. OPENSEARCH_SECURE=true
  510. OPENSEARCH_VERIFY_CERTS=true
  511. OPENSEARCH_AUTH_METHOD=basic
  512. OPENSEARCH_USER=admin
  513. OPENSEARCH_PASSWORD=admin
  514. # If using AWS managed IAM, e.g. Managed Cluster or OpenSearch Serverless
  515. OPENSEARCH_AWS_REGION=ap-southeast-1
  516. OPENSEARCH_AWS_SERVICE=aoss
  517. # tencent vector configurations, only available when VECTOR_STORE is `tencent`
  518. TENCENT_VECTOR_DB_URL=http://127.0.0.1
  519. TENCENT_VECTOR_DB_API_KEY=dify
  520. TENCENT_VECTOR_DB_TIMEOUT=30
  521. TENCENT_VECTOR_DB_USERNAME=dify
  522. TENCENT_VECTOR_DB_DATABASE=dify
  523. TENCENT_VECTOR_DB_SHARD=1
  524. TENCENT_VECTOR_DB_REPLICAS=2
  525. TENCENT_VECTOR_DB_ENABLE_HYBRID_SEARCH=false
  526. # ElasticSearch configuration, only available when VECTOR_STORE is `elasticsearch`
  527. ELASTICSEARCH_HOST=0.0.0.0
  528. ELASTICSEARCH_PORT=9200
  529. ELASTICSEARCH_USERNAME=elastic
  530. ELASTICSEARCH_PASSWORD=elastic
  531. KIBANA_PORT=5601
  532. # Using ElasticSearch Cloud Serverless, or not.
  533. ELASTICSEARCH_USE_CLOUD=false
  534. ELASTICSEARCH_CLOUD_URL=YOUR-ELASTICSEARCH_CLOUD_URL
  535. ELASTICSEARCH_API_KEY=YOUR-ELASTICSEARCH_API_KEY
  536. ELASTICSEARCH_VERIFY_CERTS=False
  537. ELASTICSEARCH_CA_CERTS=
  538. ELASTICSEARCH_REQUEST_TIMEOUT=100000
  539. ELASTICSEARCH_RETRY_ON_TIMEOUT=True
  540. ELASTICSEARCH_MAX_RETRIES=10
  541. # baidu vector configurations, only available when VECTOR_STORE is `baidu`
  542. BAIDU_VECTOR_DB_ENDPOINT=http://127.0.0.1:5287
  543. BAIDU_VECTOR_DB_CONNECTION_TIMEOUT_MS=30000
  544. BAIDU_VECTOR_DB_ACCOUNT=root
  545. BAIDU_VECTOR_DB_API_KEY=dify
  546. BAIDU_VECTOR_DB_DATABASE=dify
  547. BAIDU_VECTOR_DB_SHARD=1
  548. BAIDU_VECTOR_DB_REPLICAS=3
  549. # VikingDB configurations, only available when VECTOR_STORE is `vikingdb`
  550. VIKINGDB_ACCESS_KEY=your-ak
  551. VIKINGDB_SECRET_KEY=your-sk
  552. VIKINGDB_REGION=cn-shanghai
  553. VIKINGDB_HOST=api-vikingdb.xxx.volces.com
  554. VIKINGDB_SCHEMA=http
  555. VIKINGDB_CONNECTION_TIMEOUT=30
  556. VIKINGDB_SOCKET_TIMEOUT=30
  557. # Lindorm configuration, only available when VECTOR_STORE is `lindorm`
  558. LINDORM_URL=http://lindorm:30070
  559. LINDORM_USERNAME=lindorm
  560. LINDORM_PASSWORD=lindorm
  561. LINDORM_QUERY_TIMEOUT=1
  562. # OceanBase Vector configuration, only available when VECTOR_STORE is `oceanbase`
  563. OCEANBASE_VECTOR_HOST=oceanbase
  564. OCEANBASE_VECTOR_PORT=2881
  565. OCEANBASE_VECTOR_USER=root@test
  566. OCEANBASE_VECTOR_PASSWORD=difyai123456
  567. OCEANBASE_VECTOR_DATABASE=test
  568. OCEANBASE_CLUSTER_NAME=difyai
  569. OCEANBASE_MEMORY_LIMIT=6G
  570. OCEANBASE_ENABLE_HYBRID_SEARCH=false
  571. # opengauss configurations, only available when VECTOR_STORE is `opengauss`
  572. OPENGAUSS_HOST=opengauss
  573. OPENGAUSS_PORT=6600
  574. OPENGAUSS_USER=postgres
  575. OPENGAUSS_PASSWORD=Dify@123
  576. OPENGAUSS_DATABASE=dify
  577. OPENGAUSS_MIN_CONNECTION=1
  578. OPENGAUSS_MAX_CONNECTION=5
  579. OPENGAUSS_ENABLE_PQ=false
  580. # huawei cloud search service vector configurations, only available when VECTOR_STORE is `huawei_cloud`
  581. HUAWEI_CLOUD_HOSTS=https://127.0.0.1:9200
  582. HUAWEI_CLOUD_USER=admin
  583. HUAWEI_CLOUD_PASSWORD=admin
  584. # Upstash Vector configuration, only available when VECTOR_STORE is `upstash`
  585. UPSTASH_VECTOR_URL=https://xxx-vector.upstash.io
  586. UPSTASH_VECTOR_TOKEN=dify
  587. # TableStore Vector configuration
  588. # (only used when VECTOR_STORE is tablestore)
  589. TABLESTORE_ENDPOINT=https://instance-name.cn-hangzhou.ots.aliyuncs.com
  590. TABLESTORE_INSTANCE_NAME=instance-name
  591. TABLESTORE_ACCESS_KEY_ID=xxx
  592. TABLESTORE_ACCESS_KEY_SECRET=xxx
  593. TABLESTORE_NORMALIZE_FULLTEXT_BM25_SCORE=false
  594. # Clickzetta configuration, only available when VECTOR_STORE is `clickzetta`
  595. CLICKZETTA_USERNAME=
  596. CLICKZETTA_PASSWORD=
  597. CLICKZETTA_INSTANCE=
  598. CLICKZETTA_SERVICE=api.clickzetta.com
  599. CLICKZETTA_WORKSPACE=quick_start
  600. CLICKZETTA_VCLUSTER=default_ap
  601. CLICKZETTA_SCHEMA=dify
  602. CLICKZETTA_BATCH_SIZE=100
  603. CLICKZETTA_ENABLE_INVERTED_INDEX=true
  604. CLICKZETTA_ANALYZER_TYPE=chinese
  605. CLICKZETTA_ANALYZER_MODE=smart
  606. CLICKZETTA_VECTOR_DISTANCE_FUNCTION=cosine_distance
  607. # ------------------------------
  608. # Knowledge Configuration
  609. # ------------------------------
  610. # Upload file size limit, default 15M.
  611. UPLOAD_FILE_SIZE_LIMIT=15
  612. # The maximum number of files that can be uploaded at a time, default 5.
  613. UPLOAD_FILE_BATCH_LIMIT=5
  614. # ETL type, support: `dify`, `Unstructured`
  615. # `dify` Dify's proprietary file extraction scheme
  616. # `Unstructured` Unstructured.io file extraction scheme
  617. #ETL_TYPE=dify
  618. # Unstructured API path and API key, needs to be configured when ETL_TYPE is Unstructured
  619. # Or using Unstructured for document extractor node for pptx.
  620. # For example: http://unstructured:8000/general/v0/general
  621. #UNSTRUCTURED_API_URL=
  622. #UNSTRUCTURED_API_KEY=
  623. #SCARF_NO_ANALYTICS=true
  624. # zlwu 填充
  625. ETL_TYPE=Unstructured
  626. UNSTRUCTURED_API_URL=https://api.unstructuredapp.io/general/v0/general
  627. UNSTRUCTURED_API_KEY=j43KE8PQ6cQAGkucFxeUNYMTyp3XHh
  628. SCARF_NO_ANALYTICS=true
  629. # ------------------------------
  630. # Model Configuration
  631. # ------------------------------
  632. # The maximum number of tokens allowed for prompt generation.
  633. # This setting controls the upper limit of tokens that can be used by the LLM
  634. # when generating a prompt in the prompt generation tool.
  635. # Default: 512 tokens.
  636. PROMPT_GENERATION_MAX_TOKENS=512
  637. # The maximum number of tokens allowed for code generation.
  638. # This setting controls the upper limit of tokens that can be used by the LLM
  639. # when generating code in the code generation tool.
  640. # Default: 1024 tokens.
  641. CODE_GENERATION_MAX_TOKENS=1024
  642. # Enable or disable plugin based token counting. If disabled, token counting will return 0.
  643. # This can improve performance by skipping token counting operations.
  644. # Default: false (disabled).
  645. PLUGIN_BASED_TOKEN_COUNTING_ENABLED=false
  646. # ------------------------------
  647. # Multi-modal Configuration
  648. # ------------------------------
  649. # The format of the image/video/audio/document sent when the multi-modal model is input,
  650. # the default is base64, optional url.
  651. # The delay of the call in url mode will be lower than that in base64 mode.
  652. # It is generally recommended to use the more compatible base64 mode.
  653. # If configured as url, you need to configure FILES_URL as an externally accessible address so that the multi-modal model can access the image/video/audio/document.
  654. MULTIMODAL_SEND_FORMAT=base64
  655. # Upload image file size limit, default 10M.
  656. UPLOAD_IMAGE_FILE_SIZE_LIMIT=10
  657. # Upload video file size limit, default 100M.
  658. UPLOAD_VIDEO_FILE_SIZE_LIMIT=100
  659. # Upload audio file size limit, default 50M.
  660. UPLOAD_AUDIO_FILE_SIZE_LIMIT=50
  661. # ------------------------------
  662. # Sentry Configuration
  663. # Used for application monitoring and error log tracking.
  664. # ------------------------------
  665. SENTRY_DSN=
  666. # API Service Sentry DSN address, default is empty, when empty,
  667. # all monitoring information is not reported to Sentry.
  668. # If not set, Sentry error reporting will be disabled.
  669. API_SENTRY_DSN=
  670. # API Service The reporting ratio of Sentry events, if it is 0.01, it is 1%.
  671. API_SENTRY_TRACES_SAMPLE_RATE=1.0
  672. # API Service The reporting ratio of Sentry profiles, if it is 0.01, it is 1%.
  673. API_SENTRY_PROFILES_SAMPLE_RATE=1.0
  674. # Web Service Sentry DSN address, default is empty, when empty,
  675. # all monitoring information is not reported to Sentry.
  676. # If not set, Sentry error reporting will be disabled.
  677. WEB_SENTRY_DSN=
  678. # Plugin_daemon Service Sentry DSN address, default is empty, when empty,
  679. # all monitoring information is not reported to Sentry.
  680. # If not set, Sentry error reporting will be disabled.
  681. PLUGIN_SENTRY_ENABLED=false
  682. PLUGIN_SENTRY_DSN=
  683. # ------------------------------
  684. # Notion Integration Configuration
  685. # Variables can be obtained by applying for Notion integration: https://www.notion.so/my-integrations
  686. # ------------------------------
  687. # Configure as "public" or "internal".
  688. # Since Notion's OAuth redirect URL only supports HTTPS,
  689. # if deploying locally, please use Notion's internal integration.
  690. NOTION_INTEGRATION_TYPE=public
  691. # Notion OAuth client secret (used for public integration type)
  692. NOTION_CLIENT_SECRET=
  693. # Notion OAuth client id (used for public integration type)
  694. NOTION_CLIENT_ID=
  695. # Notion internal integration secret.
  696. # If the value of NOTION_INTEGRATION_TYPE is "internal",
  697. # you need to configure this variable.
  698. NOTION_INTERNAL_SECRET=
  699. # ------------------------------
  700. # Mail related configuration
  701. # ------------------------------
  702. # zlwu 填充
  703. # Mail type, support: resend, smtp, sendgrid
  704. MAIL_TYPE=smtp
  705. # Default send from email address, if not specified
  706. # If using SendGrid, use the 'from' field for authentication if necessary.
  707. MAIL_DEFAULT_SEND_FROM=wuzilongad@126.com
  708. # API-Key for the Resend email provider, used when MAIL_TYPE is `resend`.
  709. RESEND_API_URL=https://api.resend.com
  710. RESEND_API_KEY=your-resend-api-key
  711. # SMTP server configuration, used when MAIL_TYPE is `smtp`
  712. #SMTP_SERVER=
  713. #SMTP_PORT=465
  714. #SMTP_USERNAME=
  715. #SMTP_PASSWORD=
  716. #SMTP_USE_TLS=true
  717. #SMTP_OPPORTUNISTIC_TLS=false
  718. SMTP_SERVER=smtp.126.com
  719. SMTP_PORT=465
  720. SMTP_USERNAME=wuzilongad@126.com
  721. SMTP_PASSWORD=RLvGsQrmnHekaNcs
  722. SMTP_USE_TLS=true
  723. SMTP_OPPORTUNISTIC_TLS=false
  724. # Sendgid configuration
  725. SENDGRID_API_KEY=
  726. # ------------------------------
  727. # Others Configuration
  728. # ------------------------------
  729. # Maximum length of segmentation tokens for indexing
  730. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=4000
  731. # Member invitation link valid time (hours),
  732. # Default: 72.
  733. INVITE_EXPIRY_HOURS=72
  734. # Reset password token valid time (minutes),
  735. RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5
  736. CHANGE_EMAIL_TOKEN_EXPIRY_MINUTES=5
  737. OWNER_TRANSFER_TOKEN_EXPIRY_MINUTES=5
  738. # The sandbox service endpoint.
  739. CODE_EXECUTION_ENDPOINT=http://sandbox:8194
  740. CODE_EXECUTION_API_KEY=dify-sandbox
  741. CODE_MAX_NUMBER=9223372036854775807
  742. CODE_MIN_NUMBER=-9223372036854775808
  743. CODE_MAX_DEPTH=5
  744. CODE_MAX_PRECISION=20
  745. CODE_MAX_STRING_LENGTH=80000
  746. CODE_MAX_STRING_ARRAY_LENGTH=30
  747. CODE_MAX_OBJECT_ARRAY_LENGTH=30
  748. CODE_MAX_NUMBER_ARRAY_LENGTH=1000
  749. CODE_EXECUTION_CONNECT_TIMEOUT=10
  750. CODE_EXECUTION_READ_TIMEOUT=60
  751. CODE_EXECUTION_WRITE_TIMEOUT=10
  752. TEMPLATE_TRANSFORM_MAX_LENGTH=80000
  753. # Workflow runtime configuration
  754. WORKFLOW_MAX_EXECUTION_STEPS=500
  755. WORKFLOW_MAX_EXECUTION_TIME=1200
  756. WORKFLOW_CALL_MAX_DEPTH=5
  757. MAX_VARIABLE_SIZE=204800
  758. WORKFLOW_PARALLEL_DEPTH_LIMIT=3
  759. WORKFLOW_FILE_UPLOAD_LIMIT=10
  760. # Workflow storage configuration
  761. # Options: rdbms, hybrid
  762. # rdbms: Use only the relational database (default)
  763. # hybrid: Save new data to object storage, read from both object storage and RDBMS
  764. WORKFLOW_NODE_EXECUTION_STORAGE=rdbms
  765. # Repository configuration
  766. # Core workflow execution repository implementation
  767. # Options:
  768. # - core.repositories.sqlalchemy_workflow_execution_repository.SQLAlchemyWorkflowExecutionRepository (default)
  769. # - core.repositories.celery_workflow_execution_repository.CeleryWorkflowExecutionRepository
  770. CORE_WORKFLOW_EXECUTION_REPOSITORY=core.repositories.sqlalchemy_workflow_execution_repository.SQLAlchemyWorkflowExecutionRepository
  771. # Core workflow node execution repository implementation
  772. # Options:
  773. # - core.repositories.sqlalchemy_workflow_node_execution_repository.SQLAlchemyWorkflowNodeExecutionRepository (default)
  774. # - core.repositories.celery_workflow_node_execution_repository.CeleryWorkflowNodeExecutionRepository
  775. CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY=core.repositories.sqlalchemy_workflow_node_execution_repository.SQLAlchemyWorkflowNodeExecutionRepository
  776. # API workflow run repository implementation
  777. API_WORKFLOW_RUN_REPOSITORY=repositories.sqlalchemy_api_workflow_run_repository.DifyAPISQLAlchemyWorkflowRunRepository
  778. # API workflow node execution repository implementation
  779. API_WORKFLOW_NODE_EXECUTION_REPOSITORY=repositories.sqlalchemy_api_workflow_node_execution_repository.DifyAPISQLAlchemyWorkflowNodeExecutionRepository
  780. # Workflow log cleanup configuration
  781. # Enable automatic cleanup of workflow run logs to manage database size
  782. WORKFLOW_LOG_CLEANUP_ENABLED=false
  783. # Number of days to retain workflow run logs (default: 30 days)
  784. WORKFLOW_LOG_RETENTION_DAYS=30
  785. # Batch size for workflow log cleanup operations (default: 100)
  786. WORKFLOW_LOG_CLEANUP_BATCH_SIZE=100
  787. # HTTP request node in workflow configuration
  788. HTTP_REQUEST_NODE_MAX_BINARY_SIZE=10485760
  789. HTTP_REQUEST_NODE_MAX_TEXT_SIZE=1048576
  790. HTTP_REQUEST_NODE_SSL_VERIFY=True
  791. # Respect X-* headers to redirect clients
  792. RESPECT_XFORWARD_HEADERS_ENABLED=false
  793. # SSRF Proxy server HTTP URL
  794. SSRF_PROXY_HTTP_URL=http://ssrf_proxy:3128
  795. # SSRF Proxy server HTTPS URL
  796. SSRF_PROXY_HTTPS_URL=http://ssrf_proxy:3128
  797. # Maximum loop count in the workflow
  798. LOOP_NODE_MAX_COUNT=100
  799. # The maximum number of tools that can be used in the agent.
  800. MAX_TOOLS_NUM=10
  801. # Maximum number of Parallelism branches in the workflow
  802. MAX_PARALLEL_LIMIT=10
  803. # The maximum number of iterations for agent setting
  804. MAX_ITERATIONS_NUM=99
  805. # ------------------------------
  806. # Environment Variables for web Service
  807. # ------------------------------
  808. # The timeout for the text generation in millisecond
  809. TEXT_GENERATION_TIMEOUT_MS=60000
  810. # Allow rendering unsafe URLs which have "data:" scheme.
  811. ALLOW_UNSAFE_DATA_SCHEME=false
  812. # Maximum number of tree depth in the workflow
  813. MAX_TREE_DEPTH=50
  814. # ------------------------------
  815. # Environment Variables for db Service
  816. # ------------------------------
  817. # The name of the default postgres user.
  818. POSTGRES_USER=${DB_USERNAME}
  819. # The password for the default postgres user.
  820. POSTGRES_PASSWORD=${DB_PASSWORD}
  821. # The name of the default postgres database.
  822. POSTGRES_DB=${DB_DATABASE}
  823. # postgres data directory
  824. PGDATA=/var/lib/postgresql/data/pgdata
  825. # ------------------------------
  826. # Environment Variables for sandbox Service
  827. # ------------------------------
  828. # The API key for the sandbox service
  829. SANDBOX_API_KEY=dify-sandbox
  830. # The mode in which the Gin framework runs
  831. SANDBOX_GIN_MODE=release
  832. # The timeout for the worker in seconds
  833. SANDBOX_WORKER_TIMEOUT=15
  834. # Enable network for the sandbox service
  835. SANDBOX_ENABLE_NETWORK=true
  836. # HTTP proxy URL for SSRF protection
  837. SANDBOX_HTTP_PROXY=http://ssrf_proxy:3128
  838. # HTTPS proxy URL for SSRF protection
  839. SANDBOX_HTTPS_PROXY=http://ssrf_proxy:3128
  840. # The port on which the sandbox service runs
  841. SANDBOX_PORT=8194
  842. # ------------------------------
  843. # Environment Variables for weaviate Service
  844. # (only used when VECTOR_STORE is weaviate)
  845. # ------------------------------
  846. WEAVIATE_PERSISTENCE_DATA_PATH=/var/lib/weaviate
  847. WEAVIATE_QUERY_DEFAULTS_LIMIT=25
  848. WEAVIATE_AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true
  849. WEAVIATE_DEFAULT_VECTORIZER_MODULE=none
  850. WEAVIATE_CLUSTER_HOSTNAME=node1
  851. WEAVIATE_AUTHENTICATION_APIKEY_ENABLED=true
  852. WEAVIATE_AUTHENTICATION_APIKEY_ALLOWED_KEYS=WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  853. WEAVIATE_AUTHENTICATION_APIKEY_USERS=hello@dify.ai
  854. WEAVIATE_AUTHORIZATION_ADMINLIST_ENABLED=true
  855. WEAVIATE_AUTHORIZATION_ADMINLIST_USERS=hello@dify.ai
  856. # ------------------------------
  857. # Environment Variables for Chroma
  858. # (only used when VECTOR_STORE is chroma)
  859. # ------------------------------
  860. # Authentication credentials for Chroma server
  861. CHROMA_SERVER_AUTHN_CREDENTIALS=difyai123456
  862. # Authentication provider for Chroma server
  863. CHROMA_SERVER_AUTHN_PROVIDER=chromadb.auth.token_authn.TokenAuthenticationServerProvider
  864. # Persistence setting for Chroma server
  865. CHROMA_IS_PERSISTENT=TRUE
  866. # ------------------------------
  867. # Environment Variables for Oracle Service
  868. # (only used when VECTOR_STORE is oracle)
  869. # ------------------------------
  870. ORACLE_PWD=Dify123456
  871. ORACLE_CHARACTERSET=AL32UTF8
  872. # ------------------------------
  873. # Environment Variables for milvus Service
  874. # (only used when VECTOR_STORE is milvus)
  875. # ------------------------------
  876. # ETCD configuration for auto compaction mode
  877. ETCD_AUTO_COMPACTION_MODE=revision
  878. # ETCD configuration for auto compaction retention in terms of number of revisions
  879. ETCD_AUTO_COMPACTION_RETENTION=1000
  880. # ETCD configuration for backend quota in bytes
  881. ETCD_QUOTA_BACKEND_BYTES=4294967296
  882. # ETCD configuration for the number of changes before triggering a snapshot
  883. ETCD_SNAPSHOT_COUNT=50000
  884. # MinIO access key for authentication
  885. MINIO_ACCESS_KEY=minioadmin
  886. # MinIO secret key for authentication
  887. MINIO_SECRET_KEY=minioadmin
  888. # ETCD service endpoints
  889. ETCD_ENDPOINTS=etcd:2379
  890. # MinIO service address
  891. MINIO_ADDRESS=minio:9000
  892. # Enable or disable security authorization
  893. MILVUS_AUTHORIZATION_ENABLED=true
  894. # ------------------------------
  895. # Environment Variables for pgvector / pgvector-rs Service
  896. # (only used when VECTOR_STORE is pgvector / pgvector-rs)
  897. # ------------------------------
  898. PGVECTOR_PGUSER=postgres
  899. # The password for the default postgres user.
  900. PGVECTOR_POSTGRES_PASSWORD=difyai123456
  901. # The name of the default postgres database.
  902. PGVECTOR_POSTGRES_DB=dify
  903. # postgres data directory
  904. PGVECTOR_PGDATA=/var/lib/postgresql/data/pgdata
  905. # ------------------------------
  906. # Environment Variables for opensearch
  907. # (only used when VECTOR_STORE is opensearch)
  908. # ------------------------------
  909. OPENSEARCH_DISCOVERY_TYPE=single-node
  910. OPENSEARCH_BOOTSTRAP_MEMORY_LOCK=true
  911. OPENSEARCH_JAVA_OPTS_MIN=512m
  912. OPENSEARCH_JAVA_OPTS_MAX=1024m
  913. OPENSEARCH_INITIAL_ADMIN_PASSWORD=Qazwsxedc!@#123
  914. OPENSEARCH_MEMLOCK_SOFT=-1
  915. OPENSEARCH_MEMLOCK_HARD=-1
  916. OPENSEARCH_NOFILE_SOFT=65536
  917. OPENSEARCH_NOFILE_HARD=65536
  918. # ------------------------------
  919. # Environment Variables for Nginx reverse proxy
  920. # ------------------------------
  921. NGINX_SERVER_NAME=_
  922. NGINX_HTTPS_ENABLED=false
  923. # HTTP port
  924. NGINX_PORT=80
  925. # SSL settings are only applied when HTTPS_ENABLED is true
  926. NGINX_SSL_PORT=443
  927. # if HTTPS_ENABLED is true, you're required to add your own SSL certificates/keys to the `./nginx/ssl` directory
  928. # and modify the env vars below accordingly.
  929. NGINX_SSL_CERT_FILENAME=dify.crt
  930. NGINX_SSL_CERT_KEY_FILENAME=dify.key
  931. NGINX_SSL_PROTOCOLS=TLSv1.1 TLSv1.2 TLSv1.3
  932. # Nginx performance tuning
  933. NGINX_WORKER_PROCESSES=auto
  934. NGINX_CLIENT_MAX_BODY_SIZE=100M
  935. NGINX_KEEPALIVE_TIMEOUT=65
  936. # Proxy settings
  937. NGINX_PROXY_READ_TIMEOUT=3600s
  938. NGINX_PROXY_SEND_TIMEOUT=3600s
  939. # Set true to accept requests for /.well-known/acme-challenge/
  940. NGINX_ENABLE_CERTBOT_CHALLENGE=false
  941. # ------------------------------
  942. # Certbot Configuration
  943. # ------------------------------
  944. # Email address (required to get certificates from Let's Encrypt)
  945. CERTBOT_EMAIL=your_email@example.com
  946. # Domain name
  947. CERTBOT_DOMAIN=your_domain.com
  948. # certbot command options
  949. # i.e: --force-renewal --dry-run --test-cert --debug
  950. CERTBOT_OPTIONS=
  951. # ------------------------------
  952. # Environment Variables for SSRF Proxy
  953. # ------------------------------
  954. SSRF_HTTP_PORT=3128
  955. SSRF_COREDUMP_DIR=/var/spool/squid
  956. SSRF_REVERSE_PROXY_PORT=8194
  957. SSRF_SANDBOX_HOST=sandbox
  958. SSRF_DEFAULT_TIME_OUT=5
  959. SSRF_DEFAULT_CONNECT_TIME_OUT=5
  960. SSRF_DEFAULT_READ_TIME_OUT=5
  961. SSRF_DEFAULT_WRITE_TIME_OUT=5
  962. # ------------------------------
  963. # docker env var for specifying vector db type at startup
  964. # (based on the vector db type, the corresponding docker
  965. # compose profile will be used)
  966. # if you want to use unstructured, add ',unstructured' to the end
  967. # ------------------------------
  968. COMPOSE_PROFILES=${VECTOR_STORE:-weaviate}
  969. # ------------------------------
  970. # Docker Compose Service Expose Host Port Configurations
  971. # ------------------------------
  972. EXPOSE_NGINX_PORT=80
  973. EXPOSE_NGINX_SSL_PORT=443
  974. # ----------------------------------------------------------------------------
  975. # ModelProvider & Tool Position Configuration
  976. # Used to specify the model providers and tools that can be used in the app.
  977. # ----------------------------------------------------------------------------
  978. # Pin, include, and exclude tools
  979. # Use comma-separated values with no spaces between items.
  980. # Example: POSITION_TOOL_PINS=bing,google
  981. POSITION_TOOL_PINS=
  982. POSITION_TOOL_INCLUDES=
  983. POSITION_TOOL_EXCLUDES=
  984. # Pin, include, and exclude model providers
  985. # Use comma-separated values with no spaces between items.
  986. # Example: POSITION_PROVIDER_PINS=openai,openllm
  987. POSITION_PROVIDER_PINS=
  988. POSITION_PROVIDER_INCLUDES=
  989. POSITION_PROVIDER_EXCLUDES=
  990. # CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
  991. CSP_WHITELIST=
  992. # Enable or disable create tidb service job
  993. CREATE_TIDB_SERVICE_JOB_ENABLED=false
  994. # Maximum number of submitted thread count in a ThreadPool for parallel node execution
  995. MAX_SUBMIT_COUNT=100
  996. # The maximum number of top-k value for RAG.
  997. TOP_K_MAX_VALUE=10
  998. # ------------------------------
  999. # Plugin Daemon Configuration
  1000. # ------------------------------
  1001. DB_PLUGIN_DATABASE=dify_plugin
  1002. EXPOSE_PLUGIN_DAEMON_PORT=5002
  1003. PLUGIN_DAEMON_PORT=5002
  1004. PLUGIN_DAEMON_KEY=lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi
  1005. PLUGIN_DAEMON_URL=http://plugin_daemon:5002
  1006. PLUGIN_MAX_PACKAGE_SIZE=52428800
  1007. PLUGIN_PPROF_ENABLED=false
  1008. PLUGIN_DEBUGGING_HOST=0.0.0.0
  1009. PLUGIN_DEBUGGING_PORT=5003
  1010. EXPOSE_PLUGIN_DEBUGGING_HOST=localhost
  1011. EXPOSE_PLUGIN_DEBUGGING_PORT=5003
  1012. # If this key is changed, DIFY_INNER_API_KEY in plugin_daemon service must also be updated or agent node will fail.
  1013. PLUGIN_DIFY_INNER_API_KEY=QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1
  1014. PLUGIN_DIFY_INNER_API_URL=http://api:5001
  1015. ENDPOINT_URL_TEMPLATE=http://localhost/e/{hook_id}
  1016. MARKETPLACE_ENABLED=true
  1017. MARKETPLACE_API_URL=https://marketplace.dify.ai
  1018. FORCE_VERIFYING_SIGNATURE=true
  1019. PLUGIN_STDIO_BUFFER_SIZE=1024
  1020. PLUGIN_STDIO_MAX_BUFFER_SIZE=5242880
  1021. PLUGIN_PYTHON_ENV_INIT_TIMEOUT=120
  1022. PLUGIN_MAX_EXECUTION_TIMEOUT=600
  1023. # PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple
  1024. PIP_MIRROR_URL=
  1025. # https://github.com/langgenius/dify-plugin-daemon/blob/main/.env.example
  1026. # Plugin storage type, local aws_s3 tencent_cos azure_blob aliyun_oss volcengine_tos
  1027. PLUGIN_STORAGE_TYPE=local
  1028. PLUGIN_STORAGE_LOCAL_ROOT=/app/storage
  1029. PLUGIN_WORKING_PATH=/app/storage/cwd
  1030. PLUGIN_INSTALLED_PATH=plugin
  1031. PLUGIN_PACKAGE_CACHE_PATH=plugin_packages
  1032. PLUGIN_MEDIA_CACHE_PATH=assets
  1033. # Plugin oss bucket
  1034. PLUGIN_STORAGE_OSS_BUCKET=
  1035. # Plugin oss s3 credentials
  1036. PLUGIN_S3_USE_AWS=false
  1037. PLUGIN_S3_USE_AWS_MANAGED_IAM=false
  1038. PLUGIN_S3_ENDPOINT=
  1039. PLUGIN_S3_USE_PATH_STYLE=false
  1040. PLUGIN_AWS_ACCESS_KEY=
  1041. PLUGIN_AWS_SECRET_KEY=
  1042. PLUGIN_AWS_REGION=
  1043. # Plugin oss azure blob
  1044. PLUGIN_AZURE_BLOB_STORAGE_CONTAINER_NAME=
  1045. PLUGIN_AZURE_BLOB_STORAGE_CONNECTION_STRING=
  1046. # Plugin oss tencent cos
  1047. PLUGIN_TENCENT_COS_SECRET_KEY=
  1048. PLUGIN_TENCENT_COS_SECRET_ID=
  1049. PLUGIN_TENCENT_COS_REGION=
  1050. # Plugin oss aliyun oss
  1051. PLUGIN_ALIYUN_OSS_REGION=
  1052. PLUGIN_ALIYUN_OSS_ENDPOINT=
  1053. PLUGIN_ALIYUN_OSS_ACCESS_KEY_ID=
  1054. PLUGIN_ALIYUN_OSS_ACCESS_KEY_SECRET=
  1055. PLUGIN_ALIYUN_OSS_AUTH_VERSION=v4
  1056. PLUGIN_ALIYUN_OSS_PATH=
  1057. # Plugin oss volcengine tos
  1058. PLUGIN_VOLCENGINE_TOS_ENDPOINT=
  1059. PLUGIN_VOLCENGINE_TOS_ACCESS_KEY=
  1060. PLUGIN_VOLCENGINE_TOS_SECRET_KEY=
  1061. PLUGIN_VOLCENGINE_TOS_REGION=
  1062. # ------------------------------
  1063. # OCR Configuration
  1064. # ------------------------------
  1065. # OCR provider (currently supports: dashscope)
  1066. #OCR_PROVIDER=
  1067. # DashScope API Key for Alibaba Cloud Qwen VL OCR
  1068. #DASHSCOPE_API_KEY=
  1069. # DashScope OCR model (e.g., qwen-vl-max)
  1070. #DASHSCOPE_OCR_MODEL=
  1071. # zlwu 填充
  1072. # OCR 配置
  1073. OCR_PROVIDER=dashscope
  1074. DASHSCOPE_API_KEY=sk-e8856c3cb2294042a5d10aef65562fb5
  1075. DASHSCOPE_OCR_MODEL=qwen-vl-max
  1076. # ------------------------------
  1077. # OTLP Collector Configuration
  1078. # ------------------------------
  1079. ENABLE_OTEL=false
  1080. OTLP_TRACE_ENDPOINT=
  1081. OTLP_METRIC_ENDPOINT=
  1082. OTLP_BASE_ENDPOINT=http://localhost:4318
  1083. OTLP_API_KEY=
  1084. OTEL_EXPORTER_OTLP_PROTOCOL=
  1085. OTEL_EXPORTER_TYPE=otlp
  1086. OTEL_SAMPLING_RATE=0.1
  1087. OTEL_BATCH_EXPORT_SCHEDULE_DELAY=5000
  1088. OTEL_MAX_QUEUE_SIZE=2048
  1089. OTEL_MAX_EXPORT_BATCH_SIZE=512
  1090. OTEL_METRIC_EXPORT_INTERVAL=60000
  1091. OTEL_BATCH_EXPORT_TIMEOUT=10000
  1092. OTEL_METRIC_EXPORT_TIMEOUT=30000
  1093. # Prevent Clickjacking
  1094. ALLOW_EMBED=false
  1095. # Dataset queue monitor configuration
  1096. QUEUE_MONITOR_THRESHOLD=200
  1097. # You can configure multiple ones, separated by commas. eg: test1@dify.ai,test2@dify.ai
  1098. QUEUE_MONITOR_ALERT_EMAILS=
  1099. # Monitor interval in minutes, default is 30 minutes
  1100. QUEUE_MONITOR_INTERVAL=30
  1101. # Swagger UI configuration
  1102. SWAGGER_UI_ENABLED=true
  1103. SWAGGER_UI_PATH=/swagger-ui.html
  1104. # Celery schedule tasks configuration
  1105. ENABLE_CLEAN_EMBEDDING_CACHE_TASK=false
  1106. ENABLE_CLEAN_UNUSED_DATASETS_TASK=false
  1107. ENABLE_CREATE_TIDB_SERVERLESS_TASK=false
  1108. ENABLE_UPDATE_TIDB_SERVERLESS_STATUS_TASK=false
  1109. ENABLE_CLEAN_MESSAGES=false
  1110. ENABLE_MAIL_CLEAN_DOCUMENT_NOTIFY_TASK=false
  1111. ENABLE_DATASETS_QUEUE_MONITOR=false
  1112. ENABLE_CHECK_UPGRADABLE_PLUGIN_TASK=true