From 55bfeab20817fd489046b0cdd4242a54592d11f0 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 18 Apr 2019 11:10:55 -0500 Subject: [PATCH] Deprecate password flag in favor of an environment variable --- packages/server/src/cli.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/server/src/cli.ts b/packages/server/src/cli.ts index 89bb918e..118ddb5a 100644 --- a/packages/server/src/cli.ts +++ b/packages/server/src/cli.ts @@ -28,7 +28,7 @@ commander.version(process.env.VERSION || "development") .option("-p, --port ", "Port to bind on.", parseInt(process.env.PORT!, 10) || 8443) .option("-N, --no-auth", "Start without requiring authentication.", undefined) .option("-H, --allow-http", "Allow http connections.", false) - .option("-P, --password ", "Specify a password for authentication.") + .option("-P, --password ", "DEPRECATED: Use the PASSWORD environment variable instead. Specify a password for authentication.") .option("--disable-telemetry", "Disables ALL telemetry.", false) .option("--install-extension ", "Install an extension by its ID.") .option("--bootstrap-fork ", "Used for development. Never set.") @@ -209,7 +209,11 @@ const bold = (text: string | number): string | number => { } }); - let password = options.password; + if (options.password) { + logger.warn('"--password" is deprecated. Use the PASSWORD environment variable instead.'); + } + + let password = options.password || process.env.PASSWORD; if (!password) { // Generate a random password with a length of 24. const buffer = Buffer.alloc(12); -- GitLab