From 09787cfd7a68e994f248c0cad0ebe5ae68b7aaf3 Mon Sep 17 00:00:00 2001 From: Seokseong Jeon Date: Wed, 3 May 2017 22:52:31 +0900 Subject: actualizeFeed return number of new articles as 3rd --- cli/actualize-user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli') diff --git a/cli/actualize-user.php b/cli/actualize-user.php index 29d51753a..932c6975c 100755 --- a/cli/actualize-user.php +++ b/cli/actualize-user.php @@ -14,9 +14,9 @@ $username = cliInitUser($options['user']); fwrite(STDERR, 'FreshRSS actualizing user “' . $username . "”…\n"); -list($nbUpdatedFeeds, $feed) = FreshRSS_feed_Controller::actualizeFeed(0, '', true); +list($nbUpdatedFeeds, $feed, $nbNewArticles) = FreshRSS_feed_Controller::actualizeFeed(0, '', true); -echo "FreshRSS actualized $nbUpdatedFeeds feeds for $username\n"; +echo "FreshRSS actualized $nbUpdatedFeeds feeds for $username ($nbNewArticles new articles)\n"; invalidateHttpCache($username); -- cgit v1.2.3 From af8960b8b3be3c78573d0319a8a537083fae2d4d Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 12 May 2017 23:33:58 +0200 Subject: Move default configuration files https://github.com/FreshRSS/FreshRSS/issues/1531 --- README.fr.md | 2 +- README.md | 2 +- app/FreshRSS.php | 2 +- app/install.php | 4 +- cli/_cli.php | 2 +- config-user.default.php | 75 ++++++++++++++++++++ config.default.php | 152 ++++++++++++++++++++++++++++++++++++++++ data/config.default.php | 152 ---------------------------------------- data/users/_/config.default.php | 75 -------------------- lib/Minz/FrontController.php | 2 +- lib/lib_install.php | 4 +- lib/lib_rss.php | 2 +- p/api/greader.php | 2 +- p/api/index.php | 2 +- p/api/pshb.php | 6 +- 15 files changed, 242 insertions(+), 242 deletions(-) create mode 100644 config-user.default.php create mode 100644 config.default.php delete mode 100644 data/config.default.php delete mode 100644 data/users/_/config.default.php (limited to 'cli') diff --git a/README.fr.md b/README.fr.md index 5e78ad803..b7a28fd91 100644 --- a/README.fr.md +++ b/README.fr.md @@ -52,7 +52,7 @@ Nous sommes une communauté amicale. 4. Accédez à FreshRSS à travers votre navigateur Web et suivez les instructions d’installation * ou utilisez [l’interface en ligne de commande](./cli/README.md) 5. Tout devrait fonctionner :) En cas de problème, n’hésitez pas à [nous contacter](https://github.com/FreshRSS/FreshRSS/issues). -6. Des paramètres de configuration avancée peuvent être accédés depuis [config.php](./data/config.default.php). +6. Des paramètres de configuration avancée peuvent être vues dans [config.default.php](./config.default.php) et modifiées dans `data/config.php`. ## Installation automatisée * [![DP deploy](https://raw.githubusercontent.com/DFabric/DPlatform-ShellCore/gh-pages/img/deploy.png)](https://dfabric.github.io/DPlatform-ShellCore) diff --git a/README.md b/README.md index 4c50acdd7..8e0d8bac9 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ We are a friendly community. 4. Access FreshRSS with your browser and follow the installation process * or use the [Command-Line Interface](./cli/README.md) 5. Everything should be working :) If you encounter any problem, feel free [contact us](https://github.com/FreshRSS/FreshRSS/issues). -6. Advanced configuration settings can be seen in [config.php](./data/config.default.php). +6. Advanced configuration settings can be seen in [config.default.php](./config.default.php) and modified in `data/config.php`. ## Automated install * [![Install on Cloudron](https://cloudron.io/img/button.svg)](https://cloudron.io/button.html?app=org.freshrss.cloudronapp) diff --git a/app/FreshRSS.php b/app/FreshRSS.php index e4caf23d1..563393c90 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -41,7 +41,7 @@ class FreshRSS extends Minz_FrontController { $current_user = Minz_Session::param('currentUser', '_'); Minz_Configuration::register('user', join_path(USERS_PATH, $current_user, 'config.php'), - join_path(USERS_PATH, '_', 'config.default.php'), + join_path(FRESHRSS_PATH, 'config-user.default.php'), $configuration_setter); // Finish to initialize the other FreshRSS / Minz components. diff --git a/app/install.php b/app/install.php index ebfffa47d..9e474ca73 100644 --- a/app/install.php +++ b/app/install.php @@ -88,13 +88,13 @@ function saveStep1() { // First, we try to get previous configurations Minz_Configuration::register('system', join_path(DATA_PATH, 'config.php'), - join_path(DATA_PATH, 'config.default.php')); + join_path(FRESHRSS_PATH, 'config.default.php')); $system_conf = Minz_Configuration::get('system'); $current_user = $system_conf->default_user; Minz_Configuration::register('user', join_path(USERS_PATH, $current_user, 'config.php'), - join_path(USERS_PATH, '_', 'config.default.php')); + join_path(FRESHRSS_PATH, 'config-user.default.php')); $user_conf = Minz_Configuration::get('user'); // Then, we set $_SESSION vars diff --git a/cli/_cli.php b/cli/_cli.php index f5e36eabc..1b26ea738 100644 --- a/cli/_cli.php +++ b/cli/_cli.php @@ -8,7 +8,7 @@ require(LIB_PATH . '/lib_rss.php'); Minz_Configuration::register('system', DATA_PATH . '/config.php', - DATA_PATH . '/config.default.php'); + FRESHRSS_PATH . '/config.default.php'); FreshRSS_Context::$system_conf = Minz_Configuration::get('system'); Minz_Translate::init('en'); diff --git a/config-user.default.php b/config-user.default.php new file mode 100644 index 000000000..f28ef9724 --- /dev/null +++ b/config-user.default.php @@ -0,0 +1,75 @@ + 'en', + 'old_entries' => 3, + 'keep_history_default' => 50, + 'ttl_default' => 3600, + 'mail_login' => '', + 'token' => '', + 'passwordHash' => '', + 'apiPasswordHash' => '', + 'posts_per_page' => 20, + 'since_hours_posts_per_rss' => 168, + 'min_posts_per_rss' => 2, + 'max_posts_per_rss' => 400, + 'view_mode' => 'normal', + 'default_view' => 'adaptive', + 'default_state' => FreshRSS_Entry::STATE_NOT_READ, + 'auto_load_more' => true, + 'display_posts' => false, + 'display_categories' => false, + 'hide_read_feeds' => true, + 'onread_jump_next' => true, + 'lazyload' => true, + 'sticky_post' => true, + 'reading_confirm' => false, + 'auto_remove_article' => false, + + # In the case an article has changed (e.g. updated content): + # Set to `true` to mark it unread, or `false` to leave it as-is. + 'mark_updated_article_unread' => false, //TODO: -1 => ignore, 0 => update, 1 => update and mark as unread + + 'sort_order' => 'DESC', + 'anon_access' => false, + 'mark_when' => array ( + 'article' => true, + 'site' => true, + 'scroll' => true, + 'reception' => false, + ), + 'theme' => 'Origine', + 'content_width' => 'thin', + 'shortcuts' => array ( + 'mark_read' => 'r', + 'mark_favorite' => 'f', + 'go_website' => 'space', + 'next_entry' => 'j', + 'prev_entry' => 'k', + 'first_entry' => 'home', + 'last_entry' => 'end', + 'collapse_entry' => 'c', + 'load_more' => 'm', + 'auto_share' => 's', + 'focus_search' => 'a', + 'user_filter' => 'u', + 'help' => 'f1', + 'close_dropdown' => 'escape', + ), + 'topline_read' => true, + 'topline_favorite' => true, + 'topline_date' => true, + 'topline_link' => true, + 'bottomline_read' => true, + 'bottomline_favorite' => true, + 'bottomline_sharing' => true, + 'bottomline_tags' => true, + 'bottomline_date' => true, + 'bottomline_link' => true, + 'sharing' => array ( + ), + 'queries' => array ( + ), + 'html5_notif_timeout' => 0, + 'extensions_enabled' => array(), +); diff --git a/config.default.php b/config.default.php new file mode 100644 index 000000000..748df1884 --- /dev/null +++ b/config.default.php @@ -0,0 +1,152 @@ + 'production', + + # Used to make crypto more unique. Generated during install. + 'salt' => '', + + # Specify address of the FreshRSS instance, + # used when building absolute URLs, e.g. for PubSubHubbub. + # Examples: + # https://example.net/FreshRSS/p/ + # https://freshrss.example.net/ + 'base_url' => '', + + # Specify address of the FreshRSS auto-update server. + 'auto_update_url' => 'https://update.freshrss.org', + + # Natural language of the user interface, e.g. `en`, `fr`. + 'language' => 'en', + + # Title of this FreshRSS instance in the Web user interface. + 'title' => 'FreshRSS', + + # Meta description used when `allow_robots` is true. + 'meta_description' => '', + + # Name of the user that has administration rights. + 'default_user' => '_', + + # Allow or not visitors without login to see the articles + # of the default user. + 'allow_anonymous' => false, + + # Allow or not anonymous users to start the refresh process. + 'allow_anonymous_refresh' => false, + + # Login method: + # `none` is without password and shows only the default user; + # `form` is a conventional Web login form; + # `http_auth` is an access controled by the HTTP Web server (e.g. `/FreshRSS/p/i/.htaccess` for Apache) + # if you use `http_auth`, remember to protect only `/FreshRSS/p/i/`, + # and in particular not protect `/FreshRSS/p/api/` if you would like to use the API (different login system). + 'auth_type' => 'form', + + # Allow or not the use of the API, used for mobile apps. + # End-point is http://example.net/FreshRSS/p/api/greader.php + # You need to set the user's API password. + 'api_enabled' => false, + + # Allow or not the use of an unsafe login, + # by providing username and password in the login URL: + # http://example.net/FreshRSS/p/i/?c=auth&a=login&u=alice&p=1234 + 'unsafe_autologin_enabled' => false, + + # Enable or not the use of syslog to log the activity of + # SimplePie, which is retrieving RSS feeds via HTTP requests. + 'simplepie_syslog_enabled' => true, + + # Enable or not support of PubSubHubbub. + # /!\ It should NOT be enabled if base_url is not reachable by an external server. + 'pubsubhubbub_enabled' => false, + + # Allow or not Web robots (e.g. search engines) in HTML headers. + 'allow_robots' => false, + + # If true does nothing, if false restricts HTTP Referer via: meta referrer origin + 'allow_referrer' => false, + + 'limits' => array( + + # Duration in seconds of the login cookie. + 'cookie_duration' => 2592000, + + # Duration in seconds of the SimplePie cache, + # during which a query to the RSS feed will return the local cached version. + # Especially important for multi-user setups. + 'cache_duration' => 800, + + # SimplePie HTTP request timeout in seconds. + 'timeout' => 15, + + # If a user has not used FreshRSS for more than x seconds, + # then its feeds are not refreshed anymore. + 'max_inactivity' => PHP_INT_MAX, + + # Max number of feeds for a user. + 'max_feeds' => 16384, + + # Max number of categories for a user. + 'max_categories' => 16384, + + # Max number of accounts that anonymous users can create + # 0 for an unlimited number of accounts + # 1 is to not allow user registrations (1 is corresponding to the admin account) + 'max_registrations' => 1, + ), + + # Options used by cURL when making HTTP requests, e.g. when the SimplePie library retrieves feeds. + # http://php.net/manual/function.curl-setopt + 'curl_options' => array( + # Options to disable SSL/TLS certificate check (e.g. for self-signed HTTPS) + //CURLOPT_SSL_VERIFYHOST => 0, + //CURLOPT_SSL_VERIFYPEER => false, + + # Options to use a proxy for retrieving feeds. + //CURLOPT_PROXYTYPE => CURLPROXY_HTTP, + //CURLOPT_PROXY => '127.0.0.1', + //CURLOPT_PROXYPORT => 8080, + //CURLOPT_PROXYAUTH => CURLAUTH_BASIC, + //CURLOPT_PROXYUSERPWD => 'user:password', + ), + + 'db' => array( + + # Type of database: `sqlite` or `mysql`. + 'type' => 'sqlite', + + # MySQL host. + 'host' => 'localhost', + + # MySQL user. + 'user' => '', + + # MySQL password. + 'password' => '', + + # MySQL database. + 'base' => '', + + # MySQL table prefix. + 'prefix' => 'freshrss_', + + 'pdo_options' => array( + //PDO::MYSQL_ATTR_SSL_KEY => '/path/to/client-key.pem', + //PDO::MYSQL_ATTR_SSL_CERT => '/path/to/client-cert.pem', + //PDO::MYSQL_ATTR_SSL_CA => '/path/to/ca-cert.pem', + ), + + ), + + # List of enabled FreshRSS extensions. + 'extensions_enabled' => array(), + + # Disable self-update, + 'disable_update' => false, +); diff --git a/data/config.default.php b/data/config.default.php deleted file mode 100644 index 748df1884..000000000 --- a/data/config.default.php +++ /dev/null @@ -1,152 +0,0 @@ - 'production', - - # Used to make crypto more unique. Generated during install. - 'salt' => '', - - # Specify address of the FreshRSS instance, - # used when building absolute URLs, e.g. for PubSubHubbub. - # Examples: - # https://example.net/FreshRSS/p/ - # https://freshrss.example.net/ - 'base_url' => '', - - # Specify address of the FreshRSS auto-update server. - 'auto_update_url' => 'https://update.freshrss.org', - - # Natural language of the user interface, e.g. `en`, `fr`. - 'language' => 'en', - - # Title of this FreshRSS instance in the Web user interface. - 'title' => 'FreshRSS', - - # Meta description used when `allow_robots` is true. - 'meta_description' => '', - - # Name of the user that has administration rights. - 'default_user' => '_', - - # Allow or not visitors without login to see the articles - # of the default user. - 'allow_anonymous' => false, - - # Allow or not anonymous users to start the refresh process. - 'allow_anonymous_refresh' => false, - - # Login method: - # `none` is without password and shows only the default user; - # `form` is a conventional Web login form; - # `http_auth` is an access controled by the HTTP Web server (e.g. `/FreshRSS/p/i/.htaccess` for Apache) - # if you use `http_auth`, remember to protect only `/FreshRSS/p/i/`, - # and in particular not protect `/FreshRSS/p/api/` if you would like to use the API (different login system). - 'auth_type' => 'form', - - # Allow or not the use of the API, used for mobile apps. - # End-point is http://example.net/FreshRSS/p/api/greader.php - # You need to set the user's API password. - 'api_enabled' => false, - - # Allow or not the use of an unsafe login, - # by providing username and password in the login URL: - # http://example.net/FreshRSS/p/i/?c=auth&a=login&u=alice&p=1234 - 'unsafe_autologin_enabled' => false, - - # Enable or not the use of syslog to log the activity of - # SimplePie, which is retrieving RSS feeds via HTTP requests. - 'simplepie_syslog_enabled' => true, - - # Enable or not support of PubSubHubbub. - # /!\ It should NOT be enabled if base_url is not reachable by an external server. - 'pubsubhubbub_enabled' => false, - - # Allow or not Web robots (e.g. search engines) in HTML headers. - 'allow_robots' => false, - - # If true does nothing, if false restricts HTTP Referer via: meta referrer origin - 'allow_referrer' => false, - - 'limits' => array( - - # Duration in seconds of the login cookie. - 'cookie_duration' => 2592000, - - # Duration in seconds of the SimplePie cache, - # during which a query to the RSS feed will return the local cached version. - # Especially important for multi-user setups. - 'cache_duration' => 800, - - # SimplePie HTTP request timeout in seconds. - 'timeout' => 15, - - # If a user has not used FreshRSS for more than x seconds, - # then its feeds are not refreshed anymore. - 'max_inactivity' => PHP_INT_MAX, - - # Max number of feeds for a user. - 'max_feeds' => 16384, - - # Max number of categories for a user. - 'max_categories' => 16384, - - # Max number of accounts that anonymous users can create - # 0 for an unlimited number of accounts - # 1 is to not allow user registrations (1 is corresponding to the admin account) - 'max_registrations' => 1, - ), - - # Options used by cURL when making HTTP requests, e.g. when the SimplePie library retrieves feeds. - # http://php.net/manual/function.curl-setopt - 'curl_options' => array( - # Options to disable SSL/TLS certificate check (e.g. for self-signed HTTPS) - //CURLOPT_SSL_VERIFYHOST => 0, - //CURLOPT_SSL_VERIFYPEER => false, - - # Options to use a proxy for retrieving feeds. - //CURLOPT_PROXYTYPE => CURLPROXY_HTTP, - //CURLOPT_PROXY => '127.0.0.1', - //CURLOPT_PROXYPORT => 8080, - //CURLOPT_PROXYAUTH => CURLAUTH_BASIC, - //CURLOPT_PROXYUSERPWD => 'user:password', - ), - - 'db' => array( - - # Type of database: `sqlite` or `mysql`. - 'type' => 'sqlite', - - # MySQL host. - 'host' => 'localhost', - - # MySQL user. - 'user' => '', - - # MySQL password. - 'password' => '', - - # MySQL database. - 'base' => '', - - # MySQL table prefix. - 'prefix' => 'freshrss_', - - 'pdo_options' => array( - //PDO::MYSQL_ATTR_SSL_KEY => '/path/to/client-key.pem', - //PDO::MYSQL_ATTR_SSL_CERT => '/path/to/client-cert.pem', - //PDO::MYSQL_ATTR_SSL_CA => '/path/to/ca-cert.pem', - ), - - ), - - # List of enabled FreshRSS extensions. - 'extensions_enabled' => array(), - - # Disable self-update, - 'disable_update' => false, -); diff --git a/data/users/_/config.default.php b/data/users/_/config.default.php deleted file mode 100644 index f28ef9724..000000000 --- a/data/users/_/config.default.php +++ /dev/null @@ -1,75 +0,0 @@ - 'en', - 'old_entries' => 3, - 'keep_history_default' => 50, - 'ttl_default' => 3600, - 'mail_login' => '', - 'token' => '', - 'passwordHash' => '', - 'apiPasswordHash' => '', - 'posts_per_page' => 20, - 'since_hours_posts_per_rss' => 168, - 'min_posts_per_rss' => 2, - 'max_posts_per_rss' => 400, - 'view_mode' => 'normal', - 'default_view' => 'adaptive', - 'default_state' => FreshRSS_Entry::STATE_NOT_READ, - 'auto_load_more' => true, - 'display_posts' => false, - 'display_categories' => false, - 'hide_read_feeds' => true, - 'onread_jump_next' => true, - 'lazyload' => true, - 'sticky_post' => true, - 'reading_confirm' => false, - 'auto_remove_article' => false, - - # In the case an article has changed (e.g. updated content): - # Set to `true` to mark it unread, or `false` to leave it as-is. - 'mark_updated_article_unread' => false, //TODO: -1 => ignore, 0 => update, 1 => update and mark as unread - - 'sort_order' => 'DESC', - 'anon_access' => false, - 'mark_when' => array ( - 'article' => true, - 'site' => true, - 'scroll' => true, - 'reception' => false, - ), - 'theme' => 'Origine', - 'content_width' => 'thin', - 'shortcuts' => array ( - 'mark_read' => 'r', - 'mark_favorite' => 'f', - 'go_website' => 'space', - 'next_entry' => 'j', - 'prev_entry' => 'k', - 'first_entry' => 'home', - 'last_entry' => 'end', - 'collapse_entry' => 'c', - 'load_more' => 'm', - 'auto_share' => 's', - 'focus_search' => 'a', - 'user_filter' => 'u', - 'help' => 'f1', - 'close_dropdown' => 'escape', - ), - 'topline_read' => true, - 'topline_favorite' => true, - 'topline_date' => true, - 'topline_link' => true, - 'bottomline_read' => true, - 'bottomline_favorite' => true, - 'bottomline_sharing' => true, - 'bottomline_tags' => true, - 'bottomline_date' => true, - 'bottomline_link' => true, - 'sharing' => array ( - ), - 'queries' => array ( - ), - 'html5_notif_timeout' => 0, - 'extensions_enabled' => array(), -); diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php index f9eff3db6..952d983c9 100644 --- a/lib/Minz/FrontController.php +++ b/lib/Minz/FrontController.php @@ -33,7 +33,7 @@ class Minz_FrontController { try { Minz_Configuration::register('system', DATA_PATH . '/config.php', - DATA_PATH . '/config.default.php'); + FRESHRSS_PATH . '/config.default.php'); $this->setReporting(); Minz_Request::init(); diff --git a/lib/lib_install.php b/lib/lib_install.php index c625a670a..bf81c15b4 100644 --- a/lib/lib_install.php +++ b/lib/lib_install.php @@ -2,8 +2,8 @@ define('BCRYPT_COST', 9); -Minz_Configuration::register('default_system', join_path(DATA_PATH, 'config.default.php')); -Minz_Configuration::register('default_user', join_path(USERS_PATH, '_', 'config.default.php')); +Minz_Configuration::register('default_system', join_path(FRESHRSS_PATH, 'config.default.php')); +Minz_Configuration::register('default_user', join_path(FRESHRSS_PATH, 'config-user.default.php')); function checkRequirements($dbType = '') { $php = version_compare(PHP_VERSION, '5.3.3') >= 0; diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 247cc707b..1bf387712 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -341,7 +341,7 @@ function get_user_configuration($username) { try { Minz_Configuration::register($namespace, join_path(USERS_PATH, $username, 'config.php'), - join_path(USERS_PATH, '_', 'config.default.php')); + join_path(FRESHRSS_PATH, 'config-user.default.php')); } catch (Minz_ConfigurationNamespaceException $e) { // namespace already exists, do nothing. } catch (Minz_FileNotExistException $e) { diff --git a/p/api/greader.php b/p/api/greader.php index 01eca6d4f..e1f4202a7 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -695,7 +695,7 @@ $pathInfos = explode('/', $pathInfo); Minz_Configuration::register('system', DATA_PATH . '/config.php', - DATA_PATH . '/config.default.php'); + FRESHRSS_PATH . '/config.default.php'); FreshRSS_Context::$system_conf = Minz_Configuration::get('system'); if (!FreshRSS_Context::$system_conf->api_enabled) { serviceUnavailable(); diff --git a/p/api/index.php b/p/api/index.php index 3ab4e02b3..580c90255 100644 --- a/p/api/index.php +++ b/p/api/index.php @@ -16,7 +16,7 @@
diff --git a/p/api/pshb.php b/p/api/pshb.php index a0b64ede1..4b546908a 100644 --- a/p/api/pshb.php +++ b/p/api/pshb.php @@ -60,7 +60,7 @@ if (empty($users)) { unlink('../../keys/' . $key . '.txt'); Minz_Configuration::register('system', DATA_PATH . '/config.php', - DATA_PATH . '/config.default.php'); + FRESHRSS_PATH . '/config.default.php'); FreshRSS_Context::$system_conf = Minz_Configuration::get('system'); $feed = new FreshRSS_Feed($url); $feed->pubSubHubbubSubscribe(false); @@ -101,7 +101,7 @@ if ($ORIGINAL_INPUT == '') { die('Missing XML payload!'); } -Minz_Configuration::register('system', DATA_PATH . '/config.php', DATA_PATH . '/config.default.php'); +Minz_Configuration::register('system', DATA_PATH . '/config.php', FRESHRSS_PATH . '/config.default.php'); $system_conf = Minz_Configuration::get('system'); $system_conf->auth_type = 'none'; // avoid necessity to be logged in (not saved!) @@ -133,7 +133,7 @@ foreach ($users as $userFilename) { Minz_Session::_param('currentUser', $username); Minz_Configuration::register('user', join_path(USERS_PATH, $username, 'config.php'), - join_path(USERS_PATH, '_', 'config.default.php')); + join_path(FRESHRSS_PATH, 'config-user.default.php')); new Minz_ModelPdo($username); //TODO: FIXME: Quick-fix while waiting for a better FreshRSS() constructor/init FreshRSS_Context::init(); list($updated_feeds, $feed, $nb_new_articles) = FreshRSS_feed_Controller::actualizeFeed(0, $self, false, $simplePie); -- cgit v1.2.3 From f57aaebeb854a617749424f3d62464aceaed98c4 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 25 May 2017 13:46:16 +0200 Subject: Readme more advanced git commands https://github.com/FreshRSS/FreshRSS/issues/1542 --- cli/README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'cli') diff --git a/cli/README.md b/cli/README.md index 0123e8d6e..aa3a6bf27 100644 --- a/cli/README.md +++ b/cli/README.md @@ -89,3 +89,49 @@ Example to get the number of feeds of a given user: ```sh ./cli/user-info.php --user alex | cut -f6 ``` + + +# Install and updates + +## Using git + +If you manage FreshRSS via command line, then installing and updating FreshRSS can be done via git: + +```sh +# Install FreshRSS +cd /usr/share/ +sudo git clone https://github.com/FreshRSS/FreshRSS.git + +# Use the development version of FreshRSS +cd /usr/share/FreshRSS +sudo git checkout -b dev origin/dev + +# Check out a specific version of FreshRSS +# See release names on https://github.com/FreshRSS/FreshRSS/releases +cd /usr/share/FreshRSS +sudo git checkout 1.7.0 + +# Check whether there is a new version of FreshRSS +cd /usr/share/FreshRSS +sudo git fetch +sudo git status + +# Discard manual changes (do a backup before) +cd /usr/share/FreshRSS +sudo git reset --hard +# Then re-delete the file forcing the setup wizard +sudo rm data/do-install.txt + +# Delete manual additions (do a backup before) +cd /usr/share/FreshRSS +sudo git clean -f -d + +# Update to a newer version of FreshRSS +cd /usr/share/FreshRSS +sudo git pull + +# Set the rights so that your Web server can access the files +# (Example for Debian / Ubuntu) +cd /usr/share/FreshRSS +sudo chown -R :www-data . && sudo chmod -R g+r . && sudo chmod -R g+w ./data/ +``` -- cgit v1.2.3 From 21954d6d83b94bd9ad4d763fb237710e71f14de1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 25 May 2017 14:02:55 +0200 Subject: More git readme --- README.md | 1 + cli/README.md | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'cli') diff --git a/README.md b/README.md index 8e0d8bac9..8b87ecb8f 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ cd /usr/share/FreshRSS sudo git pull sudo chown -R :www-data . && sudo chmod -R g+r . && sudo chmod -R g+w ./data/ ``` +See more commands and git commands in the [Command-Line Interface documentation](./cli/README.md). ## Access control It is needed for the multi-user mode to limit access to FreshRSS. You can: diff --git a/cli/README.md b/cli/README.md index aa3a6bf27..fff16f53d 100644 --- a/cli/README.md +++ b/cli/README.md @@ -108,12 +108,19 @@ sudo git checkout -b dev origin/dev # Check out a specific version of FreshRSS # See release names on https://github.com/FreshRSS/FreshRSS/releases +# You will then need to manually change version +# or checkout master or dev to get new versions cd /usr/share/FreshRSS sudo git checkout 1.7.0 -# Check whether there is a new version of FreshRSS +# Verify what branch is used cd /usr/share/FreshRSS -sudo git fetch +sudo git branch + +# Check whether there is a new version of FreshRSS, +# assuming you are on the /master or /dev branch +cd /usr/share/FreshRSS +sudo git fetch --all sudo git status # Discard manual changes (do a backup before) @@ -126,7 +133,8 @@ sudo rm data/do-install.txt cd /usr/share/FreshRSS sudo git clean -f -d -# Update to a newer version of FreshRSS +# Update to a newer version of FreshRSS, +# assuming you are on the /master or /dev branch cd /usr/share/FreshRSS sudo git pull -- cgit v1.2.3 From 20d1301b462378376ab83bcae56c9065b241e4a5 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 25 May 2017 14:27:31 +0200 Subject: Do not require write access to check new version Do not require write access to check if new ZIP version is available https://github.com/FreshRSS/FreshRSS/issues/1450 --- app/Controllers/updateController.php | 30 ++++---- app/i18n/cz/feedback.php | 2 +- app/i18n/de/feedback.php | 2 +- app/i18n/en/feedback.php | 2 +- app/i18n/fr/feedback.php | 2 +- app/i18n/it/feedback.php | 2 +- app/i18n/nl/feedback.php | 2 +- app/i18n/ru/feedback.php | 134 +++++++++++++++++------------------ app/i18n/tr/feedback.php | 2 +- cli/README.md | 2 +- 10 files changed, 91 insertions(+), 89 deletions(-) (limited to 'cli') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 35c7d1124..7a8a3d6c0 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -59,24 +59,26 @@ class FreshRSS_update_Controller extends Minz_ActionController { public function indexAction() { Minz_View::prependTitle(_t('admin.update.title') . ' · '); - if (!is_writable(FRESHRSS_PATH)) { - $this->view->message = array( - 'status' => 'bad', - 'title' => _t('gen.short.damn'), - 'body' => _t('feedback.update.file_is_nok', FRESHRSS_PATH) - ); - } elseif (file_exists(UPDATE_FILENAME)) { + if (file_exists(UPDATE_FILENAME)) { // There is an update file to apply! $version = @file_get_contents(join_path(DATA_PATH, 'last_update.txt')); - if (empty($version)) { + if ($version == '') { $version = 'unknown'; } - $this->view->update_to_apply = true; - $this->view->message = array( - 'status' => 'good', - 'title' => _t('gen.short.ok'), - 'body' => _t('feedback.update.can_apply', $version) - ); + if (is_writable(FRESHRSS_PATH)) { + $this->view->update_to_apply = true; + $this->view->message = array( + 'status' => 'good', + 'title' => _t('gen.short.ok'), + 'body' => _t('feedback.update.can_apply', $version), + ); + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.file_is_nok', $version, FRESHRSS_PATH), + ); + } } } diff --git a/app/i18n/cz/feedback.php b/app/i18n/cz/feedback.php index f2bd87c77..f7b8d8c73 100644 --- a/app/i18n/cz/feedback.php +++ b/app/i18n/cz/feedback.php @@ -87,7 +87,7 @@ return array( 'update' => array( 'can_apply' => 'FreshRSS bude nyní upgradováno na verzi %s.', 'error' => 'Během upgrade došlo k chybě: %s', - 'file_is_nok' => 'Zkontrolujte oprávnění adresáře %s. HTTP server musí mít do tohoto adresáře práva zápisu', + 'file_is_nok' => 'Verzi %s. Zkontrolujte oprávnění adresáře %s. HTTP server musí mít do tohoto adresáře práva zápisu', 'finished' => 'Upgrade hotov!', 'none' => 'Novější verze není k dispozici', 'server_not_found' => 'Nelze nalézt server s instalačním souborem. [%s]', diff --git a/app/i18n/de/feedback.php b/app/i18n/de/feedback.php index 195083b36..e2e9a71ba 100644 --- a/app/i18n/de/feedback.php +++ b/app/i18n/de/feedback.php @@ -87,7 +87,7 @@ return array( 'update' => array( 'can_apply' => 'FreshRSS wird nun auf die Version %s aktualisiert.', 'error' => 'Der Aktualisierungsvorgang stieß auf einen Fehler: %s', - 'file_is_nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses %s. Der HTTP-Server muss Schreibrechte besitzen', + 'file_is_nok' => 'Version %s. Überprüfen Sie die Berechtigungen des Verzeichnisses %s. Der HTTP-Server muss Schreibrechte besitzen', 'finished' => 'Aktualisierung abgeschlossen!', 'none' => 'Keine Aktualisierung zum Anwenden', 'server_not_found' => 'Der Aktualisierungs-Server kann nicht gefunden werden. [%s]', diff --git a/app/i18n/en/feedback.php b/app/i18n/en/feedback.php index 67c5fe97d..334d9a8f5 100644 --- a/app/i18n/en/feedback.php +++ b/app/i18n/en/feedback.php @@ -87,7 +87,7 @@ return array( 'update' => array( 'can_apply' => 'FreshRSS will now be updated to the version %s.', 'error' => 'The update process has encountered an error: %s', - 'file_is_nok' => 'Check permissions on %s directory. HTTP server must have rights to write into', + 'file_is_nok' => 'New version %s available, but check permissions on %s directory. HTTP server must have rights to write into', 'finished' => 'Update completed!', 'none' => 'No update to apply', 'server_not_found' => 'Update server cannot be found. [%s]', diff --git a/app/i18n/fr/feedback.php b/app/i18n/fr/feedback.php index 5966fc3a7..aa19cd02b 100644 --- a/app/i18n/fr/feedback.php +++ b/app/i18n/fr/feedback.php @@ -87,7 +87,7 @@ return array( 'update' => array( 'can_apply' => 'FreshRSS va maintenant être mis à jour vers la version %s.', 'error' => 'La mise à jour a rencontré un problème : %s', - 'file_is_nok' => 'Veuillez vérifier les droits sur le répertoire %s. Le serveur HTTP doit être capable d’écrire dedans', + 'file_is_nok' => 'Nouvelle version %s disponible, mais veuillez vérifier les droits sur le répertoire %s. Le serveur HTTP doit être capable d’écrire dedans', 'finished' => 'La mise à jour est terminée !', 'none' => 'Aucune mise à jour à appliquer', 'server_not_found' => 'Le serveur de mise à jour n’a pas été trouvé. [%s]', diff --git a/app/i18n/it/feedback.php b/app/i18n/it/feedback.php index 5851cb2e6..8f3cf3ed6 100644 --- a/app/i18n/it/feedback.php +++ b/app/i18n/it/feedback.php @@ -87,7 +87,7 @@ return array( 'update' => array( 'can_apply' => 'FreshRSS verrà aggiornato alla versione %s.', 'error' => 'Il processo di aggiornamento ha riscontrato il seguente errore: %s', - 'file_is_nok' => 'Verifica i permessi della cartella %s. Il server HTTP deve avere i permessi per la scrittura ', + 'file_is_nok' => 'Nuova versione %s, ma verifica i permessi della cartella %s. Il server HTTP deve avere i permessi per la scrittura ', 'finished' => 'Aggiornamento completato con successo!', 'none' => 'Nessun aggiornamento disponibile', 'server_not_found' => 'Server per aggiornamento non disponibile. [%s]', diff --git a/app/i18n/nl/feedback.php b/app/i18n/nl/feedback.php index 386b8d415..3a064eb0a 100644 --- a/app/i18n/nl/feedback.php +++ b/app/i18n/nl/feedback.php @@ -87,7 +87,7 @@ return array( 'update' => array( 'can_apply' => 'FreshRSS word nu vernieud naar versie %s.', 'error' => 'Het vernieuwingsproces kwam een fout tegen: %s', - 'file_is_nok' => 'Controleer permissies op %s map. HTTP server moet rechten hebben om er in te schrijven', + 'file_is_nok' => 'Versie %s. Controleer permissies op %s map. HTTP server moet rechten hebben om er in te schrijven', 'finished' => 'Vernieuwing compleet!', 'none' => 'Geen vernieuwing om toe te passen', 'server_not_found' => 'Vernieuwings server kan niet worden gevonden. [%s]', diff --git a/app/i18n/ru/feedback.php b/app/i18n/ru/feedback.php index e7f6b9f85..ffebd6dc9 100644 --- a/app/i18n/ru/feedback.php +++ b/app/i18n/ru/feedback.php @@ -2,108 +2,108 @@ return array( 'admin' => array( - 'optimization_complete' => 'Optimisation complete', + 'optimization_complete' => 'Optimisation complete', //TODO ), 'access' => array( - 'denied' => 'You don’t have permission to access this page', - 'not_found' => 'You are looking for a page which doesn’t exist', + 'denied' => 'You don’t have permission to access this page', //TODO + 'not_found' => 'You are looking for a page which doesn’t exist', //TODO ), 'auth' => array( 'form' => array( - 'not_set' => 'A problem occured during authentication system configuration. Please retry later.', - 'set' => 'Form is now your default authentication system.', + 'not_set' => 'A problem occured during authentication system configuration. Please retry later.', //TODO + 'set' => 'Form is now your default authentication system.', //TODO ), 'login' => array( - 'invalid' => 'Login is invalid', - 'success' => 'You are connected', + 'invalid' => 'Login is invalid', //TODO + 'success' => 'You are connected', //TODO ), 'logout' => array( - 'success' => 'You are disconnected', + 'success' => 'You are disconnected', //TODO ), - 'no_password_set' => 'Administrator password hasn’t been set. This feature isn’t available.', + 'no_password_set' => 'Administrator password hasn’t been set. This feature isn’t available.', //TODO ), 'conf' => array( - 'error' => 'An error occurred during configuration saving', - 'query_created' => 'Query "%s" has been created.', - 'shortcuts_updated' => 'Shortcuts have been updated', - 'updated' => 'Configuration has been updated', + 'error' => 'An error occurred during configuration saving', //TODO + 'query_created' => 'Query "%s" has been created.', //TODO + 'shortcuts_updated' => 'Shortcuts have been updated', //TODO + 'updated' => 'Configuration has been updated', //TODO ), 'extensions' => array( - 'already_enabled' => '%s is already enabled', + 'already_enabled' => '%s is already enabled', //TODO 'disable' => array( - 'ko' => '%s cannot be disabled. Check FressRSS logs for details.', - 'ok' => '%s is now disabled', + 'ko' => '%s cannot be disabled. Check FressRSS logs for details.', //TODO + 'ok' => '%s is now disabled', //TODO ), 'enable' => array( - 'ko' => '%s cannot be enabled. Check FressRSS logs for details.', - 'ok' => '%s is now enabled', + 'ko' => '%s cannot be enabled. Check FressRSS logs for details.', //TODO + 'ok' => '%s is now enabled', //TODO ), - 'no_access' => 'You have no access on %s', - 'not_enabled' => '%s is not enabled yet', - 'not_found' => '%s does not exist', + 'no_access' => 'You have no access on %s', //TODO + 'not_enabled' => '%s is not enabled yet', //TODO + 'not_found' => '%s does not exist', //TODO ), 'import_export' => array( - 'export_no_zip_extension' => 'ZIP extension is not present on your server. Please try to export files one by one.', - 'feeds_imported' => 'Your feeds have been imported and will now be updated', - 'feeds_imported_with_errors' => 'Your feeds have been imported but some errors occurred', - 'file_cannot_be_uploaded' => 'File cannot be uploaded!', - 'no_zip_extension' => 'ZIP extension is not present on your server.', - 'zip_error' => 'An error occured during ZIP import.', + 'export_no_zip_extension' => 'ZIP extension is not present on your server. Please try to export files one by one.', //TODO + 'feeds_imported' => 'Your feeds have been imported and will now be updated', //TODO + 'feeds_imported_with_errors' => 'Your feeds have been imported but some errors occurred', //TODO + 'file_cannot_be_uploaded' => 'File cannot be uploaded!', //TODO + 'no_zip_extension' => 'ZIP extension is not present on your server.', //TODO + 'zip_error' => 'An error occured during ZIP import.', //TODO ), 'sub' => array( - 'actualize' => 'Actualise', + 'actualize' => 'Actualise', //TODO 'category' => array( - 'created' => 'Category %s has been created.', - 'deleted' => 'Category has been deleted.', - 'emptied' => 'Category has been emptied', - 'error' => 'Category cannot be updated', - 'name_exists' => 'Category name already exists.', - 'no_id' => 'You must precise the id of the category.', - 'no_name' => 'Category name cannot be empty.', - 'not_delete_default' => 'You cannot delete the default category!', - 'not_exist' => 'The category does not exist!', - 'over_max' => 'You have reached your limit of categories (%d)', - 'updated' => 'Category has been updated.', + 'created' => 'Category %s has been created.', //TODO + 'deleted' => 'Category has been deleted.', //TODO + 'emptied' => 'Category has been emptied', //TODO + 'error' => 'Category cannot be updated', //TODO + 'name_exists' => 'Category name already exists.', //TODO + 'no_id' => 'You must precise the id of the category.', //TODO + 'no_name' => 'Category name cannot be empty.', //TODO + 'not_delete_default' => 'You cannot delete the default category!', //TODO + 'not_exist' => 'The category does not exist!', //TODO + 'over_max' => 'You have reached your limit of categories (%d)', //TODO + 'updated' => 'Category has been updated.', //TODO ), 'feed' => array( - 'actualized' => '%s has been updated', - 'actualizeds' => 'RSS feeds have been updated', - 'added' => 'RSS feed %s has been added', - 'already_subscribed' => 'You have already subscribed to %s', - 'deleted' => 'Feed has been deleted', - 'error' => 'Feed cannot be updated', - 'internal_problem' => 'The RSS feed could not be added. Check FressRSS logs for details.', - 'invalid_url' => 'URL %s is invalid', - 'marked_read' => 'Feeds have been marked as read', - 'n_actualized' => '%d feeds have been updated', - 'n_entries_deleted' => '%d articles have been deleted', - 'no_refresh' => 'There is no feed to refresh…', - 'not_added' => '%s could not be added', - 'over_max' => 'You have reached your limit of feeds (%d)', - 'updated' => 'Feed has been updated', + 'actualized' => '%s has been updated', //TODO + 'actualizeds' => 'RSS feeds have been updated', //TODO + 'added' => 'RSS feed %s has been added', //TODO + 'already_subscribed' => 'You have already subscribed to %s', //TODO + 'deleted' => 'Feed has been deleted', //TODO + 'error' => 'Feed cannot be updated', //TODO + 'internal_problem' => 'The RSS feed could not be added. Check FressRSS logs for details.', //TODO + 'invalid_url' => 'URL %s is invalid', //TODO + 'marked_read' => 'Feeds have been marked as read', //TODO + 'n_actualized' => '%d feeds have been updated', //TODO + 'n_entries_deleted' => '%d articles have been deleted', //TODO + 'no_refresh' => 'There is no feed to refresh…', //TODO + 'not_added' => '%s could not be added', //TODO + 'over_max' => 'You have reached your limit of feeds (%d)', //TODO + 'updated' => 'Feed has been updated', //TODO ), - 'purge_completed' => 'Purge completed (%d articles deleted)', + 'purge_completed' => 'Purge completed (%d articles deleted)', //TODO ), 'update' => array( - 'can_apply' => 'FreshRSS will now be updated to the version %s.', - 'error' => 'The update process has encountered an error: %s', - 'file_is_nok' => 'Check permissions on %s directory. HTTP server must have rights to write into', - 'finished' => 'Update completed!', - 'none' => 'No update to apply', - 'server_not_found' => 'Update server cannot be found. [%s]', + 'can_apply' => 'FreshRSS will now be updated to the version %s.', //TODO + 'error' => 'The update process has encountered an error: %s', //TODO + 'file_is_nok' => 'New version %s available, but check permissions on %s directory. HTTP server must have rights to write into', //TODO + 'finished' => 'Update completed!', //TODO + 'none' => 'No update to apply', //TODO + 'server_not_found' => 'Update server cannot be found. [%s]', //TODO ), 'user' => array( 'created' => array( - '_' => 'User %s has been created', - 'error' => 'User %s cannot be created', + '_' => 'User %s has been created', //TODO + 'error' => 'User %s cannot be created', //TODO ), 'deleted' => array( - '_' => 'User %s has been deleted', - 'error' => 'User %s cannot be deleted', + '_' => 'User %s has been deleted', //TODO + 'error' => 'User %s cannot be deleted', //TODO ), ), 'profile' => array( - 'error' => 'Your profile cannot be modified', - 'updated' => 'Your profile has been modified', + 'error' => 'Your profile cannot be modified', //TODO + 'updated' => 'Your profile has been modified', //TODO ), ); diff --git a/app/i18n/tr/feedback.php b/app/i18n/tr/feedback.php index 87361ff51..be79630be 100644 --- a/app/i18n/tr/feedback.php +++ b/app/i18n/tr/feedback.php @@ -87,7 +87,7 @@ return array( 'update' => array( 'can_apply' => 'FreshRSS %s versiyonuna güncellenecek.', 'error' => 'Güncelleme işlemi sırasında hata: %s', - 'file_is_nok' => '%s klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'file_is_nok' => '%s versiyonuna. %s klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', 'finished' => 'Güncelleme tamamlandı!', 'none' => 'Güncelleme yok', 'server_not_found' => 'Güncelleme sunucusu bulunamadı. [%s]', diff --git a/cli/README.md b/cli/README.md index fff16f53d..c37c84dc0 100644 --- a/cli/README.md +++ b/cli/README.md @@ -109,7 +109,7 @@ sudo git checkout -b dev origin/dev # Check out a specific version of FreshRSS # See release names on https://github.com/FreshRSS/FreshRSS/releases # You will then need to manually change version -# or checkout master or dev to get new versions +# or checkout master or dev branch to get new versions cd /usr/share/FreshRSS sudo git checkout 1.7.0 -- cgit v1.2.3 From 99c7450343115ad9082cc0e1d12887633d99d935 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 26 May 2017 09:45:29 +0200 Subject: Simplify readme Remove cd and sudo https://github.com/FreshRSS/FreshRSS/pull/1544#discussion_r118556797 --- cli/README.md | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'cli') diff --git a/cli/README.md b/cli/README.md index c37c84dc0..1ac8c95ce 100644 --- a/cli/README.md +++ b/cli/README.md @@ -98,48 +98,46 @@ Example to get the number of feeds of a given user: If you manage FreshRSS via command line, then installing and updating FreshRSS can be done via git: ```sh +# If your local user does not have write access, prefix all commands by sudo: +sudo ... + # Install FreshRSS cd /usr/share/ -sudo git clone https://github.com/FreshRSS/FreshRSS.git +git clone https://github.com/FreshRSS/FreshRSS.git -# Use the development version of FreshRSS +# Perform all commands below in your FreshRSS directory: cd /usr/share/FreshRSS -sudo git checkout -b dev origin/dev + +# Use the development version of FreshRSS +git checkout -b dev origin/dev # Check out a specific version of FreshRSS # See release names on https://github.com/FreshRSS/FreshRSS/releases # You will then need to manually change version # or checkout master or dev branch to get new versions -cd /usr/share/FreshRSS -sudo git checkout 1.7.0 +git checkout 1.7.0 # Verify what branch is used -cd /usr/share/FreshRSS -sudo git branch +git branch # Check whether there is a new version of FreshRSS, # assuming you are on the /master or /dev branch -cd /usr/share/FreshRSS -sudo git fetch --all -sudo git status +git fetch --all +git status # Discard manual changes (do a backup before) -cd /usr/share/FreshRSS -sudo git reset --hard +git reset --hard # Then re-delete the file forcing the setup wizard -sudo rm data/do-install.txt +rm data/do-install.txt # Delete manual additions (do a backup before) -cd /usr/share/FreshRSS -sudo git clean -f -d +git clean -f -d # Update to a newer version of FreshRSS, # assuming you are on the /master or /dev branch -cd /usr/share/FreshRSS -sudo git pull +git pull # Set the rights so that your Web server can access the files # (Example for Debian / Ubuntu) -cd /usr/share/FreshRSS -sudo chown -R :www-data . && sudo chmod -R g+r . && sudo chmod -R g+w ./data/ +chown -R :www-data . && chmod -R g+r . && chmod -R g+w ./data/ ``` -- cgit v1.2.3