mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat(core): Add license support to n8n (#4566)
* add sdk * add license manager * type fix * add basic func * store to db * update default * activate license * add sharing flag * fix setup * clear license * update conosle log to info * refactor * use npm dependency * update error logs * add simple test * add license tests * update tests * update pnpm package * fix error handling types * Update packages/cli/src/config/schema.ts Co-authored-by: Cornelius Suermann <cornelius@n8n.io> * make feature enum * add warning * update sdk * Update packages/cli/src/config/schema.ts Co-authored-by: Cornelius Suermann <cornelius@n8n.io> Co-authored-by: Cornelius Suermann <cornelius@n8n.io>
This commit is contained in:
@@ -160,6 +160,7 @@ import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData'
|
||||
import { ResponseError } from '@/ResponseHelper';
|
||||
import { toHttpNodeParameters } from '@/CurlConverterHelper';
|
||||
import { setupErrorMiddleware } from '@/ErrorReporting';
|
||||
import { getLicense } from '@/License';
|
||||
|
||||
require('body-parser-xml')(bodyParser);
|
||||
|
||||
@@ -384,6 +385,16 @@ class App {
|
||||
return this.frontendSettings;
|
||||
}
|
||||
|
||||
async initLicense(): Promise<void> {
|
||||
const license = getLicense();
|
||||
await license.init(this.frontendSettings.instanceId, this.frontendSettings.versionCli);
|
||||
|
||||
const activationKey = config.getEnv('license.activationKey');
|
||||
if (activationKey) {
|
||||
await license.activate(activationKey);
|
||||
}
|
||||
}
|
||||
|
||||
async config(): Promise<void> {
|
||||
const enableMetrics = config.getEnv('endpoints.metrics.enable');
|
||||
let register: Registry;
|
||||
@@ -406,6 +417,8 @@ class App {
|
||||
|
||||
await this.externalHooks.run('frontend.settings', [this.frontendSettings]);
|
||||
|
||||
await this.initLicense();
|
||||
|
||||
const excludeEndpoints = config.getEnv('security.excludeEndpoints');
|
||||
|
||||
const ignoredEndpoints = [
|
||||
|
||||
Reference in New Issue
Block a user