|
|
@@ -26,9 +26,9 @@ $dBparams = array(
|
|
|
|
|
|
$options = getopt('', array_merge($params, $dBparams));
|
|
|
|
|
|
-if (empty($options['default_user']) || empty($options['auth_type'])) {
|
|
|
- fail('Usage: ' . basename(__FILE__) . " --default_user admin --auth_type form" .
|
|
|
- " ( --environment production --base_url https://rss.example.net/" .
|
|
|
+if (empty($options['default_user'])) {
|
|
|
+ fail('Usage: ' . basename(__FILE__) . " --default_user admin ( --auth_type form" .
|
|
|
+ " --environment production --base_url https://rss.example.net/" .
|
|
|
" --title FreshRSS --allow_anonymous --api_enabled" .
|
|
|
" --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123" .
|
|
|
" --db-base freshrss --db-prefix freshrss )");
|
|
|
@@ -51,7 +51,7 @@ if (!ctype_alnum($options['default_user'])) {
|
|
|
fail('FreshRSS invalid default username (must be ASCII alphanumeric): ' . $options['default_user']);
|
|
|
}
|
|
|
|
|
|
-if (!in_array($options['auth_type'], array('form', 'http_auth', 'none'))) {
|
|
|
+if (isset($options['auth_type']) && !in_array($options['auth_type'], array('form', 'http_auth', 'none'))) {
|
|
|
fail('FreshRSS invalid authentication method (auth_type must be one of { form, http_auth, none }: ' . $options['auth_type']);
|
|
|
}
|
|
|
|
|
|
@@ -86,11 +86,11 @@ if (file_put_contents(join_path(DATA_PATH, 'config.php'), "<?php\n return " . va
|
|
|
$config['db']['default_user'] = $config['default_user'];
|
|
|
if (!checkDb($config['db'])) {
|
|
|
@unlink(join_path(DATA_PATH, 'config.php'));
|
|
|
- fail('FreshRSS database error: ' . (empty($config['db']['bd_error']) ? 'Unknown error' : $config['db']['bd_error']));
|
|
|
+ fail('FreshRSS database error: ' . (empty($config['db']['error']) ? 'Unknown error' : $config['db']['error']));
|
|
|
}
|
|
|
|
|
|
echo '• Remember to create the default user: ', $config['default_user'] , "\n",
|
|
|
- "\t", './cli/create-user.php --user ', $config['default_user'] , " --password 'password' --more-options\n";
|
|
|
+ "\t", './cli/create-user.php --user ', $config['default_user'], " --password 'password' --more-options\n";
|
|
|
|
|
|
accessRights();
|
|
|
|