From 63f7c57b4e6579cfd5581486531d505c4e38f924 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 4 Mar 2019 11:46:34 -0600 Subject: [PATCH] Randomly generate password --- packages/server/src/cli.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/server/src/cli.ts b/packages/server/src/cli.ts index c7b5d14b..0024380e 100644 --- a/packages/server/src/cli.ts +++ b/packages/server/src/cli.ts @@ -132,7 +132,14 @@ export class Entry extends Command { } }); - const password = "023450wf0951"; + const passwordLength = 12; + const possible = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + const chars = []; + for (let i = 0; i < passwordLength; i++) { + chars.push(possible[Math.floor(Math.random() * possible.length)]); + } + const password = chars.join(""); + const hasCustomHttps = certData && certKeyData; const app = await createApp({ allowHttp: flags["allow-http"],