mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(core): Load config values from files using _FILE env variables (no-changelog) (#5335)
This broke in https://github.com/n8n-io/n8n/pull/5283/
This commit is contained in:
committed by
GitHub
parent
8b09e98654
commit
6cba652ff9
@@ -47,9 +47,11 @@ if (!inE2ETests && !inTest) {
|
||||
const overwrites = Object.entries(process.env).reduce<Record<string, string>>(
|
||||
(acc, [envName, fileName]) => {
|
||||
if (envName.endsWith('_FILE') && fileName) {
|
||||
const key = envName.replace(/_FILE$/, '');
|
||||
const configEnvName = envName.replace(/_FILE$/, '');
|
||||
// @ts-ignore
|
||||
if (key in config._env) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
const key = config._env[configEnvName]?.[0] as string;
|
||||
if (key) {
|
||||
let value: string;
|
||||
try {
|
||||
value = readFileSync(fileName, 'utf8').trim();
|
||||
|
||||
Reference in New Issue
Block a user