Fix CLI install regressions (#6214)

* Fix CLI install with prefix
It was not possible to pass a blank prefix

* Fix regression EXIT_CODE_ALREADY_EXISTS
The dedicated exit code was not sent anymore when a user already exists
This commit is contained in:
Alexandre Alapetite 2024-03-19 13:42:12 +01:00 committed by GitHub
parent 6bd6494ad4
commit b5445e1e56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 4 deletions

View File

@ -352,8 +352,8 @@ services:
# So if changes are made (or in .env file), first delete the service and volumes.
# All the --db-* parameters can be omitted if using built-in SQLite database.
FRESHRSS_INSTALL: |-
--api_enabled
--base_url ${BASE_URL}
--api-enabled
--base-url ${BASE_URL}
--db-base ${DB_BASE}
--db-host ${DB_HOST}
--db-password ${DB_PASSWORD}
@ -362,7 +362,7 @@ services:
--default_user admin
--language en
FRESHRSS_USER: |-
--api_password ${ADMIN_API_PASSWORD}
--api-password ${ADMIN_API_PASSWORD}
--email ${ADMIN_EMAIL}
--language en
--password ${ADMIN_PASSWORD}

View File

@ -58,6 +58,10 @@ if (!empty($cliOptions->errors)) {
$username = $cliOptions->user;
if (preg_grep("/^$username$/i", listUsers())) {
fail('FreshRSS warning: username already exists “' . $username . '”', EXIT_CODE_ALREADY_EXISTS);
}
echo 'FreshRSS creating user “', $username, "”…\n";
$values = [

View File

@ -132,7 +132,7 @@ if ((!empty($config['base_url'])) && is_string($config['base_url']) && Minz_Requ
$config['pubsubhubbub_enabled'] = true;
}
$config['db'] = array_merge($config['db'], array_filter($dbValues));
$config['db'] = array_merge($config['db'], array_filter($dbValues, static fn($value) => $value !== null));
performRequirementCheck($config['db']['type']);