* [i18n] Add docs po4a script * Add proof of concept * Add a few more translations * Hush ShellCheck and shfmt * Make that list po4a-friendly * drat, this document could've probably been auto-generated * Definitive proof that it's translated from French ;-) * Add some brand spanking new French translation * More translation * Mostly finish that config page * Fix up FAQ * More contributing * Dev first steps * Let's ignore that admin stuff at the very least for now * Translate release new version, make French the source first and copy all translations Then replace French with English in the source. Much quicker than any alternative route. * And add the English translation * Minor stylistic leftover from French * Most of first steps * Forgot the extensions * Use po4a 0.56 to get rid of way too many newlines * Fix up those newlines * No point linking to Firefox integration anymore from the new user guide * Start on main view * A bunch of main view stuff * More main view * And some subscriptions before going to bed * First steps for devs * More dev first steps * Incomplete French → English dev/GH translation Because I need to ask about that mailing list thing * Fix typo in docs/en/developers/02_Github.md * Translate & complete devs/github to English * Fix up most of extensions * Is that supposed to be a non-breaking space? Let's see * Match up some users/mobile access * More users/mobile access * Add fresh French translation to Fever API * Fix typo * Match frontend todo thingies * Fix a typo * Some extensions strings * Remove Fx subscription service from the docs Cf. https://github.com/FreshRSS/FreshRSS/pull/2606 * Add translation for https://github.com/FreshRSS/FreshRSS/pull/2643 * fix typo as per https://github.com/FreshRSS/FreshRSS/pull/2643#discussion_r345433009 * Add some more French translations * Update French translation as per @aledeg comment https://github.com/FreshRSS/FreshRSS/pull/2590#discussion_r345465909 * Translate some of the meaningless stuff * Translate the rest of contributing.md to French * Fix conflicts * Translate Docker first steps to French * Update with change from #2665 * Add @aledeg corrections * Overlooked a couple @aledeg corrections thanks to GitHub autohide * Latest @aledeg suggestions
- Back to main read-me
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:
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:
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.
cd /usr/share/FreshRSS
./cli/prepare.php
# Ensure the needed directories in ./data/
./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 ]
# --auth_type can be: 'form' (default), 'http_auth' (using the Web server access control), 'none' (dangerous)
# --db-type can be: 'sqlite' (default), 'mysql' (MySQL or MariaDB), 'pgsql' (PostgreSQL)
# --base_url should be a public (routable) URL if possible, and is used for push (WebSub), for some API functions (e.g. favicons), and external URLs in FreshRSS.
# --environment can be: 'production' (default), 'development' (for additional log messages)
# --language can be: 'en' (default), 'fr', or one of the [supported languages](../app/i18n/)
# --db-prefix is an optional prefix in front of the names of the tables. We suggest using 'freshrss_'
# This command does not create the default user. Do that with ./cli/create-user.php
./cli/reconfigure.php
# Same parameters as for do-install.php. Used to update an existing installation.
./cli/create-user.php --user username [ --password 'password' --api_password 'api_password' --language en --email user@example.net --token 'longRandomString' --no_default_feeds --purge_after_months 3 --feed_min_articles_default 50 --feed_ttl_default 3600 --since_hours_posts_per_rss 168 --min_posts_per_rss 2 --max_posts_per_rss 400 ]
# --language can be: 'en' (default), 'fr', or one of the [supported languages](../app/i18n/)
./cli/update-user.php --user username [ ... ]
# Same options as create-user.php, except --no_default_feeds which is only available for create-user.php
./cli/actualize-user.php --user username
# Fetch feeds for the specified user
./cli/delete-user.php --user username
./cli/list-users.php
# Return a list of users, with the default/admin user first
./cli/user-info.php -h --user username
# -h is to use a human-readable format
# --user can be a username, or '*' to loop on all users
# Returns: 1) a * iff the user is admin, 2) the name of the user,
# 3) the date/time of last user action, 4) the size occupied,
# and the number of: 5) categories, 6) feeds, 7) read articles, 8) unread articles, 9) favourites, and 10) tags
./cli/import-for-user.php --user username --filename /path/to/file.ext
# The extension of the file { .json, .opml, .xml, .zip } is used to detect the type of import
./cli/export-sqlite-for-user.php --user username --filename /path/to/db.sqlite
# Export the user’s database to a new SQLite file.
./cli/import-sqlite-for-user.php --user username [ --force-overwrite ] --filename /path/to/db.sqlite
# Import the user’s database from an SQLite file.
# --force-overwrite will clear the target user database before import (import only works on an empty user database)
./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
./cli/db-optimize.php --user username
# Optimize database (reduces the size) for a given user (perform `OPTIMIZE TABLE` in MySQL, `VACUUM` in SQLite)
Note about cron
Some commands display informations on standard error, cron will send an email with thoses informations every time the command will be executed (exited zero or non-zero).
To avoid cron sending email on success:
@daily /usr/local/bin/my-command > /var/log/cron-freshrss-stdout.log 2>/var/log/cron-freshrss-stderr.log || cat /var/log/cron-freshrss-stderr.log
Explanations:
- /usr/local/bin/my-command > /var/log/cron-freshrss-stdout.log : redirect the standard output to a log file
- /usr/local/bin/my-command 2> /var/log/cron-freshrss-stderr.log : redirect the standard error to a log file
- || cat /var/log/cron-freshrss-stderr.log : if the exit code of /usr/local/bin/my-command is non-zero, then it send by mail the content error file.
Now, cron will send you an email only if the exit code is non-zero and with the content of the file containing the errors.
Unix piping
It is possible to invoke a command multiple times, e.g. with different usernames, thanks to the xargs -n1 command.
Example showing user information for all users which username starts with 'a':
./cli/list-users.php | grep '^a' | xargs -n1 ./cli/user-info.php -h --user
Example showing all users ranked by date of last activity:
./cli/user-info.php -h --user '*' | sort -k2 -r
Example to get the number of feeds of a given user:
./cli/user-info.php --user alex | cut -f6
Install and updates
If you want to administrate FreshRSS using git, please read our installation docs and update guidelines.