mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 18:11:02 -04:00
fix(core): Make --password-from-env work with NC_PASS everywhere
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
b95701d4c6
commit
ed3868932f
2 changed files with 6 additions and 6 deletions
|
|
@ -52,7 +52,7 @@ class Add extends Command {
|
|||
'password-from-env',
|
||||
null,
|
||||
InputOption::VALUE_NONE,
|
||||
'read password from environment variable OC_PASS'
|
||||
'read password from environment variable NC_PASS/OC_PASS'
|
||||
)
|
||||
->addOption(
|
||||
'generate-password',
|
||||
|
|
@ -91,10 +91,10 @@ class Add extends Command {
|
|||
|
||||
// Setup password.
|
||||
if ($input->getOption('password-from-env')) {
|
||||
$password = getenv('OC_PASS');
|
||||
$password = getenv('NC_PASS') ?: getenv('OC_PASS');
|
||||
|
||||
if (!$password) {
|
||||
$output->writeln('<error>--password-from-env given, but OC_PASS is empty!</error>');
|
||||
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
|
||||
return 1;
|
||||
}
|
||||
} elseif ($input->getOption('generate-password')) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class ResetPassword extends Base {
|
|||
'password-from-env',
|
||||
null,
|
||||
InputOption::VALUE_NONE,
|
||||
'read password from environment variable OC_PASS'
|
||||
'read password from environment variable NC_PASS/OC_PASS'
|
||||
)
|
||||
;
|
||||
}
|
||||
|
|
@ -56,9 +56,9 @@ class ResetPassword extends Base {
|
|||
}
|
||||
|
||||
if ($input->getOption('password-from-env')) {
|
||||
$password = getenv('OC_PASS');
|
||||
$password = getenv('NC_PASS') ?: getenv('OC_PASS');
|
||||
if (!$password) {
|
||||
$output->writeln('<error>--password-from-env given, but OC_PASS is empty!</error>');
|
||||
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
|
||||
return 1;
|
||||
}
|
||||
} elseif ($input->isInteractive()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue