Skip to content

Commit ed38689

Browse files
committed
fix(core): Make --password-from-env work with NC_PASS everywhere
Signed-off-by: provokateurin <[email protected]>
1 parent b95701d commit ed38689

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

core/Command/User/Add.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function configure(): void {
5252
'password-from-env',
5353
null,
5454
InputOption::VALUE_NONE,
55-
'read password from environment variable OC_PASS'
55+
'read password from environment variable NC_PASS/OC_PASS'
5656
)
5757
->addOption(
5858
'generate-password',
@@ -91,10 +91,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9191

9292
// Setup password.
9393
if ($input->getOption('password-from-env')) {
94-
$password = getenv('OC_PASS');
94+
$password = getenv('NC_PASS') ?: getenv('OC_PASS');
9595

9696
if (!$password) {
97-
$output->writeln('<error>--password-from-env given, but OC_PASS is empty!</error>');
97+
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
9898
return 1;
9999
}
100100
} elseif ($input->getOption('generate-password')) {

core/Command/User/ResetPassword.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function configure() {
4141
'password-from-env',
4242
null,
4343
InputOption::VALUE_NONE,
44-
'read password from environment variable OC_PASS'
44+
'read password from environment variable NC_PASS/OC_PASS'
4545
)
4646
;
4747
}
@@ -56,9 +56,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5656
}
5757

5858
if ($input->getOption('password-from-env')) {
59-
$password = getenv('OC_PASS');
59+
$password = getenv('NC_PASS') ?: getenv('OC_PASS');
6060
if (!$password) {
61-
$output->writeln('<error>--password-from-env given, but OC_PASS is empty!</error>');
61+
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
6262
return 1;
6363
}
6464
} elseif ($input->isInteractive()) {

0 commit comments

Comments
 (0)