@@ -40,7 +40,8 @@ const main = async (args: Args): Promise<void> => {
40
40
}
41
41
42
42
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 ( ) ) )
44
45
45
46
let host = args . host
46
47
let port = args . port
@@ -55,7 +56,7 @@ const main = async (args: Args): Promise<void> => {
55
56
auth,
56
57
commit,
57
58
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 ,
59
60
port : port !== undefined ? port : process . env . PORT ? parseInt ( process . env . PORT , 10 ) : 8080 ,
60
61
proxyDomains : args [ "proxy-domain" ] ,
61
62
socket : args . socket ,
@@ -86,9 +87,9 @@ const main = async (args: Args): Promise<void> => {
86
87
const serverAddress = await httpServer . listen ( )
87
88
logger . info ( `HTTP server listening on ${ serverAddress } ` )
88
89
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 " )
92
93
if ( ! args . auth ) {
93
94
logger . info ( " - To disable use `--auth none`" )
94
95
}
0 commit comments