Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/Command/User/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function configure(): void {
'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',
Expand Down Expand Up @@ -91,10 +91,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int

// 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')) {
Expand Down
4 changes: 2 additions & 2 deletions core/Command/User/AuthTokens/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

if ($input->getOption('password-from-env')) {
$password = getenv('NC_PASS') ?? getenv('OC_PASS');
$password = getenv('NC_PASS') ?: getenv('OC_PASS');
if (!$password) {
$output->writeln('<error>--password-from-env given, but NC_PASS is empty!</error>');
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
return 1;
}
} elseif ($input->isInteractive()) {
Expand Down
6 changes: 3 additions & 3 deletions core/Command/User/ResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function configure() {
'password-from-env',
null,
InputOption::VALUE_NONE,
'read password from environment variable OC_PASS'
'read password from environment variable NC_PASS/OC_PASS'
)
;
}
Expand All @@ -56,9 +56,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

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()) {
Expand Down
Loading