From 1fc3054c2f85478df53b19365c1b0ebc46c372af Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Fri, 24 Feb 2017 07:54:31 +0100 Subject: Added cli tool to reconfigure FreshRSS --- cli/reconfigure.php | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 cli/reconfigure.php (limited to 'cli') diff --git a/cli/reconfigure.php b/cli/reconfigure.php new file mode 100755 index 000000000..5294dd2df --- /dev/null +++ b/cli/reconfigure.php @@ -0,0 +1,58 @@ +#!/usr/bin/php +$param = $options[$param] === false ? true : $options[$param]; + } +} +$db = $config->db; +foreach ($dBparams as $dBparam) { + $dBparam = rtrim($dBparam, ':'); + if (isset($options[$dBparam])) { + $param = substr($dBparam, strlen('db-')); + $db[$param] = $options[$dBparam]; + } +} +$config->db = $db; + +if (!ctype_alnum($config->default_user)) { + fail('FreshRSS invalid default username (must be ASCII alphanumeric): ' . $config->default_user); +} + +if (isset($config->auth_type) && !in_array($config->auth_type, array('form', 'http_auth', 'none'))) { + fail('FreshRSS invalid authentication method (auth_type must be one of { form, http_auth, none }: ' . $config->auth_type); +} + +$config->save(); + +done(); -- cgit v1.2.3