Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Warn on unknown N8N env vars #9279

Closed
wants to merge 1 commit into from

Conversation

ivov
Copy link
Contributor

@ivov ivov commented May 2, 2024

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels May 2, 2024
Copy link
Contributor

@krynble krynble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: I think all environment variables and be appended with _FILE and they would be read by convict (or another lib) - would this fire for those variables too?

Comment on lines +18 to +30
const traverse = (obj: Record<string, unknown>) => {
for (const key in obj) {
const value = obj[key] as Record<string, unknown> | string;

if (typeof value === 'object') {
traverse(value);
} else if (typeof value === 'string' && key === 'env') {
envVars.push(value);
}
}
};

traverse(schema);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we create a function and call it right away? Would something break if we lifted the body of traverse into findSchemaEnvVars' body?

@ivov
Copy link
Contributor Author

ivov commented May 13, 2024

Seeing now that we haven't been consistent in prefixing our envs with N8N_ so this PR would work only for a subset of cases. Likely not worth the effort.

@ivov ivov closed this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants