File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -170,16 +170,22 @@ public function handle(): int
170
170
protected function populateData (): array
171
171
{
172
172
173
+ /* Do not use laravel's `env()` because it reads the .env file.
174
+ * Instead explicitly require the variable to be set from the OS or the SAPI to avoid someone accidentally leaving it set in the .env file.
175
+ */
176
+ $ envPassword = getenv ('IXP_SETUP_ADMIN_PASSWORD ' );
177
+ putenv ('IXP_SETUP_ADMIN_PASSWORD ' ); // Unset the variable as soon as we read it to reduce the risk of it leaking.
178
+
173
179
$ data = [
174
180
"asn " => $ this ->option ('asn ' ) ?? $ this ->ask ('Enter the ASN of your IXP ' ),
175
181
"company_name " => $ this ->option ('company-name ' ) ?? $ this ->ask ('Enter the name of your company ' ),
176
182
"infrastructure " => $ this ->option ('infrastructure ' ) ?? $ this ->ask ('Enter the name of your primary infrastructure ' ),
177
183
"name " => $ this ->option ('name ' ) ?? $ this ->ask ('Enter the full name(s) of the admin user ' ),
178
184
"username " => $ this ->option ('username ' ) ?? $ this ->ask ('Enter the username of the admin user ' ),
179
185
"email " => $ this ->option ('email ' ) ?? $ this ->ask ('Enter the email of the admin user ' ),
180
- "password " => $ this ->secret ('Enter the password of the admin user ' ),
186
+ "password " => $ envPassword === false ? $ this ->secret ('Enter the password of the admin user ' ) : $ envPassword ,
181
187
];
182
- if ($ data ['password ' ] !== $ this ->secret ('Confirm the password of the admin user ' )) {
188
+ if ($ envPassword === false && $ data ['password ' ] !== $ this ->secret ('Confirm the password of the admin user ' )) {
183
189
$ this ->error ('Passwords do not match. Exiting. ' );
184
190
exit (1 );
185
191
}
You can’t perform that action at this time.
0 commit comments