aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-24 21:21:26 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-24 21:21:26 +0200
commit1e4348732dc8b58247b05d272f6f20c785165278 (patch)
treef09c59b13905b0f6002476daa9ecf456d9d18454
parentfac6c9881644160d168355af865b25285f27df82 (diff)
Readme CLI
https://github.com/FreshRSS/FreshRSS/issues/1095
-rw-r--r--CHANGELOG.md2
-rw-r--r--README.fr.md2
-rw-r--r--README.md6
-rw-r--r--cli/README.md54
4 files changed, 62 insertions, 2 deletions
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
+
+```