mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Use WebCrypto to generate all random numbers and strings (#9786)
This commit is contained in:
committed by
GitHub
parent
cfc4db00e3
commit
65c5609ab5
@@ -8,7 +8,7 @@ import { createReadStream, createWriteStream, existsSync } from 'fs';
|
||||
import { pipeline } from 'stream/promises';
|
||||
import replaceStream from 'replacestream';
|
||||
import glob from 'fast-glob';
|
||||
import { jsonParse } from 'n8n-workflow';
|
||||
import { jsonParse, randomString } from 'n8n-workflow';
|
||||
|
||||
import config from '@/config';
|
||||
import { ActiveExecutions } from '@/ActiveExecutions';
|
||||
@@ -265,12 +265,7 @@ export class Start extends BaseCommand {
|
||||
|
||||
if (tunnelSubdomain === '') {
|
||||
// When no tunnel subdomain did exist yet create a new random one
|
||||
const availableCharacters = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
tunnelSubdomain = Array.from({ length: 24 })
|
||||
.map(() =>
|
||||
availableCharacters.charAt(Math.floor(Math.random() * availableCharacters.length)),
|
||||
)
|
||||
.join('');
|
||||
tunnelSubdomain = randomString(24).toLowerCase();
|
||||
|
||||
this.instanceSettings.update({ tunnelSubdomain });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user