mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +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>>(
|
const overwrites = Object.entries(process.env).reduce<Record<string, string>>(
|
||||||
(acc, [envName, fileName]) => {
|
(acc, [envName, fileName]) => {
|
||||||
if (envName.endsWith('_FILE') && fileName) {
|
if (envName.endsWith('_FILE') && fileName) {
|
||||||
const key = envName.replace(/_FILE$/, '');
|
const configEnvName = envName.replace(/_FILE$/, '');
|
||||||
// @ts-ignore
|
// @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;
|
let value: string;
|
||||||
try {
|
try {
|
||||||
value = readFileSync(fileName, 'utf8').trim();
|
value = readFileSync(fileName, 'utf8').trim();
|
||||||
|
|||||||
Reference in New Issue
Block a user