File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ OPTIONS
48
48
-v, --version show CLI version
49
49
--cert=cert
50
50
--cert-key=cert-key
51
+ --password=password
51
52
--help show CLI help
52
53
```
53
54
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export class Entry extends Command {
26
26
version : flags . version ( { char : "v" } ) ,
27
27
"no-auth" : flags . boolean ( { default : false } ) ,
28
28
"allow-http" : flags . boolean ( { default : false } ) ,
29
+ password : flags . string ( ) ,
29
30
30
31
// Dev flags
31
32
"bootstrap-fork" : flags . string ( { hidden : true } ) ,
@@ -132,13 +133,17 @@ export class Entry extends Command {
132
133
}
133
134
} ) ;
134
135
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 ( "" ) ;
140
146
}
141
- const password = chars . join ( "" ) ;
142
147
143
148
const hasCustomHttps = certData && certKeyData ;
144
149
const app = await createApp ( {
You can’t perform that action at this time.
0 commit comments