mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
37a6e329af
* 🚚 Move schema to standalone file * ⚡ Add assertions to string literal arrays * ✨ Infer typings for convict schema * 🔥 Remove unneeded assertions * 🔨 Fix errors surfaced by typings * ⚡ Type nodes.include/exclude per docs * ⚡ Account for types for exception paths * ⚡ Set method alias to flag incorrect paths * ⚡ Replace original with alias * ⚡ Make allowance for nodes.include * ⚡ Adjust leftover calls * 🔀 Fix conflicts * 🔥 Remove unneeded castings * 📘 Simplify exception path type * 📦 Update package-lock.json * 🔥 Remove unneeded imports * 🔥 Remove unrelated file * ⚡ Update schema * ⚡ Update interface * 📦 Update package-lock.json * 📦 Update package-lock.json * 🔥 Remove leftover assertions Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
28 lines
676 B
TypeScript
28 lines
676 B
TypeScript
/* eslint-disable @typescript-eslint/unbound-method */
|
|
/* eslint-disable no-console */
|
|
|
|
import * as convict from 'convict';
|
|
import * as dotenv from 'dotenv';
|
|
import { schema } from './schema';
|
|
|
|
dotenv.config();
|
|
|
|
const config = convict(schema);
|
|
|
|
config.getEnv = config.get;
|
|
|
|
// Overwrite default configuration with settings which got defined in
|
|
// optional configuration files
|
|
if (process.env.N8N_CONFIG_FILES !== undefined) {
|
|
const configFiles = process.env.N8N_CONFIG_FILES.split(',');
|
|
console.log(`\nLoading configuration overwrites from:\n - ${configFiles.join('\n - ')}\n`);
|
|
|
|
config.loadFile(configFiles);
|
|
}
|
|
|
|
config.validate({
|
|
allowed: 'strict',
|
|
});
|
|
|
|
export = config;
|