refactor(core): Port nodes config (no-changelog) (#10140)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Iván Ovejero
2024-07-23 13:32:50 +02:00
committed by GitHub
parent d2a3a4a080
commit 95b85dd5c1
14 changed files with 95 additions and 65 deletions

View File

@@ -2,18 +2,9 @@ import path from 'path';
import convict from 'convict';
import { Container } from 'typedi';
import { InstanceSettings } from 'n8n-core';
import { LOG_LEVELS, jsonParse } from 'n8n-workflow';
import { LOG_LEVELS } from 'n8n-workflow';
import { ensureStringArray } from './utils';
convict.addFormat({
name: 'json-string-array',
coerce: (rawStr: string) =>
jsonParse<string[]>(rawStr, {
errorMessage: `Expected this value "${rawStr}" to be valid JSON`,
}),
validate: ensureStringArray,
});
convict.addFormat({
name: 'comma-separated-list',
coerce: (rawStr: string) => rawStr.split(','),
@@ -615,35 +606,6 @@ export const schema = {
env: 'EXTERNAL_HOOK_FILES',
},
nodes: {
include: {
doc: 'Nodes to load',
format: 'json-string-array',
default: undefined,
env: 'NODES_INCLUDE',
},
exclude: {
doc: 'Nodes not to load',
format: 'json-string-array',
default: undefined,
env: 'NODES_EXCLUDE',
},
errorTriggerType: {
doc: 'Node Type to use as Error Trigger',
format: String,
default: 'n8n-nodes-base.errorTrigger',
env: 'NODES_ERROR_TRIGGER_TYPE',
},
communityPackages: {
enabled: {
doc: 'Allows you to disable the usage of community packages for nodes',
format: Boolean,
default: true,
env: 'N8N_COMMUNITY_PACKAGES_ENABLED',
},
},
},
logs: {
level: {
doc: 'Log output level',

View File

@@ -75,8 +75,6 @@ type ToReturnType<T extends ConfigOptionPath> = T extends NumericPath
type ExceptionPaths = {
'queue.bull.redis': RedisOptions;
binaryDataManager: BinaryData.Config;
'nodes.exclude': string[] | undefined;
'nodes.include': string[] | undefined;
'userManagement.isInstanceOwnerSetUp': boolean;
'ui.banners.dismissed': string[] | undefined;
};