mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
⚡ Expose public api activation to the settings
This commit is contained in:
parent
20087373b9
commit
f762e143c3
|
@ -576,11 +576,11 @@ export const schema = {
|
|||
},
|
||||
},
|
||||
|
||||
publicApiEndpoints: {
|
||||
disable: {
|
||||
publicApi: {
|
||||
disabled: {
|
||||
format: Boolean,
|
||||
default: false,
|
||||
env: 'N8N_PUBLIC_API_DISABLE',
|
||||
env: 'N8N_PUBLIC_API_DISABLED',
|
||||
doc: 'Whether to disable the Public API',
|
||||
},
|
||||
path: {
|
||||
|
|
|
@ -457,6 +457,7 @@ export interface IN8nUISettings {
|
|||
personalizationSurveyEnabled: boolean;
|
||||
defaultLocale: string;
|
||||
userManagement: IUserManagementSettings;
|
||||
publicApi: IPublicApiSettings;
|
||||
workflowTagsDisabled: boolean;
|
||||
logLevel: 'info' | 'debug' | 'warn' | 'error' | 'verbose' | 'silent';
|
||||
hiringBannerEnabled: boolean;
|
||||
|
@ -480,6 +481,9 @@ export interface IUserManagementSettings {
|
|||
showSetupOnFirstLoad?: boolean;
|
||||
smtpSetup: boolean;
|
||||
}
|
||||
export interface IPublicApiSettings {
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface IPackageVersions {
|
||||
cli: string;
|
||||
|
|
|
@ -253,7 +253,7 @@ class App {
|
|||
this.payloadSizeMax = config.get('endpoints.payloadSizeMax');
|
||||
this.timezone = config.get('generic.timezone');
|
||||
this.restEndpoint = config.get('endpoints.rest');
|
||||
this.publicApiEndpoint = config.get('publicApiEndpoints.path');
|
||||
this.publicApiEndpoint = config.get('publicApi.path');
|
||||
|
||||
this.activeWorkflowRunner = ActiveWorkflowRunner.getInstance();
|
||||
this.testWebhooks = TestWebhooks.getInstance();
|
||||
|
@ -324,6 +324,9 @@ class App {
|
|||
config.getEnv('userManagement.skipInstanceOwnerSetup') === false,
|
||||
smtpSetup: isEmailSetUp(),
|
||||
},
|
||||
publicApi: {
|
||||
enabled: config.getEnv('publicApi.disabled') === false,
|
||||
},
|
||||
workflowTagsDisabled: config.getEnv('workflowTagsDisabled'),
|
||||
logLevel: config.getEnv('logs.level'),
|
||||
hiringBannerEnabled: config.getEnv('hiringBanner.enabled'),
|
||||
|
@ -581,7 +584,7 @@ class App {
|
|||
return ResponseHelper.sendSuccessResponse(res, {}, true, 204);
|
||||
});
|
||||
|
||||
if (!config.getEnv('publicApiEndpoints.disable')) {
|
||||
if (!config.getEnv('publicApi.disabled')) {
|
||||
this.app.use(`/${this.publicApiEndpoint}`, ...(await loadPublicApiVersions()));
|
||||
}
|
||||
// Parse cookies for easier access
|
||||
|
|
|
@ -2,7 +2,7 @@ import config from '../../../config';
|
|||
|
||||
export const REST_PATH_SEGMENT = config.getEnv('endpoints.rest') as Readonly<string>;
|
||||
|
||||
export const PUBLIC_API_REST_PATH_SEGMENT = config.get('publicApiEndpoints.path') as Readonly<string>;
|
||||
export const PUBLIC_API_REST_PATH_SEGMENT = config.getEnv('publicApi.path') as Readonly<string>;
|
||||
|
||||
export const AUTHLESS_ENDPOINTS: Readonly<string[]> = [
|
||||
'healthz',
|
||||
|
|
Loading…
Reference in a new issue