refactor(core): Make new configs consistent (no-changelog) (#10393)

This commit is contained in:
Iván Ovejero 2024-08-14 11:30:26 +02:00 committed by GitHub
parent e640f1f42c
commit c0811b218a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 40 additions and 40 deletions

View file

@ -1,7 +1,7 @@
import { Config, Env, Nested } from '../decorators';
@Config
export class SmtpAuth {
class SmtpAuth {
/** SMTP login username */
@Env('N8N_SMTP_USER')
user = '';
@ -20,7 +20,7 @@ export class SmtpAuth {
}
@Config
export class SmtpConfig {
class SmtpConfig {
/** SMTP server host */
@Env('N8N_SMTP_HOST')
host = '';
@ -65,7 +65,7 @@ export class TemplateConfig {
}
@Config
export class EmailConfig {
class EmailConfig {
/** How to send emails */
@Env('N8N_EMAIL_MODE')
mode: '' | 'smtp' = 'smtp';
@ -76,3 +76,9 @@ export class EmailConfig {
@Nested
template: TemplateConfig;
}
@Config
export class UserManagementConfig {
@Nested
emails: EmailConfig;
}

View file

@ -1,85 +1,79 @@
import { Config, Env, Nested } from './decorators';
import { CredentialsConfig } from './configs/credentials';
import { DatabaseConfig } from './configs/database';
import { EmailConfig } from './configs/email';
import { VersionNotificationsConfig } from './configs/version-notifications';
import { PublicApiConfig } from './configs/public-api';
import { ExternalSecretsConfig } from './configs/external-secrets';
import { TemplatesConfig } from './configs/templates';
import { EventBusConfig } from './configs/event-bus';
import { NodesConfig } from './configs/nodes';
import { ExternalStorageConfig } from './configs/external-storage';
import { WorkflowsConfig } from './configs/workflows';
import { EndpointsConfig } from './configs/endpoints';
import { CacheConfig } from './configs/cache';
import { CredentialsConfig } from './configs/credentials.config';
import { DatabaseConfig } from './configs/database.config';
import { VersionNotificationsConfig } from './configs/version-notifications.config';
import { PublicApiConfig } from './configs/public-api.config';
import { ExternalSecretsConfig } from './configs/external-secrets.config';
import { TemplatesConfig } from './configs/templates.config';
import { EventBusConfig } from './configs/event-bus.config';
import { NodesConfig } from './configs/nodes.config';
import { ExternalStorageConfig } from './configs/external-storage.config';
import { WorkflowsConfig } from './configs/workflows.config';
import { EndpointsConfig } from './configs/endpoints.config';
import { CacheConfig } from './configs/cache.config';
import { ScalingModeConfig } from './configs/scaling-mode.config';
@Config
class UserManagementConfig {
@Nested
emails: EmailConfig;
}
import { UserManagementConfig } from './configs/user-management.config';
@Config
export class GlobalConfig {
@Nested
readonly database: DatabaseConfig;
database: DatabaseConfig;
@Nested
readonly credentials: CredentialsConfig;
credentials: CredentialsConfig;
@Nested
readonly userManagement: UserManagementConfig;
userManagement: UserManagementConfig;
@Nested
readonly versionNotifications: VersionNotificationsConfig;
versionNotifications: VersionNotificationsConfig;
@Nested
readonly publicApi: PublicApiConfig;
publicApi: PublicApiConfig;
@Nested
readonly externalSecrets: ExternalSecretsConfig;
externalSecrets: ExternalSecretsConfig;
@Nested
readonly templates: TemplatesConfig;
templates: TemplatesConfig;
@Nested
readonly eventBus: EventBusConfig;
eventBus: EventBusConfig;
@Nested
readonly nodes: NodesConfig;
nodes: NodesConfig;
@Nested
readonly externalStorage: ExternalStorageConfig;
externalStorage: ExternalStorageConfig;
@Nested
readonly workflows: WorkflowsConfig;
workflows: WorkflowsConfig;
/** Path n8n is deployed to */
@Env('N8N_PATH')
readonly path: string = '/';
path = '/';
/** Host name n8n can be reached */
@Env('N8N_HOST')
readonly host: string = 'localhost';
host = 'localhost';
/** HTTP port n8n can be reached */
@Env('N8N_PORT')
readonly port: number = 5678;
port = 5678;
/** IP address n8n should listen on */
@Env('N8N_LISTEN_ADDRESS')
readonly listen_address: string = '0.0.0.0';
listen_address = '0.0.0.0';
/** HTTP Protocol via which n8n can be reached */
@Env('N8N_PROTOCOL')
readonly protocol: 'http' | 'https' = 'http';
protocol: 'http' | 'https' = 'http';
@Nested
readonly endpoints: EndpointsConfig;
endpoints: EndpointsConfig;
@Nested
readonly cache: CacheConfig;
cache: CacheConfig;
@Nested
queue: ScalingModeConfig;