diff --git a/core/Command/User/Add.php b/core/Command/User/Add.php index 033d2bdc9a2d3..4de4e247991b1 100644 --- a/core/Command/User/Add.php +++ b/core/Command/User/Add.php @@ -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', @@ -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('--password-from-env given, but OC_PASS is empty!'); + $output->writeln('--password-from-env given, but NC_PASS/OC_PASS is empty!'); return 1; } } elseif ($input->getOption('generate-password')) { diff --git a/core/Command/User/AuthTokens/Add.php b/core/Command/User/AuthTokens/Add.php index 43386b7709a94..e222b8da9d3a9 100644 --- a/core/Command/User/AuthTokens/Add.php +++ b/core/Command/User/AuthTokens/Add.php @@ -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('--password-from-env given, but NC_PASS is empty!'); + $output->writeln('--password-from-env given, but NC_PASS/OC_PASS is empty!'); return 1; } } elseif ($input->isInteractive()) { diff --git a/core/Command/User/ResetPassword.php b/core/Command/User/ResetPassword.php index 2f18c3d473e45..0e8b132577014 100644 --- a/core/Command/User/ResetPassword.php +++ b/core/Command/User/ResetPassword.php @@ -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' ) ; } @@ -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('--password-from-env given, but OC_PASS is empty!'); + $output->writeln('--password-from-env given, but NC_PASS/OC_PASS is empty!'); return 1; } } elseif ($input->isInteractive()) {