-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): Prevent issues with missing or mismatching encryption key #8332
fix(core): Prevent issues with missing or mismatching encryption key #8332
Conversation
This PR will make it more evident that there is a mismatch, but the root cause of this user's mismatch is likely what Adi mentioned: #8287 (comment) |
const { encryptionKey, tunnelSubdomain } = settings; | ||
|
||
if (process.env.N8N_ENCRYPTION_KEY && encryptionKey !== process.env.N8N_ENCRYPTION_KEY) { | ||
throw new ApplicationError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing behavior is to take precedence in the config file - should we throw and prevent starting or just warn the users about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following this:
also, we need to add a check when there is an encryption key in .n8n/config and it does not match the one being passed in via N8N_ENCRYPTION_KEY, and fail to start the application.
Passing run #3783 ↗︎
Details:
Review all test suite changes for PR #8332 ↗︎ |
✅ All Cypress E2E specs passed |
Got released with |
Hello, |
Thanks for the comment @Dasio - we discussed it privately but for completeness' sake, we made this change to assert that users would always provide the encryption key in a reliable way; the Sorry for the trouble, you should change the settings to provide the encryption key via environment variable. |
N8N_ENCRYPTION_KEY
does not matchconfigFile.encryptionKey
, fail to init mainN8N_ENCRYPTION_KEY
is missing on worker, fail to init workerStory: https://linear.app/n8n/issue/PAY-1184