diff --git a/api/src/env.test.ts b/api/src/env.test.ts index c2ac9bbb57..e87ee47288 100644 --- a/api/src/env.test.ts +++ b/api/src/env.test.ts @@ -19,6 +19,7 @@ describe('env processed values', () => { afterEach(() => { process.env = originalEnv; + jest.resetAllMocks(); }); test('Number value should be a number', () => { diff --git a/api/src/env.ts b/api/src/env.ts index 4622a8fcb3..b237309e3c 100644 --- a/api/src/env.ts +++ b/api/src/env.ts @@ -401,7 +401,7 @@ function processValues(env: Record) { if (key.length > 5 && key.endsWith('_FILE')) { newKey = key.slice(0, -5); if (allowedEnvironmentVars.some((pattern) => pattern.test(newKey as string))) { - if (newKey in env) { + if (newKey in env && !(newKey in defaults && env[newKey] === defaults[newKey])) { throw new Error( `Duplicate environment variable encountered: you can't use "${newKey}" and "${key}" simultaneously.` );