2025年11月10日 星期一

n8n Environment variables

n8n Environment variables

在建置n8n平台除了在yml設定的參數後,在啟動過程系統會有建議的參數,可以依需求修改docker-compose.yml。

Environment variables-01

There are deprecations related to your environment variables. Please take the recommended actions to update your configuration:
- N8N_BLOCK_ENV_ACCESS_IN_NODE -> The default value of N8N_BLOCK_ENV_ACCESS_IN_NODE will be changed from false to true in a future version. If you need to access environment variables from the Code Node or from expressions, please set N8N_BLOCK_ENV_ACCESS_IN_NODE=false. Learn more: https://docs.n8n.io/hosting/configuration/environment-variables/security/

- N8N_GIT_NODE_DISABLE_BARE_REPOS -> Support for bare repositories in the Git Node will be removed in a future version due to security concerns. If you are not using bare repositories in the Git Node, please set N8N_GIT_NODE_DISABLE_BARE_REPOS=true. Learn more: https://docs.n8n.io/hosting/configuration/environment-variables/security/

環境變數說明

在n8n Community Edition version 1.118.1
docker-compose.yml使用的參數
GENERIC_TIMEZONE=Asia/Taipei
GENERIC_TIMEZONE環境變數為面向調度的節點(如 Schedule Trigger node)設定正確的時區
TZ=Asia/Taipei
TZ環境變數設定系統時區,以控制date等腳本和指令回傳的內容
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
對n8n設定檔強制執行安全文件權限
N8N_RUNNERS_ENABLED=true
啟用任務運行器,在n8n中執行任務的建議方式
N8N_BLOCK_ENV_ACCESS_IN_NODE=true
封鎖 Code Node 與 Expression 讀取環境變數(.env)。
N8N_GIT_NODE_DISABLE_BARE_REPOS=true
禁止 Git Node 使用bare repository,只允許正常(有工作目錄的)Git repository,防止 Git Node 可能的安全風險
N8N_SECURE_COOKIE=false
停用TLS/HTTPS,供測試環境使用

使用PostgreSQL的參數,使用docker compse可寫於.env DB_TYPE=postgresdb DB_POSTGRESDB_HOST=postgres DB_POSTGRESDB_PORT=5432 DB_POSTGRESDB_DATABASE=n8n DB_POSTGRESDB_USER=n8n

官方文件有提供不同的環境參數可以參考。
https://docs.n8n.io/hosting/configuration/environment-variables/
 

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。