Skip to content

设置自定义加密关键设置(Set a custom encryption key)#

n8n 会在首次启动时自动创建一个随机加密密钥,并将其保存在 ~/.n8n 文件夹中。n8n 使用该密钥在将凭据保存到数据库之前对其进行加密。如果设置文件中还没有该密钥,您可以使用环境变量进行设置,以便 n8n 使用您自定义的密钥,而不是生成新的密钥。

🌐 n8n creates a random encryption key automatically on the first launch and saves it in the ~/.n8n folder. n8n uses that key to encrypt the credentials before they get saved to the database. If the key isn't yet in the settings file, you can set it using an environment variable, so that n8n uses your custom key instead of generating a new one.

队列模式下,你必须为所有工作节点指定加密密钥环境变量。

🌐 In queue mode, you must specify the encryption key environment variable for all workers.

1
export N8N_ENCRYPTION_KEY=<SOME RANDOM STRING>
Refer to Environment variables reference for more information on this variable.