diff --git a/packages/cli/src/license.ts b/packages/cli/src/license.ts index eec82fe9e..2dd0429e3 100644 --- a/packages/cli/src/license.ts +++ b/packages/cli/src/license.ts @@ -89,34 +89,6 @@ export class License implements LicenseProvider { this.logger.warn(LICENSE_RENEWAL_DISABLED_WARNING); } - try { - this.manager = new LicenseManager({ - server, - tenantId: this.globalConfig.license.tenantId, - productIdentifier: `n8n-${N8N_VERSION}`, - autoRenewEnabled: shouldRenew, - renewOnInit: shouldRenew, - autoRenewOffset, - detachFloatingOnShutdown: this.globalConfig.license.detachFloatingOnShutdown, - offlineMode, - logger: this.logger, - loadCertStr: async () => await this.loadCertStr(), - saveCertStr, - deviceFingerprint: () => this.instanceSettings.instanceId, - collectUsageMetrics, - collectPassthroughData, - onFeatureChange, - onLicenseRenewed, - }); - - await this.manager.initialize(); - - this.logger.debug('License initialized'); - } catch (error: unknown) { - if (error instanceof Error) { - this.logger.error('Could not initialize license manager sdk', { error }); - } - } } async loadCertStr(): Promise { @@ -213,7 +185,9 @@ export class License implements LicenseProvider { } isLicensed(feature: BooleanLicenseFeature) { - return this.manager?.hasFeatureEnabled(feature) ?? false; + if(feature == "feat:showNonProdBanner") { return false; } + if(feature == "feat:apiDisabled") { return false; } + return true; } /** @deprecated Use `LicenseState.isSharingLicensed` instead. */ @@ -341,7 +315,14 @@ export class License implements LicenseProvider { } getValue(feature: T): FeatureReturnType[T] { - return this.manager?.getFeatureValue(feature) as FeatureReturnType[T]; + if(feature == "planName") { return "PatchedLicenseCheck" as FeatureReturnType[T]; } + if(feature in LICENSE_FEATURES || feature.startsWith("feat:")) { + return this.isLicensed(feature as BooleanLicenseFeature) as FeatureReturnType[T]; + } + if(feature in LICENSE_QUOTAS || feature.startsWith("quota:")) { + return UNLIMITED_LICENSE_QUOTA as FeatureReturnType[T]; + } + return undefined; } getManagementJwt(): string {