@@ -40,7 +40,8 @@ const main = async (args: Args): Promise<void> => {
4040 }
4141
4242 const auth = args . auth || AuthType . Password
43- const originalPassword = auth === AuthType . Password && ( process . env . PASSWORD || ( await generatePassword ( ) ) )
43+ const generatedPassword = ( args . password || process . env . PASSWORD ) !== ""
44+ const password = auth === AuthType . Password && ( args . password || process . env . PASSWORD || ( await generatePassword ( ) ) )
4445
4546 let host = args . host
4647 let port = args . port
@@ -55,7 +56,7 @@ const main = async (args: Args): Promise<void> => {
5556 auth,
5657 commit,
5758 host : host || ( args . auth === AuthType . Password && args . cert !== undefined ? "0.0.0.0" : "localhost" ) ,
58- password : originalPassword ? hash ( originalPassword ) : undefined ,
59+ password : password ? hash ( password ) : undefined ,
5960 port : port !== undefined ? port : process . env . PORT ? parseInt ( process . env . PORT , 10 ) : 8080 ,
6061 proxyDomains : args [ "proxy-domain" ] ,
6162 socket : args . socket ,
@@ -86,9 +87,9 @@ const main = async (args: Args): Promise<void> => {
8687 const serverAddress = await httpServer . listen ( )
8788 logger . info ( `HTTP server listening on ${ serverAddress } ` )
8889
89- if ( auth === AuthType . Password && ! process . env . PASSWORD ) {
90- logger . info ( ` - Password is ${ originalPassword } ` )
91- logger . info ( " - To use your own password set the PASSWORD environment variable " )
90+ if ( auth === AuthType . Password && generatedPassword ) {
91+ logger . info ( ` - Password is ${ password } ` )
92+ logger . info ( " - To use your own password set it in the config file with the password key or use $PASSWORD " )
9293 if ( ! args . auth ) {
9394 logger . info ( " - To disable use `--auth none`" )
9495 }
0 commit comments