File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ OPTIONS
4848 -v, --version show CLI version
4949 --cert=cert
5050 --cert-key=cert-key
51+ --password=password
5152 --help show CLI help
5253 ```
5354
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export class Entry extends Command {
2626 version : flags . version ( { char : "v" } ) ,
2727 "no-auth" : flags . boolean ( { default : false } ) ,
2828 "allow-http" : flags . boolean ( { default : false } ) ,
29+ password : flags . string ( ) ,
2930
3031 // Dev flags
3132 "bootstrap-fork" : flags . string ( { hidden : true } ) ,
@@ -132,13 +133,17 @@ export class Entry extends Command {
132133 }
133134 } ) ;
134135
135- const passwordLength = 12 ;
136- const possible = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ;
137- const chars = [ ] ;
138- for ( let i = 0 ; i < passwordLength ; i ++ ) {
139- chars . push ( possible [ Math . floor ( Math . random ( ) * possible . length ) ] ) ;
136+ let password = flags [ "password" ] ;
137+ if ( ! password ) {
138+ // Generate a random password
139+ const passwordLength = 12 ;
140+ const possible = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ;
141+ const chars = [ ] ;
142+ for ( let i = 0 ; i < passwordLength ; i ++ ) {
143+ chars . push ( possible [ Math . floor ( Math . random ( ) * possible . length ) ] ) ;
144+ }
145+ password = chars . join ( "" ) ;
140146 }
141- const password = chars . join ( "" ) ;
142147
143148 const hasCustomHttps = certData && certKeyData ;
144149 const app = await createApp ( {
You can’t perform that action at this time.
0 commit comments