mirror of
https://github.com/directus/directus.git
synced 2026-01-23 13:37:58 -05:00
public_url_file in .env causes server start error (#15898)
* allow *_FILE environment vars to overwrite default values * added test * added mock for fs * removed test
This commit is contained in:
@@ -19,6 +19,7 @@ describe('env processed values', () => {
|
||||
|
||||
afterEach(() => {
|
||||
process.env = originalEnv;
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
test('Number value should be a number', () => {
|
||||
|
||||
@@ -401,7 +401,7 @@ function processValues(env: Record<string, any>) {
|
||||
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.`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user