fix(core): Prevent issues with missing or mismatching encryption key (#8332)
This commit is contained in:
@@ -259,6 +259,13 @@ export class Worker extends BaseCommand {
|
||||
|
||||
constructor(argv: string[], cmdConfig: IConfig) {
|
||||
super(argv, cmdConfig);
|
||||
|
||||
if (!process.env.N8N_ENCRYPTION_KEY) {
|
||||
throw new ApplicationError(
|
||||
'Missing encryption key. Worker started without the required N8N_ENCRYPTION_KEY env var. More information: https://docs.n8n.io/hosting/environment-variables/configuration-methods/#encryption-key',
|
||||
);
|
||||
}
|
||||
|
||||
this.setInstanceType('worker');
|
||||
this.setInstanceQueueModeId();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ if (inE2ETests) {
|
||||
process.env.N8N_AI_ENABLED = 'true';
|
||||
} else if (inTest) {
|
||||
process.env.N8N_LOG_LEVEL = 'silent';
|
||||
process.env.N8N_ENCRYPTION_KEY = 'test-encryption-key';
|
||||
process.env.N8N_ENCRYPTION_KEY = 'test_key';
|
||||
process.env.N8N_PUBLIC_API_DISABLED = 'true';
|
||||
process.env.SKIP_STATISTICS_EVENTS = 'true';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user