mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
refactor(core): Port templates config (no-changelog) (#10103)
This commit is contained in:
parent
5eca7c8e28
commit
c0264f0cff
12
packages/@n8n/config/src/configs/templates.ts
Normal file
12
packages/@n8n/config/src/configs/templates.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { Config, Env } from '../decorators';
|
||||||
|
|
||||||
|
@Config
|
||||||
|
export class TemplatesConfig {
|
||||||
|
/** Whether to load workflow templates. */
|
||||||
|
@Env('N8N_TEMPLATES_ENABLED')
|
||||||
|
readonly enabled: boolean = true;
|
||||||
|
|
||||||
|
/** Host to retrieve workflow templates from endpoints. */
|
||||||
|
@Env('N8N_TEMPLATES_HOST')
|
||||||
|
readonly host: string = 'https://api.n8n.io/api/';
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ import { EmailConfig } from './configs/email';
|
||||||
import { VersionNotificationsConfig } from './configs/version-notifications';
|
import { VersionNotificationsConfig } from './configs/version-notifications';
|
||||||
import { PublicApiConfig } from './configs/public-api';
|
import { PublicApiConfig } from './configs/public-api';
|
||||||
import { ExternalSecretsConfig } from './configs/external-secrets';
|
import { ExternalSecretsConfig } from './configs/external-secrets';
|
||||||
|
import { TemplatesConfig } from './configs/templates';
|
||||||
|
|
||||||
@Config
|
@Config
|
||||||
class UserManagementConfig {
|
class UserManagementConfig {
|
||||||
|
@ -31,4 +32,7 @@ export class GlobalConfig {
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
externalSecrets: ExternalSecretsConfig;
|
externalSecrets: ExternalSecretsConfig;
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
templates: TemplatesConfig;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ export class InstanceRiskReporter implements RiskReporter {
|
||||||
settings.features = {
|
settings.features = {
|
||||||
communityPackagesEnabled: config.getEnv('nodes.communityPackages.enabled'),
|
communityPackagesEnabled: config.getEnv('nodes.communityPackages.enabled'),
|
||||||
versionNotificationsEnabled: this.globalConfig.versionNotifications.enabled,
|
versionNotificationsEnabled: this.globalConfig.versionNotifications.enabled,
|
||||||
templatesEnabled: config.getEnv('templates.enabled'),
|
templatesEnabled: this.globalConfig.templates.enabled,
|
||||||
publicApiEnabled: isApiEnabled(),
|
publicApiEnabled: isApiEnabled(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -161,8 +161,8 @@ export class FrontendService {
|
||||||
logLevel: config.getEnv('logs.level'),
|
logLevel: config.getEnv('logs.level'),
|
||||||
hiringBannerEnabled: config.getEnv('hiringBanner.enabled'),
|
hiringBannerEnabled: config.getEnv('hiringBanner.enabled'),
|
||||||
templates: {
|
templates: {
|
||||||
enabled: config.getEnv('templates.enabled'),
|
enabled: this.globalConfig.templates.enabled,
|
||||||
host: config.getEnv('templates.host'),
|
host: this.globalConfig.templates.host,
|
||||||
},
|
},
|
||||||
executionMode: config.getEnv('executions.mode'),
|
executionMode: config.getEnv('executions.mode'),
|
||||||
pushBackend: config.getEnv('push.backend'),
|
pushBackend: config.getEnv('push.backend'),
|
||||||
|
|
Loading…
Reference in a new issue