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

View file

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