update cli to return version information

This commit is contained in:
Mutasem 2021-07-08 09:42:36 +02:00
parent fdbc0bb650
commit 16b7d55357
3 changed files with 32 additions and 0 deletions

View file

@ -618,6 +618,27 @@ const config = convict({
}, },
}, },
versionNotifications: {
enabled: {
doc: 'Whether feature to request more version information is enabled.',
format: Boolean,
default: true,
env: 'N8N_VERSION_NOTIFICATIONS_ENABLED',
},
endpoint: {
doc: 'Endpoint to retrieve version information from.',
format: String,
default: 'https://api-staging.n8n.io/versions/',
env: 'N8N_VERSION_NOTIFICATIONS_ENDPOINT',
},
infoUrl: {
doc: 'Url in updates panel UI to get more informaton on updating instance',
format: String,
default: 'https://docs.n8n.io/reference/',
env: 'N8N_VERSION_NOTIFICATIONS_ENDPOINT',
}
},
}); });
// Overwrite default configuration with settings which got defined in // Overwrite default configuration with settings which got defined in

View file

@ -312,6 +312,11 @@ export interface IN8nConfigNodes {
exclude: string[]; exclude: string[];
} }
export interface IVersionNotificationSettings {
enabled: boolean;
endpoint: string;
infoUrl: string;
}
export interface IN8nUISettings { export interface IN8nUISettings {
endpointWebhook: string; endpointWebhook: string;
@ -331,6 +336,7 @@ export interface IN8nUISettings {
n8nMetadata?: { n8nMetadata?: {
[key: string]: string | number | undefined; [key: string]: string | number | undefined;
}; };
versionNotifications: IVersionNotificationSettings;
} }
export interface IPackageVersions { export interface IPackageVersions {

View file

@ -196,6 +196,11 @@ class App {
'oauth1': urlBaseWebhook + `${this.restEndpoint}/oauth1-credential/callback`, 'oauth1': urlBaseWebhook + `${this.restEndpoint}/oauth1-credential/callback`,
'oauth2': urlBaseWebhook + `${this.restEndpoint}/oauth2-credential/callback`, 'oauth2': urlBaseWebhook + `${this.restEndpoint}/oauth2-credential/callback`,
}, },
versionNotifications: {
enabled: config.get('versionNotifications.enabled'),
endpoint: config.get('versionNotifications.endpoint'),
infoUrl: config.get('versionNotifications.infoUrl'),
},
}; };
} }