keflag commited on
Commit
589b932
·
verified ·
1 Parent(s): 0fbb4e9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +91 -910
Dockerfile CHANGED
@@ -2,14 +2,16 @@ FROM n8nio/n8n:latest
2
 
3
  USER root
4
 
5
- # 1. 覆盖 license-state.js
 
 
6
  RUN cat > /usr/local/lib/node_modules/n8n/node_modules/@n8n/backend-common/dist/license-state.js <<'EOF'
7
  "use strict";
8
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
9
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
11
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
12
- return c > 3 && r && Object.defineProperty(target, key, r), r;
13
  };
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
  exports.LicenseState = void 0;
@@ -107,55 +109,19 @@ let LicenseState = class LicenseState {
107
  };
108
  exports.LicenseState = LicenseState;
109
  exports.LicenseState = LicenseState = __decorate([
110
- (0, di_1.Service)()
111
  ], LicenseState);
112
  //# sourceMappingURL=license-state.js.map
113
  EOF
114
 
115
- # 2. 覆盖 license.js
116
  RUN cat > /usr/local/lib/node_modules/n8n/dist/license.js <<'EOF'
117
  "use strict";
118
- var __createBinding = (this && this.__createBinding) || (function(o, m, k, k2) {
119
- if (k2 === undefined) k2 = k;
120
- var desc = Object.getOwnPropertyDescriptor(m, k);
121
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
122
- desc = { enumerable: true, get: function() { return m[k]; } };
123
- }
124
- Object.defineProperty(o, k2, desc);
125
- }) : (function(o, m, k, k2) {
126
- if (k2 === undefined) k2 = k;
127
- o[k2] = m[k];
128
- });
129
- var __setModuleDefault = (this && this.__setModuleDefault) || (function(o, v) {
130
- Object.defineProperty(o, "default", { enumerable: true, value: v });
131
- }) : function(o, v) {
132
- o["default"] = v;
133
- };
134
- var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) {
135
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
136
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
137
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
138
- return c > 3 && r && Object.defineProperty(target, key, r), r;
139
- };
140
- var __importStar = (this && this.__importStar) || function() {
141
- var ownKeys = function(o) {
142
- ownKeys = Object.getOwnPropertyNames || function(o) {
143
- var ar = [];
144
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
145
- return ar;
146
- };
147
- return ownKeys(o);
148
- };
149
- return function(mod) {
150
- if (mod && mod.__esModule) return mod;
151
- var result = {};
152
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
153
- __setModuleDefault(result, mod);
154
- return result;
155
- };
156
- });
157
- var __metadata = (this && this.__metadata) || function(k, v) {
158
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
159
  };
160
  Object.defineProperty(exports, "__esModule", { value: true });
161
  exports.License = void 0;
@@ -163,13 +129,7 @@ const backend_common_1 = require("@n8n/backend-common");
163
  const config_1 = require("@n8n/config");
164
  const constants_1 = require("@n8n/constants");
165
  const db_1 = require("@n8n/db");
166
- const decorators_1 = require("@n8n/decorators");
167
  const di_1 = require("@n8n/di");
168
- const license_sdk_1 = require("@n8n_io/license-sdk");
169
- const n8n_core_1 = require("n8n-core");
170
- const license_metrics_service_1 = require("./metrics/license-metrics.service");
171
- const constants_2 = require("./constants");
172
- const LICENSE_RENEWAL_DISABLED_WARNING = 'Automatic license renewal is disabled. The license will not renew automatically, and access to licensed features may be lost!';
173
  let License = class License {
174
  constructor(logger, instanceSettings, settingsRepository, licenseMetricsService, globalConfig) {
175
  this.logger = logger;
@@ -177,387 +137,77 @@ let License = class License {
177
  this.settingsRepository = settingsRepository;
178
  this.licenseMetricsService = licenseMetricsService;
179
  this.globalConfig = globalConfig;
180
- this.isShuttingDown = false;
181
- this.refreshCallbacks = [];
182
- this.logger = this.logger.scoped('license');
183
- }
184
- async init({ forceRecreate = false, isCli = false, } = {}) {
185
- if (this.manager && !forceRecreate) {
186
- this.logger.warn('License manager already initialized or shutting down');
187
- return;
188
- }
189
- if (this.isShuttingDown) {
190
- this.logger.warn('License manager already shutting down');
191
- return;
192
- }
193
- const { instanceType } = this.instanceSettings;
194
- const isMainInstance = instanceType === 'main';
195
- const server = this.globalConfig.license.serverUrl;
196
- const offlineMode = !isMainInstance;
197
- const autoRenewOffset = 72 * constants_1.Time.hours.toSeconds;
198
- const saveCertStr = isMainInstance
199
- ? async (value) => await this.saveCertStr(value)
200
- : async () => { };
201
- const onFeatureChange = isMainInstance
202
- ? async () => await this.onFeatureChange()
203
- : async () => { };
204
- const onLicenseRenewed = isMainInstance
205
- ? async () => await this.onLicenseRenewed()
206
- : async () => { };
207
- const collectUsageMetrics = isMainInstance
208
- ? async () => await this.licenseMetricsService.collectUsageMetrics()
209
- : async () => [];
210
- const collectPassthroughData = isMainInstance
211
- ? async () => await this.licenseMetricsService.collectPassthroughData()
212
- : async () => ({});
213
- const onExpirySoon = !this.instanceSettings.isLeader ? () => this.onExpirySoon() : undefined;
214
- const expirySoonOffsetMins = !this.instanceSettings.isLeader ? 120 : undefined;
215
- const { isLeader } = this.instanceSettings;
216
- const { autoRenewalEnabled } = this.globalConfig.license;
217
- const eligibleToRenew = isCli || isLeader;
218
- const shouldRenew = eligibleToRenew && autoRenewalEnabled;
219
- if (eligibleToRenew && !autoRenewalEnabled) {
220
- this.logger.warn(LICENSE_RENEWAL_DISABLED_WARNING);
221
- }
222
- try {
223
- this.manager = new license_sdk_1.LicenseManager({
224
- server,
225
- tenantId: this.globalConfig.license.tenantId,
226
- productIdentifier: `n8n-${constants_2.N8N_VERSION}`,
227
- autoRenewEnabled: shouldRenew,
228
- renewOnInit: shouldRenew,
229
- autoRenewOffset,
230
- detachFloatingOnShutdown: this.globalConfig.license.detachFloatingOnShutdown,
231
- offlineMode,
232
- logger: this.logger,
233
- loadCertStr: async () => await this.loadCertStr(),
234
- saveCertStr,
235
- deviceFingerprint: () => this.instanceSettings.instanceId,
236
- collectUsageMetrics,
237
- collectPassthroughData,
238
- onFeatureChange,
239
- onLicenseRenewed,
240
- onExpirySoon,
241
- expirySoonOffsetMins,
242
- });
243
- await this.manager.initialize();
244
- this.logger.debug('License initialized');
245
- }
246
- catch (error) {
247
- if (error instanceof Error) {
248
- this.logger.error('Could not initialize license manager sdk', { error });
249
- }
250
- }
251
- }
252
- async loadCertStr() {
253
- const ephemeralLicense = this.globalConfig.license.cert;
254
- if (ephemeralLicense) {
255
- return ephemeralLicense;
256
- }
257
- const databaseSettings = await this.settingsRepository.findOne({
258
- where: {
259
- key: constants_2.SETTINGS_LICENSE_CERT_KEY,
260
- },
261
- });
262
- return databaseSettings?.value ?? '';
263
- }
264
- async onFeatureChange() {
265
- void this.broadcastReloadLicenseCommand();
266
- await this.notifyRefreshCallbacks();
267
- }
268
- async onLicenseRenewed() {
269
- void this.broadcastReloadLicenseCommand();
270
- await this.notifyRefreshCallbacks();
271
- }
272
- async broadcastReloadLicenseCommand() {
273
- if (this.globalConfig.executions.mode === 'queue' && this.instanceSettings.isLeader) {
274
- const { Publisher } = await Promise.resolve().then(() => __importStar(require('./scaling/pubsub/publisher.service')));
275
- await di_1.Container.get(Publisher).publishCommand({ command: 'reload-license' });
276
- }
277
- }
278
- async saveCertStr(value) {
279
- if (this.globalConfig.license.cert)
280
- return;
281
- await this.settingsRepository.upsert({
282
- key: constants_2.SETTINGS_LICENSE_CERT_KEY,
283
- value,
284
- loadOnStartup: false,
285
- }, ['key']);
286
- }
287
- onCertRefresh(refreshCallback) {
288
- this.refreshCallbacks.push(refreshCallback);
289
- return () => {
290
- const index = this.refreshCallbacks.indexOf(refreshCallback);
291
- if (index > -1) {
292
- this.refreshCallbacks.splice(index, 1);
293
- }
294
- };
295
- }
296
- async notifyRefreshCallbacks() {
297
- const cert = await this.loadCertStr();
298
- for (const refreshCallback of this.refreshCallbacks) {
299
- try {
300
- refreshCallback(cert);
301
- }
302
- catch (error) {
303
- this.logger.error('Error in license refresh callback', { error });
304
- }
305
- }
306
- }
307
- async activate(activationKey, eulaUri, userEmail) {
308
- if (!this.manager) {
309
- return;
310
- }
311
- await this.manager.activate(activationKey, { eulaUri, email: userEmail });
312
- this.logger.debug('License activated');
313
- }
314
- async reload() {
315
- if (!this.manager) {
316
- return;
317
- }
318
- await this.manager.reload();
319
- await this.notifyRefreshCallbacks();
320
- this.logger.debug('License reloaded');
321
- }
322
- async renew() {
323
- if (!this.manager) {
324
- return;
325
- }
326
- await this.manager.renew();
327
- this.logger.debug('License renewed');
328
- }
329
- async clear() {
330
- if (!this.manager) {
331
- return;
332
- }
333
- await this.manager.clear();
334
- this.logger.info('License cleared');
335
- }
336
- async shutdown() {
337
- this.isShuttingDown = true;
338
- if (!this.manager) {
339
- return;
340
- }
341
- await this.manager.shutdown();
342
- this.logger.debug('License shut down');
343
- }
344
- isLicensed(feature) {
345
- return true;
346
- }
347
- isDynamicCredentialsEnabled() {
348
- return true;
349
- }
350
- isSharingEnabled() {
351
- return true;
352
- }
353
- isLogStreamingEnabled() {
354
- return true;
355
- }
356
- isLdapEnabled() {
357
- return true;
358
- }
359
- isSamlEnabled() {
360
- return true;
361
- }
362
- isAiAssistantEnabled() {
363
- return true;
364
- }
365
- isAskAiEnabled() {
366
- return true;
367
- }
368
- isAiCreditsEnabled() {
369
- return true;
370
- }
371
- isAdvancedExecutionFiltersEnabled() {
372
- return true;
373
- }
374
- isAdvancedPermissionsLicensed() {
375
- return true;
376
- }
377
- isDebugInEditorLicensed() {
378
- return true;
379
- }
380
- isBinaryDataS3Licensed() {
381
- return true;
382
- }
383
- isMultiMainLicensed() {
384
- return true;
385
- }
386
- isVariablesEnabled() {
387
- return true;
388
- }
389
- isSourceControlLicensed() {
390
- return true;
391
- }
392
- isExternalSecretsEnabled() {
393
- return true;
394
- }
395
- isAPIDisabled() {
396
- return false;
397
- }
398
- isWorkerViewLicensed() {
399
- return true;
400
- }
401
- isProjectRoleAdminLicensed() {
402
- return true;
403
- }
404
- isProjectRoleEditorLicensed() {
405
- return true;
406
- }
407
- isProjectRoleViewerLicensed() {
408
- return true;
409
- }
410
- isCustomNpmRegistryEnabled() {
411
- return true;
412
- }
413
- isFoldersEnabled() {
414
- return true;
415
- }
416
- getCurrentEntitlements() {
417
- return [];
418
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
  getValue(feature) {
420
  if (feature === 'planName') return 'Enterprise';
421
  return constants_1.UNLIMITED_LICENSE_QUOTA;
422
  }
423
- getManagementJwt() {
424
- return '';
425
- }
426
- getMainPlan() {
427
- return undefined;
428
- }
429
- getConsumerId() {
430
- return 'Enterprise';
431
- }
432
- getUsersLimit() {
433
- return constants_1.UNLIMITED_LICENSE_QUOTA;
434
- }
435
- getTriggerLimit() {
436
- return constants_1.UNLIMITED_LICENSE_QUOTA;
437
- }
438
- getVariablesLimit() {
439
- return constants_1.UNLIMITED_LICENSE_QUOTA;
440
- }
441
- getAiCredits() {
442
- return constants_1.UNLIMITED_LICENSE_QUOTA;
443
- }
444
- getWorkflowHistoryPruneLimit() {
445
- return constants_1.DEFAULT_WORKFLOW_HISTORY_PRUNE_LIMIT;
446
- }
447
- getTeamProjectLimit() {
448
- return constants_1.UNLIMITED_LICENSE_QUOTA;
449
- }
450
- getPlanName() {
451
- return 'Enterprise';
452
- }
453
- getExpiryDate() {
454
- return new Date('9999-12-31');
455
- }
456
- getTerminationDate() {
457
- return new Date('9999-12-31');
458
- }
459
- getExpiringInDays() {
460
- return 36500;
461
- }
462
- getTerminatingInDays() {
463
- return 36500;
464
- }
465
- getInfo() {
466
- return 'Enterprise License (Unlimited) - Cracked by: keflag.';
467
- }
468
- isWithinUsersLimit() {
469
- return true;
470
- }
471
- enableAutoRenewals() {
472
- }
473
- disableAutoRenewals() {
474
- }
475
- onExpirySoon() {
476
- }
477
  };
478
  exports.License = License;
479
- __decorate([
480
- (0, decorators_1.OnPubSubEvent)('reload-license'),
481
- __metadata("design:type", Function),
482
- __metadata("design:paramtypes", []),
483
- __metadata("design:returntype", Promise)
484
- ], License.prototype, "reload", null);
485
- __decorate([
486
- (0, decorators_1.OnShutdown)(),
487
- __metadata("design:type", Function),
488
- __metadata("design:paramtypes", []),
489
- __metadata("design:returntype", Promise)
490
- ], License.prototype, "shutdown", null);
491
- __decorate([
492
- (0, decorators_1.OnLeaderTakeover)(),
493
- __metadata("design:type", Function),
494
- __metadata("design:paramtypes", []),
495
- __metadata("design:returntype", void 0)
496
- ], License.prototype, "enableAutoRenewals", null);
497
- __decorate([
498
- (0, decorators_1.OnLeaderStepdown)(),
499
- __metadata("design:type", Function),
500
- __metadata("design:paramtypes", []),
501
- __metadata("design:returntype", void 0)
502
- ], License.prototype, "disableAutoRenewals", null);
503
  exports.License = License = __decorate([
504
- (0, di_1.Service)(),
505
- __metadata("design:paramtypes", [backend_common_1.Logger,
506
- n8n_core_1.InstanceSettings,
507
- db_1.SettingsRepository,
508
- license_metrics_service_1.LicenseMetricsService,
509
- config_1.GlobalConfig])
510
  ], License);
511
  //# sourceMappingURL=license.js.map
512
  EOF
513
 
514
- # 3. 覆盖 frontend.service.js
515
- RUN cat > /usr/local/lib/node_modules/n8n/dist/services/frontend.service.js << 'EOF'
516
  "use strict";
517
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
518
- if (k2 === undefined) k2 = k;
519
- var desc = Object.getOwnPropertyDescriptor(m, k);
520
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
521
- desc = { enumerable: true, get: function() { return m[k]; } };
522
- }
523
- Object.defineProperty(o, k2, desc);
524
- }) : (function(o, m, k, k2) {
525
- if (k2 === undefined) k2 = k;
526
- o[k2] = m[k];
527
- }));
528
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
529
- Object.defineProperty(o, "default", { enumerable: true, value: v });
530
- }) : function(o, v) {
531
- o["default"] = v;
532
- });
533
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
534
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
535
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
536
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
537
- return c > 3 && r && Object.defineProperty(target, key, r), r;
538
- };
539
- var __importStar = (this && this.__importStar) || (function () {
540
- var ownKeys = function(o) {
541
- ownKeys = Object.getOwnPropertyNames || function (o) {
542
- var ar = [];
543
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
544
- return ar;
545
- };
546
- return ownKeys(o);
547
- };
548
- return function (mod) {
549
- if (mod && mod.__esModule) return mod;
550
- var result = {};
551
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
552
- __setModuleDefault(result, mod);
553
- return result;
554
- };
555
- })();
556
- var __metadata = (this && this.__metadata) || function (k, v) {
557
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
558
- };
559
- var __importDefault = (this && this.__importDefault) || function (mod) {
560
- return (mod && mod.__esModule) ? mod : { "default": mod };
561
  };
562
  Object.defineProperty(exports, "__esModule", { value: true });
563
  exports.FrontendService = void 0;
@@ -565,28 +215,7 @@ const backend_common_1 = require("@n8n/backend-common");
565
  const config_1 = require("@n8n/config");
566
  const constants_1 = require("@n8n/constants");
567
  const di_1 = require("@n8n/di");
568
- const fs_1 = require("fs");
569
- const promises_1 = require("fs/promises");
570
- const uniq_1 = __importDefault(require("lodash/uniq"));
571
  const n8n_core_1 = require("n8n-core");
572
- const path_1 = __importDefault(require("path"));
573
- const config_2 = __importDefault(require("../config"));
574
- const constants_2 = require("../constants");
575
- const credential_types_1 = require("../credential-types");
576
- const credentials_overwrites_1 = require("../credentials-overwrites");
577
- const license_1 = require("../license");
578
- const load_nodes_and_credentials_1 = require("../load-nodes-and-credentials");
579
- const mfa_service_1 = require("../mfa/mfa.service");
580
- const community_packages_config_1 = require("../modules/community-packages/community-packages.config");
581
- const public_api_1 = require("../public-api");
582
- const push_config_1 = require("../push/push.config");
583
- const ownership_service_1 = require("../services/ownership.service");
584
- const sso_helpers_1 = require("../sso.ee/sso-helpers");
585
- const email_1 = require("../user-management/email");
586
- const health_endpoint_util_1 = require("../utils/health-endpoint.util");
587
- const workflow_history_helper_1 = require("../workflows/workflow-history/workflow-history-helper");
588
- const ai_usage_service_1 = require("./ai-usage.service");
589
- const url_service_1 = require("./url.service");
590
  let FrontendService = class FrontendService {
591
  constructor(globalConfig, logger, loadNodesAndCredentials, credentialTypes, credentialsOverwrites, license, mailer, instanceSettings, urlService, securityConfig, pushConfig, binaryDataConfig, licenseState, moduleRegistry, mfaService, ownershipService, aiUsageService) {
592
  this.globalConfig = globalConfig;
@@ -606,492 +235,44 @@ let FrontendService = class FrontendService {
606
  this.mfaService = mfaService;
607
  this.ownershipService = ownershipService;
608
  this.aiUsageService = aiUsageService;
609
- loadNodesAndCredentials.addPostProcessor(async () => await this.generateTypes());
610
- void this.generateTypes();
611
- if (di_1.Container.get(community_packages_config_1.CommunityPackagesConfig).enabled) {
612
- void Promise.resolve().then(() => __importStar(require('../modules/community-packages/community-packages.service'))).then(({ CommunityPackagesService }) => {
613
- this.communityPackagesService = di_1.Container.get(CommunityPackagesService);
614
- });
615
- }
616
- }
617
- collectEnvFeatureFlags() {
618
- const envFeatureFlags = {};
619
- for (const [key, value] of Object.entries(process.env)) {
620
- if (key.startsWith('N8N_ENV_FEAT_') && value !== undefined) {
621
- envFeatureFlags[key] = value;
622
- }
623
- }
624
- return envFeatureFlags;
625
- }
626
- async getShowSetupOnFirstLoad() {
627
- const previewMode = process.env.N8N_PREVIEW_MODE === 'true';
628
- const hasInstanceOwner = await this.ownershipService.hasInstanceOwner();
629
- return previewMode ? false : !hasInstanceOwner;
630
- }
631
- async initSettings() {
632
- const instanceBaseUrl = this.urlService.getInstanceBaseUrl();
633
- const restEndpoint = this.globalConfig.endpoints.rest;
634
- const telemetrySettings = {
635
- enabled: this.globalConfig.diagnostics.enabled,
636
- };
637
- if (telemetrySettings.enabled) {
638
- const conf = this.globalConfig.diagnostics.frontendConfig;
639
- const [key, url] = conf.split(';');
640
- const proxy = `${instanceBaseUrl}/${restEndpoint}/telemetry/proxy`;
641
- const sourceConfig = `${instanceBaseUrl}/${restEndpoint}/telemetry/rudderstack`;
642
- if (!key || !url) {
643
- this.logger.warn('Diagnostics frontend config is invalid');
644
- telemetrySettings.enabled = false;
645
- }
646
- telemetrySettings.config = { key, url, proxy, sourceConfig };
647
- }
648
- const previewMode = process.env.N8N_PREVIEW_MODE === 'true';
649
- this.settings = {
650
- settingsMode: 'authenticated',
651
- inE2ETests: constants_2.inE2ETests,
652
- isDocker: this.instanceSettings.isDocker,
653
- databaseType: this.globalConfig.database.type,
654
- previewMode,
655
- endpointForm: this.globalConfig.endpoints.form,
656
- endpointFormTest: this.globalConfig.endpoints.formTest,
657
- endpointFormWaiting: this.globalConfig.endpoints.formWaiting,
658
- endpointMcp: this.globalConfig.endpoints.mcp,
659
- endpointMcpTest: this.globalConfig.endpoints.mcpTest,
660
- endpointWebhook: this.globalConfig.endpoints.webhook,
661
- endpointWebhookTest: this.globalConfig.endpoints.webhookTest,
662
- endpointWebhookWaiting: this.globalConfig.endpoints.webhookWaiting,
663
- endpointHealth: (0, health_endpoint_util_1.resolveFrontendHealthEndpointPath)(this.globalConfig),
664
- saveDataErrorExecution: this.globalConfig.executions.saveDataOnError,
665
- saveDataSuccessExecution: this.globalConfig.executions.saveDataOnSuccess,
666
- saveManualExecutions: this.globalConfig.executions.saveDataManualExecutions,
667
- saveExecutionProgress: this.globalConfig.executions.saveExecutionProgress,
668
- executionTimeout: this.globalConfig.executions.timeout,
669
- maxExecutionTimeout: this.globalConfig.executions.maxTimeout,
670
- workflowCallerPolicyDefaultOption: this.globalConfig.workflows.callerPolicyDefaultOption,
671
- timezone: this.globalConfig.generic.timezone,
672
- urlBaseWebhook: this.urlService.getWebhookBaseUrl(),
673
- urlBaseEditor: instanceBaseUrl,
674
- binaryDataMode: this.binaryDataConfig.mode,
675
- nodeJsVersion: process.version.replace(/^v/, ''),
676
- nodeEnv: process.env.NODE_ENV,
677
- versionCli: constants_2.N8N_VERSION,
678
- concurrency: this.globalConfig.executions.concurrency.productionLimit,
679
- authCookie: {
680
- secure: this.globalConfig.auth.cookie.secure,
681
- },
682
- releaseChannel: this.globalConfig.generic.releaseChannel,
683
- oauthCallbackUrls: {
684
- oauth1: `${instanceBaseUrl}/${restEndpoint}/oauth1-credential/callback`,
685
- oauth2: `${instanceBaseUrl}/${restEndpoint}/oauth2-credential/callback`,
686
- },
687
- versionNotifications: {
688
- enabled: this.globalConfig.versionNotifications.enabled,
689
- endpoint: this.globalConfig.versionNotifications.endpoint,
690
- whatsNewEnabled: this.globalConfig.versionNotifications.whatsNewEnabled,
691
- whatsNewEndpoint: this.globalConfig.versionNotifications.whatsNewEndpoint,
692
- infoUrl: this.globalConfig.versionNotifications.infoUrl,
693
- },
694
- dynamicBanners: {
695
- endpoint: this.globalConfig.dynamicBanners.endpoint,
696
- enabled: this.globalConfig.dynamicBanners.enabled && this.globalConfig.diagnostics.enabled,
697
- },
698
- instanceId: this.instanceSettings.instanceId,
699
- telemetry: telemetrySettings,
700
- posthog: {
701
- enabled: this.globalConfig.diagnostics.enabled,
702
- apiHost: this.globalConfig.diagnostics.posthogConfig.apiHost,
703
- apiKey: this.globalConfig.diagnostics.posthogConfig.apiKey,
704
- autocapture: false,
705
- disableSessionRecording: this.globalConfig.deployment.type !== 'cloud',
706
- proxy: `${instanceBaseUrl}/${restEndpoint}/ph`,
707
- debug: this.globalConfig.logging.level === 'debug',
708
- },
709
- personalizationSurveyEnabled: this.globalConfig.personalization.enabled && this.globalConfig.diagnostics.enabled,
710
- defaultLocale: this.globalConfig.defaultLocale,
711
- userManagement: {
712
- quota: this.license.getUsersLimit(),
713
- showSetupOnFirstLoad: await this.getShowSetupOnFirstLoad(),
714
- smtpSetup: this.mailer.isEmailSetUp,
715
- authenticationMethod: (0, sso_helpers_1.getCurrentAuthenticationMethod)(),
716
- },
717
- sso: {
718
- managedByEnv: this.globalConfig.instanceSettingsLoader.ssoManagedByEnv,
719
- saml: {
720
- loginEnabled: false,
721
- loginLabel: '',
722
- },
723
- ldap: {
724
- loginEnabled: false,
725
- loginLabel: '',
726
- },
727
- oidc: {
728
- loginEnabled: false,
729
- loginUrl: `${instanceBaseUrl}/${restEndpoint}/sso/oidc/login`,
730
- callbackUrl: `${instanceBaseUrl}/${restEndpoint}/sso/oidc/callback`,
731
- },
732
- },
733
- dataTables: {
734
- maxSize: this.globalConfig.dataTable.maxSize,
735
- },
736
- publicApi: {
737
- enabled: (0, public_api_1.isApiEnabled)(),
738
- latestVersion: 1,
739
- path: this.globalConfig.publicApi.path,
740
- swaggerUi: {
741
- enabled: !this.globalConfig.publicApi.swaggerUiDisabled,
742
- },
743
- },
744
- workflowTagsDisabled: this.globalConfig.tags.disabled,
745
- logLevel: this.globalConfig.logging.level,
746
- hiringBannerEnabled: this.globalConfig.hiringBanner.enabled,
747
- aiAssistant: {
748
- enabled: false,
749
- setup: false,
750
- },
751
- templates: {
752
- enabled: this.globalConfig.templates.enabled,
753
- host: this.globalConfig.templates.host,
754
- },
755
- executionMode: this.globalConfig.executions.mode,
756
- isMultiMain: this.instanceSettings.isMultiMain,
757
- pushBackend: this.pushConfig.backend,
758
- communityNodesEnabled: di_1.Container.get(community_packages_config_1.CommunityPackagesConfig).enabled,
759
- unverifiedCommunityNodesEnabled: di_1.Container.get(community_packages_config_1.CommunityPackagesConfig).unverifiedEnabled,
760
- deployment: {
761
- type: this.globalConfig.deployment.type,
762
- },
763
- allowedModules: {
764
- builtIn: process.env.NODE_FUNCTION_ALLOW_BUILTIN?.split(',') ?? undefined,
765
- external: process.env.NODE_FUNCTION_ALLOW_EXTERNAL?.split(',') ?? undefined,
766
- },
767
- enterprise: {
768
- sharing: false,
769
- ldap: false,
770
- saml: false,
771
- oidc: false,
772
- mfaEnforcement: false,
773
- logStreaming: false,
774
- advancedExecutionFilters: false,
775
- variables: false,
776
- sourceControl: false,
777
- auditLogs: false,
778
- externalSecrets: false,
779
- showNonProdBanner: false,
780
- debugInEditor: false,
781
- binaryDataS3: false,
782
- workerView: false,
783
- advancedPermissions: false,
784
- workflowDiffs: false,
785
- namedVersions: false,
786
- provisioning: false,
787
- projects: {
788
- team: {
789
- limit: 0,
790
- },
791
- },
792
- customRoles: false,
793
- personalSpacePolicy: false,
794
- dataRedaction: false,
795
- },
796
- mfa: {
797
- enabled: false,
798
- enforced: false,
799
- },
800
- hideUsagePage: this.globalConfig.hideUsagePage,
801
- license: {
802
- consumerId: 'unknown',
803
- environment: this.globalConfig.license.tenantId === 1 ? 'production' : 'staging',
804
- },
805
- variables: {
806
- limit: 0,
807
- },
808
- banners: {
809
- dismissed: [],
810
- },
811
- askAi: {
812
- enabled: false,
813
- },
814
- aiBuilder: {
815
- enabled: false,
816
- setup: false,
817
- },
818
- aiCredits: {
819
- enabled: false,
820
- credits: 0,
821
- setup: false,
822
- },
823
- ai: {
824
- allowSendingParameterValues: true,
825
- },
826
- workflowHistory: {
827
- pruneTime: (0, workflow_history_helper_1.getWorkflowHistoryPruneTime)(),
828
- licensePruneTime: (0, workflow_history_helper_1.getWorkflowHistoryLicensePruneTime)(),
829
- },
830
- pruning: {
831
- isEnabled: this.globalConfig.executions.pruneData,
832
- maxAge: this.globalConfig.executions.pruneDataMaxAge,
833
- maxCount: this.globalConfig.executions.pruneDataMaxCount,
834
- },
835
- security: {
836
- blockFileAccessToN8nFiles: this.securityConfig.blockFileAccessToN8nFiles,
837
- },
838
- easyAIWorkflowOnboarded: false,
839
- folders: {
840
- enabled: false,
841
- },
842
- evaluation: {
843
- quota: this.licenseState.getMaxWorkflowsWithEvaluations()
844
- },
845
- activeModules: this.moduleRegistry.getActiveModules(),
846
- canvasOnly: this.globalConfig.canvasOnly,
847
- envFeatureFlags: this.collectEnvFeatureFlags(),
848
- };
849
- }
850
- async generateTypes() {
851
- this.overwriteCredentialsProperties();
852
- const { credentials, nodes } = await this.loadNodesAndCredentials.collectTypes();
853
- const { staticCacheDir } = this.instanceSettings;
854
- await (0, promises_1.mkdir)(path_1.default.join(staticCacheDir, 'types'), { recursive: true });
855
- await this.writeStaticJSON('nodes', nodes);
856
- const nodeVersionIdentifiers = this.getNodeVersionIdentifiers(nodes);
857
- await this.writeStaticJSON('node-versions', nodeVersionIdentifiers);
858
- await this.writeStaticJSON('credentials', credentials);
859
  }
860
  async getSettings() {
861
- if (!this.settings) {
862
- await this.initSettings();
863
- }
864
- const restEndpoint = this.globalConfig.endpoints.rest;
865
- const instanceBaseUrl = this.urlService.getInstanceBaseUrl();
866
- this.settings.urlBaseWebhook = this.urlService.getWebhookBaseUrl();
867
- this.settings.urlBaseEditor = instanceBaseUrl;
868
- this.settings.oauthCallbackUrls = {
869
- oauth1: `${instanceBaseUrl}/${restEndpoint}/oauth1-credential/callback`,
870
- oauth2: `${instanceBaseUrl}/${restEndpoint}/oauth2-credential/callback`,
871
- };
872
- Object.assign(this.settings.userManagement, {
873
- quota: this.license.getUsersLimit(),
874
- authenticationMethod: (0, sso_helpers_1.getCurrentAuthenticationMethod)(),
875
- showSetupOnFirstLoad: await this.getShowSetupOnFirstLoad(),
876
- });
877
- let dismissedBanners = [];
878
- try {
879
- dismissedBanners = config_2.default.getEnv('ui.banners.dismissed') ?? [];
880
- }
881
- catch {
882
- }
883
- this.settings.banners.dismissed = dismissedBanners;
884
- try {
885
- this.settings.easyAIWorkflowOnboarded = config_2.default.getEnv('easyAIWorkflowOnboarded') ?? false;
886
- }
887
- catch {
888
- this.settings.easyAIWorkflowOnboarded = false;
889
- }
890
- try {
891
- this.settings.ai.allowSendingParameterValues = await this.aiUsageService.getAiUsageSettings();
892
- }
893
- catch {
894
- this.settings.ai.allowSendingParameterValues = true;
895
- }
896
-
897
- const isS3Selected = this.binaryDataConfig.mode === 's3';
898
- const isS3Available = this.binaryDataConfig.availableModes.includes('s3');
899
- const isS3Licensed = true;
900
- const isAiAssistantEnabled = true;
901
- const isAskAiEnabled = true;
902
- const isAiCreditsEnabled = true;
903
- const isAiBuilderEnabled = true;
904
-
905
- this.settings.license.planName = "Enterprise";
906
- this.settings.license.consumerId = "Enterprise";
907
-
908
- Object.assign(this.settings.enterprise, {
909
- sharing: true,
910
- logStreaming: true,
911
- ldap: true,
912
- saml: true,
913
- oidc: true,
914
- mfaEnforcement: true,
915
- provisioning: false,
916
- advancedExecutionFilters: true,
917
- variables: true,
918
- sourceControl: true,
919
- externalSecrets: true,
920
- showNonProdBanner: false,
921
- debugInEditor: true,
922
- binaryDataS3: isS3Available && isS3Selected && isS3Licensed,
923
- workerView: true,
924
- advancedPermissions: true,
925
- workflowDiffs: true,
926
- namedVersions: true,
927
- customRoles: true,
928
- personalSpacePolicy: true,
929
- dataRedaction: true,
930
- });
931
-
932
- if (true) {
933
- Object.assign(this.settings.sso.ldap, {
934
- loginLabel: this.globalConfig.sso.ldap.loginLabel,
935
- loginEnabled: this.globalConfig.sso.ldap.loginEnabled,
936
- });
937
- }
938
- if (true) {
939
- Object.assign(this.settings.sso.saml, {
940
- loginLabel: (0, sso_helpers_1.getSamlLoginLabel)(),
941
- loginEnabled: this.globalConfig.sso.saml.loginEnabled,
942
- });
943
- }
944
- if (true) {
945
- Object.assign(this.settings.sso.oidc, {
946
- loginEnabled: this.globalConfig.sso.oidc.loginEnabled,
947
- });
948
- }
949
- if (true) {
950
- this.settings.variables.limit = constants_1.UNLIMITED_LICENSE_QUOTA;
951
- }
952
- if (this.communityPackagesService) {
953
- this.settings.missingPackages = this.communityPackagesService.hasMissingPackages;
954
- }
955
- if (isAiAssistantEnabled) {
956
- this.settings.aiAssistant.enabled = true;
957
- this.settings.aiAssistant.setup = true;
958
- }
959
- if (isAskAiEnabled) {
960
- this.settings.askAi.enabled = true;
961
- }
962
- if (isAiCreditsEnabled) {
963
- this.settings.aiCredits.enabled = true;
964
- this.settings.aiCredits.credits = constants_1.UNLIMITED_LICENSE_QUOTA;
965
- this.settings.aiCredits.setup = true;
966
- }
967
- if (isAiBuilderEnabled) {
968
- this.settings.aiBuilder.enabled = true;
969
- this.settings.aiBuilder.setup = true;
970
- }
971
-
972
- this.settings.mfa.enabled = this.globalConfig.mfa.enabled;
973
- this.settings.mfa.enforced = true;
974
- this.settings.executionMode = this.globalConfig.executions.mode;
975
- this.settings.binaryDataMode = this.binaryDataConfig.mode;
976
- this.settings.enterprise.projects.team.limit = constants_1.UNLIMITED_LICENSE_QUOTA;
977
- this.settings.folders.enabled = true;
978
- this.settings.evaluation.quota = 99999;
979
- this.settings.envFeatureFlags = this.collectEnvFeatureFlags();
980
- return this.settings;
981
- }
982
- async getPublicSettings(includeMfaSettings) {
983
- const { defaultLocale, userManagement: { authenticationMethod, showSetupOnFirstLoad, smtpSetup }, sso: { saml: ssoSaml, ldap: ssoLdap, oidc: ssoOidc }, authCookie, previewMode, enterprise: { saml, ldap, oidc }, mfa, communityNodesEnabled, } = await this.getSettings();
984
- const publicSettings = {
985
- settingsMode: 'public',
986
- defaultLocale,
987
- userManagement: {
988
- authenticationMethod,
989
- showSetupOnFirstLoad,
990
- smtpSetup,
991
- },
992
- sso: {
993
- saml: {
994
- loginEnabled: ssoSaml.loginEnabled,
995
- },
996
- ldap: ssoLdap,
997
- oidc: {
998
- loginEnabled: ssoOidc.loginEnabled,
999
- loginUrl: ssoOidc.loginUrl,
1000
- },
1001
  },
1002
- authCookie,
1003
- previewMode,
1004
- enterprise: { saml: true, ldap: true, oidc: true },
1005
- communityNodesEnabled,
1006
  };
1007
- if (includeMfaSettings) {
1008
- publicSettings.mfa = mfa;
1009
- }
1010
- return publicSettings;
1011
- }
1012
- getModuleSettings() {
1013
- return Object.fromEntries(this.moduleRegistry.settings);
1014
- }
1015
- getNodeVersionIdentifiers(nodes) {
1016
- const identifiers = new Set();
1017
- for (const node of nodes) {
1018
- if (!node?.name || node.version === undefined)
1019
- continue;
1020
- const versions = Array.isArray(node.version) ? node.version : [node.version];
1021
- for (const version of versions) {
1022
- if (version === undefined)
1023
- continue;
1024
- identifiers.add(`${node.name}@${String(version)}`);
1025
- }
1026
- }
1027
- return Array.from(identifiers);
1028
- }
1029
- async writeStaticJSON(name, data) {
1030
- const { staticCacheDir } = this.instanceSettings;
1031
- const filePath = path_1.default.join(staticCacheDir, `types/${name}.json`);
1032
- const stream = (0, fs_1.createWriteStream)(filePath, 'utf-8');
1033
- return await new Promise((resolve, reject) => {
1034
- stream.on('error', reject);
1035
- stream.on('finish', resolve);
1036
- stream.write('[\n');
1037
- data.forEach((entry, index) => {
1038
- stream.write(JSON.stringify(entry));
1039
- if (index !== data.length - 1)
1040
- stream.write(',');
1041
- stream.write('\n');
1042
- });
1043
- stream.write(']\n');
1044
- stream.end();
1045
- });
1046
  }
1047
- overwriteCredentialsProperties() {
1048
- const { credentials } = this.loadNodesAndCredentials.types;
1049
- const credentialsOverwrites = this.credentialsOverwrites.getAll();
1050
- const { skipTypes } = this.globalConfig.credentials.overwrite;
1051
- for (const credential of credentials) {
1052
- delete credential.__overwrittenProperties;
1053
- delete credential.__skipManagedCreation;
1054
- const overwrittenProperties = [];
1055
- this.credentialTypes
1056
- .getParentTypes(credential.name)
1057
- .reverse()
1058
- .map((name) => credentialsOverwrites[name])
1059
- .forEach((overwrite) => {
1060
- if (overwrite)
1061
- overwrittenProperties.push(...Object.keys(overwrite));
1062
- });
1063
- if (credential.name in credentialsOverwrites) {
1064
- overwrittenProperties.push(...Object.keys(credentialsOverwrites[credential.name]));
1065
- }
1066
- if (overwrittenProperties.length) {
1067
- credential.__overwrittenProperties = (0, uniq_1.default)(overwrittenProperties);
1068
- }
1069
- if (skipTypes.includes(credential.name)) {
1070
- credential.__skipManagedCreation = true;
1071
- }
1072
- }
1073
  }
 
1074
  };
1075
  exports.FrontendService = FrontendService;
1076
  exports.FrontendService = FrontendService = __decorate([
1077
- (0, di_1.Service)(),
1078
- __metadata("design:paramtypes", [config_1.GlobalConfig,
1079
- backend_common_1.Logger,
1080
- load_nodes_and_credentials_1.LoadNodesAndCredentials,
1081
- credential_types_1.CredentialTypes,
1082
- credentials_overwrites_1.CredentialsOverwrites,
1083
- license_1.License,
1084
- email_1.UserManagementMailer,
1085
- n8n_core_1.InstanceSettings,
1086
- url_service_1.UrlService,
1087
- config_1.SecurityConfig,
1088
- push_config_1.PushConfig,
1089
- n8n_core_1.BinaryDataConfig,
1090
- backend_common_1.LicenseState,
1091
- backend_common_1.ModuleRegistry,
1092
- mfa_service_1.MfaService,
1093
- ownership_service_1.OwnershipService,
1094
- ai_usage_service_1.AiUsageService])
1095
  ], FrontendService);
1096
  //# sourceMappingURL=frontend.service.js.map
1097
  EOF
 
2
 
3
  USER root
4
 
5
+ FROM n8nio/n8n:latest
6
+
7
+ # 1. 修复版:license-state.js
8
  RUN cat > /usr/local/lib/node_modules/n8n/node_modules/@n8n/backend-common/dist/license-state.js <<'EOF'
9
  "use strict";
10
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
+ return c > 3 && r && Object.defineProperty(target, key, desc);
15
  };
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
  exports.LicenseState = void 0;
 
109
  };
110
  exports.LicenseState = LicenseState;
111
  exports.LicenseState = LicenseState = __decorate([
112
+ di_1.Service()
113
  ], LicenseState);
114
  //# sourceMappingURL=license-state.js.map
115
  EOF
116
 
117
+ # 2. 修复版:license.js
118
  RUN cat > /usr/local/lib/node_modules/n8n/dist/license.js <<'EOF'
119
  "use strict";
120
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
122
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
123
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
124
+ return c > 3 && r && Object.defineProperty(target, key, desc);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  };
126
  Object.defineProperty(exports, "__esModule", { value: true });
127
  exports.License = void 0;
 
129
  const config_1 = require("@n8n/config");
130
  const constants_1 = require("@n8n/constants");
131
  const db_1 = require("@n8n/db");
 
132
  const di_1 = require("@n8n/di");
 
 
 
 
 
133
  let License = class License {
134
  constructor(logger, instanceSettings, settingsRepository, licenseMetricsService, globalConfig) {
135
  this.logger = logger;
 
137
  this.settingsRepository = settingsRepository;
138
  this.licenseMetricsService = licenseMetricsService;
139
  this.globalConfig = globalConfig;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
+ async init() {}
142
+ async loadCertStr() { return ''; }
143
+ async saveCertStr(value) {}
144
+ onCertRefresh(refreshCallback) { return () => {}; }
145
+ async activate(activationKey, eulaUri, userEmail) {}
146
+ async reload() {}
147
+ async renew() {}
148
+ async clear() {}
149
+ async shutdown() {}
150
+ isLicensed(feature) { return true; }
151
+ isDynamicCredentialsEnabled() { return true; }
152
+ isSharingEnabled() { return true; }
153
+ isLogStreamingEnabled() { return true; }
154
+ isLdapEnabled() { return true; }
155
+ isSamlEnabled() { return true; }
156
+ isAiAssistantEnabled() { return true; }
157
+ isAskAiEnabled() { return true; }
158
+ isAiCreditsEnabled() { return true; }
159
+ isAdvancedExecutionFiltersEnabled() { return true; }
160
+ isAdvancedPermissionsLicensed() { return true; }
161
+ isDebugInEditorLicensed() { return true; }
162
+ isBinaryDataS3Licensed() { return true; }
163
+ isMultiMainLicensed() { return true; }
164
+ isVariablesEnabled() { return true; }
165
+ isSourceControlLicensed() { return true; }
166
+ isExternalSecretsEnabled() { return true; }
167
+ isAPIDisabled() { return false; }
168
+ isWorkerViewLicensed() { return true; }
169
+ isProjectRoleAdminLicensed() { return true; }
170
+ isProjectRoleEditorLicensed() { return true; }
171
+ isProjectRoleViewerLicensed() { return true; }
172
+ isCustomNpmRegistryEnabled() { return true; }
173
+ isFoldersEnabled() { return true; }
174
+ getCurrentEntitlements() { return []; }
175
  getValue(feature) {
176
  if (feature === 'planName') return 'Enterprise';
177
  return constants_1.UNLIMITED_LICENSE_QUOTA;
178
  }
179
+ getManagementJwt() { return ''; }
180
+ getMainPlan() { return undefined; }
181
+ getConsumerId() { return 'Enterprise'; }
182
+ getUsersLimit() { return constants_1.UNLIMITED_LICENSE_QUOTA; }
183
+ getTriggerLimit() { return constants_1.UNLIMITED_LICENSE_QUOTA; }
184
+ getVariablesLimit() { return constants_1.UNLIMITED_LICENSE_QUOTA; }
185
+ getAiCredits() { return constants_1.UNLIMITED_LICENSE_QUOTA; }
186
+ getWorkflowHistoryPruneLimit() { return 1000; }
187
+ getTeamProjectLimit() { return constants_1.UNLIMITED_LICENSE_QUOTA; }
188
+ getPlanName() { return 'Enterprise'; }
189
+ getExpiryDate() { return new Date('9999-12-31'); }
190
+ getTerminationDate() { return new Date('9999-12-31'); }
191
+ getExpiringInDays() { return 36500; }
192
+ getTerminatingInDays() { return 36500; }
193
+ getInfo() { return 'Enterprise Unlimited'; }
194
+ isWithinUsersLimit() { return true; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  };
196
  exports.License = License;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  exports.License = License = __decorate([
198
+ di_1.Service()
 
 
 
 
 
199
  ], License);
200
  //# sourceMappingURL=license.js.map
201
  EOF
202
 
203
+ # 3. 修复版:frontend.service.js(无语法错误版)
204
+ RUN cat > /usr/local/lib/node_modules/n8n/dist/services/frontend.service.js <<'EOF'
205
  "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
207
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
208
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
209
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
210
+ return c > 3 && r && Object.defineProperty(target, key, desc);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  };
212
  Object.defineProperty(exports, "__esModule", { value: true });
213
  exports.FrontendService = void 0;
 
215
  const config_1 = require("@n8n/config");
216
  const constants_1 = require("@n8n/constants");
217
  const di_1 = require("@n8n/di");
 
 
 
218
  const n8n_core_1 = require("n8n-core");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  let FrontendService = class FrontendService {
220
  constructor(globalConfig, logger, loadNodesAndCredentials, credentialTypes, credentialsOverwrites, license, mailer, instanceSettings, urlService, securityConfig, pushConfig, binaryDataConfig, licenseState, moduleRegistry, mfaService, ownershipService, aiUsageService) {
221
  this.globalConfig = globalConfig;
 
235
  this.mfaService = mfaService;
236
  this.ownershipService = ownershipService;
237
  this.aiUsageService = aiUsageService;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  }
239
  async getSettings() {
240
+ return {
241
+ isDocker: true,
242
+ versionCli: "1.0.0",
243
+ enterprise: {
244
+ sharing: true,
245
+ ldap: true,
246
+ saml: true,
247
+ oidc: true,
248
+ logStreaming: true,
249
+ advancedExecutionFilters: true,
250
+ variables: true,
251
+ sourceControl: true,
252
+ externalSecrets: true,
253
+ debugInEditor: true,
254
+ binaryDataS3: true,
255
+ workerView: true,
256
+ advancedPermissions: true,
257
+ workflowDiffs: true,
258
+ customRoles: true,
259
+ personalSpacePolicy: true,
260
+ dataRedaction: true,
261
+ projects: { team: { limit: -1 } },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  },
263
+ license: { planName: "Enterprise", consumerId: "Enterprise" },
264
+ variables: { limit: constants_1.UNLIMITED_LICENSE_QUOTA },
265
+ folders: { enabled: true },
 
266
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  }
268
+ async getPublicSettings() {
269
+ return { settingsMode: "public" };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  }
271
+ getModuleSettings() { return {}; }
272
  };
273
  exports.FrontendService = FrontendService;
274
  exports.FrontendService = FrontendService = __decorate([
275
+ di_1.Service()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  ], FrontendService);
277
  //# sourceMappingURL=frontend.service.js.map
278
  EOF