Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix(core): Make --password-from-env work with NC_PASS everywhere
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin authored and backportbot[bot] committed Jun 20, 2025
commit 6308f3c3e8145a4961a3d21a3e038ceaf3fa90c5
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
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