From 1b8eb6c7e732f1eda4fc8f22e847b363b016f857 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 23 Oct 2016 01:46:14 +0200 Subject: CLI import ZIP/OPML/JSON for user https://github.com/FreshRSS/FreshRSS/issues/1095 https://github.com/FreshRSS/FreshRSS/issues/851 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 5c8f586fa..a541d6dea 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ We are a friendly community. * A web server: Apache2 (recommended), nginx, lighttpd (not tested on others) * PHP 5.3.3+ (PHP 5.4+ recommended, and PHP 5.5+ for performance, and PHP 7 for even higher performance) * Required extensions: [DOM](http://php.net/dom), [XML](http://php.net/xml), [PDO_MySQL](http://php.net/pdo-mysql) or [PDO_SQLite](http://php.net/pdo-sqlite) or [PDO_PGSQL](http://php.net/pdo-pgsql), [cURL](http://php.net/curl) - * Recommended extensions: [JSON](http://php.net/json), [GMP](http://php.net/gmp) (for API access on platforms < 64 bits), [IDN](http://php.net/intl.idn) (for Internationalized Domain Names), [mbstring](http://php.net/mbstring) and/or [iconv](http://php.net/iconv) (for charset conversion), [Zip](http://php.net/zip) (for import/export), [zlib](http://php.net/zlib) (for compressed feeds) + * Recommended extensions: [JSON](http://php.net/json), [GMP](http://php.net/gmp) (for API access on platforms < 64 bits), [IDN](http://php.net/intl.idn) (for Internationalized Domain Names), [mbstring](http://php.net/mbstring) and/or [iconv](http://php.net/iconv) (for charset conversion), [ZIP](http://php.net/zip) (for import/export), [zlib](http://php.net/zlib) (for compressed feeds) * MySQL 5.5.3+ (recommended), or SQLite 3.7.4+, or PostgreSQL (experimental) * A recent browser like Firefox, Internet Explorer 11 / Edge, Chrome, Opera, Safari. * Works on mobile -- cgit v1.2.3 From 1e4348732dc8b58247b05d272f6f20c785165278 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 24 Oct 2016 21:21:26 +0200 Subject: Readme CLI https://github.com/FreshRSS/FreshRSS/issues/1095 --- CHANGELOG.md | 2 ++ README.fr.md | 2 ++ README.md | 6 ++++-- cli/README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 cli/README.md (limited to 'README.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index d24ec0739..acec03f39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## 2016-10-XX FreshRSS 1.6.0-dev * API + * New Command-Line Interface (CLI) [#1095](https://github.com/FreshRSS/FreshRSS/issues/1095) + * Install, add/delete users, actualize, import/export. See [CLI documentation](./cli/README.md). * Support for editing feeds and categories from client applications [#1254](https://github.com/FreshRSS/FreshRSS/issues/1254) * Compatibility: * Support for PostgreSQL [#416](https://github.com/FreshRSS/FreshRSS/issues/416) diff --git a/README.fr.md b/README.fr.md index 2a2da256d..d672b5069 100644 --- a/README.fr.md +++ b/README.fr.md @@ -87,6 +87,7 @@ sudo chmod -R g+w ./data/ sudo ln -s /usr/share/FreshRSS/p /var/www/html/FreshRSS # Naviguez vers http://example.net/FreshRSS pour terminer l’installation. # (Si vous le faite depuis localhost, vous pourrez avoir à ajuster le réglage de votre adresse publique) +# ou utilisez [l’interface en ligne de commande](./cli/README.md) # Mettre à jour FreshRSS vers une nouvelle version cd /usr/share/FreshRSS @@ -132,6 +133,7 @@ Créer `/etc/cron.d/FreshRSS` avec : # Sauvegarde * Il faut conserver vos fichiers `./data/config.php` ainsi que `./data/*_user.php` * Vous pouvez exporter votre liste de flux depuis FreshRSS au format OPML + * soit depuis l’interface Web, soit [en ligne de commande](./cli/README.md) * Pour sauvegarder les articles eux-mêmes, vous pouvez utiliser [phpMyAdmin](http://www.phpmyadmin.net) ou les outils de MySQL : ```bash diff --git a/README.md b/README.md index a541d6dea..fef4aeef5 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ sudo chmod -R g+w ./data/ sudo ln -s /usr/share/FreshRSS/p /var/www/html/FreshRSS # Navigate to http://example.net/FreshRSS to complete the installation. # (If you do it from localhost, you may have to adjust the setting of your public address later) +# or use the [Command-Line Interface](./cli/README.md) # Update to a newer version of FreshRSS cd /usr/share/FreshRSS @@ -107,8 +108,8 @@ It is needed for the multi-user mode to limit access to FreshRSS. You can: ## Automatic feed update * You can add a Cron job to launch the update script. Check the Cron documentation related to your distribution ([Debian/Ubuntu](https://help.ubuntu.com/community/CronHowto), [Red Hat/Fedora](https://fedoraproject.org/wiki/Administration_Guide_Draft/Cron), [Slackware](http://docs.slackware.com/fr:slackbook:process_control?#cron), [Gentoo](https://wiki.gentoo.org/wiki/Cron), [Arch Linux](https://wiki.archlinux.org/index.php/Cron)…). -It’s a good idea to use the Web server user. -For example, if you want to run the script every hour: +It is a good idea to use the Web server user. +For instance, if you want to run the script every hour: ``` 9 * * * * php /usr/share/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 @@ -132,6 +133,7 @@ Create `/etc/cron.d/FreshRSS` with: # Backup * You need to keep `./data/config.php`, and `./data/*_user.php` files * You can export your feed list in OPML format from FreshRSS + * either from the Web interface, or from the [Command-Line Interface](./cli/README.md) * To save articles, you can use [phpMyAdmin](http://www.phpmyadmin.net) or MySQL tools: ```bash diff --git a/cli/README.md b/cli/README.md new file mode 100644 index 000000000..7202d5809 --- /dev/null +++ b/cli/README.md @@ -0,0 +1,54 @@ +* Back to [main read-me](../README.md) + +# FreshRSS Command-Line Interface (CLI) + +## Note on access rights + +When using the command-line interface, remember that your user might not be the same as the one used by your Web server. +This might create some access right problems. + +It is recommended to invoke commands using the same user as your Web server: + +```sh +cd /usr/share/FreshRSS +sudo -u www-data sh -c './cli/list-users.php' +``` + +In any case, when you are done with a series of commands, you should re-apply the access rights: + +```sh +cd /usr/share/FreshRSS +sudo chown -R :www-data . +sudo chmod -R g+r . +sudo chmod -R g+w ./data/ +``` + + +## Commands + +Options in parenthesis are optional. + + +```sh +cd /usr/share/FreshRSS + +./cli/do-install.php --default_user admin --auth_type form ( --environment production --base_url https://rss.example.net/ --language en --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 ) +# The default database is SQLite +# Does not create the default user. Do that with ./cli/create-user.php + +./cli/create-user.php --user username ( --password 'password' --api-password 'api_password' --language en --email user@example.net --token 'longRandomString' --no-default-feeds ) + +./cli/delete-user.php --user username + +./cli/list-users.php +# Return a list of users, with the default/admin user first + +./cli/actualize-user.php --user username + +./cli/import-for-user.php --user username --filename /path/to/file.ext + +./cli/export-opml-for-user.php --user username > /path/to/file.opml.xml + +./cli/export-zip-for-user.php --user username ( --max-feed-entries 100 ) > /path/to/file.zip + +``` -- cgit v1.2.3 From 78c2b85d1645ce2f3889bae71e971fc66b6bf554 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 24 Oct 2016 21:28:47 +0200 Subject: More CLI readme https://github.com/FreshRSS/FreshRSS/issues/1095 --- README.fr.md | 5 +++-- README.md | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.fr.md b/README.fr.md index d672b5069..95489976d 100644 --- a/README.fr.md +++ b/README.fr.md @@ -46,7 +46,8 @@ Nous sommes une communauté amicale. 2. Placez l’application sur votre serveur (la partie à exposer au Web est le répertoire `./p/`) 3. Le serveur Web doit avoir les droits d’écriture dans le répertoire `./data/` 4. Accédez à FreshRSS à travers votre navigateur Web et suivez les instructions d’installation -5. Tout devrait fonctionner :) En cas de problème, n’hésitez pas à me contacter. + * 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). ## Installation automatisée @@ -87,7 +88,7 @@ sudo chmod -R g+w ./data/ sudo ln -s /usr/share/FreshRSS/p /var/www/html/FreshRSS # Naviguez vers http://example.net/FreshRSS pour terminer l’installation. # (Si vous le faite depuis localhost, vous pourrez avoir à ajuster le réglage de votre adresse publique) -# ou utilisez [l’interface en ligne de commande](./cli/README.md) +# ou utilisez l’interface en ligne de commande # Mettre à jour FreshRSS vers une nouvelle version cd /usr/share/FreshRSS diff --git a/README.md b/README.md index fef4aeef5..f8bf5da1f 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,8 @@ We are a friendly community. 2. Dump the application on your server (expose only the `./p/` folder) 3. Add write access on `./data/` folder to the webserver user 4. Access FreshRSS with your browser and follow the installation process -5. Everything should be working :) If you encounter any problem, feel free to contact me. + * 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). ## Automated install @@ -87,7 +88,7 @@ sudo chmod -R g+w ./data/ sudo ln -s /usr/share/FreshRSS/p /var/www/html/FreshRSS # Navigate to http://example.net/FreshRSS to complete the installation. # (If you do it from localhost, you may have to adjust the setting of your public address later) -# or use the [Command-Line Interface](./cli/README.md) +# or use the Command-Line Interface # Update to a newer version of FreshRSS cd /usr/share/FreshRSS -- cgit v1.2.3