Skip to content

Commit

Permalink
refactor(core): Make new configs consistent (no-changelog) (#10393)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Aug 14, 2024
1 parent e640f1f commit c0811b2
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 40 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Config, Env, Nested } from '../decorators';

@Config
export class SmtpAuth {
class SmtpAuth {
/** SMTP login username */
@Env('N8N_SMTP_USER')
user = '';
Expand All @@ -20,7 +20,7 @@ export class SmtpAuth {
}

@Config
export class SmtpConfig {
class SmtpConfig {
/** SMTP server host */
@Env('N8N_SMTP_HOST')
host = '';
Expand Down Expand Up @@ -65,7 +65,7 @@ export class TemplateConfig {
}

@Config
export class EmailConfig {
class EmailConfig {
/** How to send emails */
@Env('N8N_EMAIL_MODE')
mode: '' | 'smtp' = 'smtp';
Expand All @@ -76,3 +76,9 @@ export class EmailConfig {
@Nested
template: TemplateConfig;
}

@Config
export class UserManagementConfig {
@Nested
emails: EmailConfig;
}
68 changes: 31 additions & 37 deletions packages/@n8n/config/src/index.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit c0811b2

Please sign in to comment.