Better documentation online cron (#4355)

* Better documentation online cron
#fix https://github.com/FreshRSS/FreshRSS/pull/3637#issuecomment-849073249
#fix https://github.com/FreshRSS/FreshRSS/issues/1676

* Forgotten line

* Simplify examples

* Rework structure slightly

* More clarifications
pull/4358/head
Alexandre Alapetite 2 years ago committed by GitHub
parent 80a228e9a6
commit 05d263d67c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 56
      docs/en/users/03_Main_view.md

@ -36,11 +36,9 @@ Reader view will display a feed will all articles already open for reading. Feed
To take full advantage of FreshRSS, it needs to retrieve new items from the feeds you have subscribed to. There are several ways to do this.
## Automatic update
## Automatic update with cron
This is the recommended method since you can forget about it once it is configured.
### With the actualize_script.php script
This is the recommended method.
This method is only available if you have access to the scheduled tasks of the machine on which your FreshRSS instance is installed.
@ -52,6 +50,13 @@ Here is an example to trigger article update every hour.
0 * * * * php /path/to/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1
```
## Online cron
If you do not have access to the installation server scheduled task, you can still automate the update process.
To do so, you need to create a scheduled task, which need to call a specific URL:
<https://freshrss.example.net/i/?c=feed&a=actualize> (it could be different depending on your installation). Depending on your application authentication method, you need to adapt the scheduled task.
Special parameters to configure the script - all parameters can be combined:
* Parameter "force"
@ -70,52 +75,41 @@ If *maxFeeds* is set the configured amount of feeds is refreshed at once. The de
<https://freshrss.example.net/i/?c=feed&a=actualize&token=542345872345734>
Security parameter to prevent unauthorized refreshes. For detailed Documentation see "Form authentication".
### Online cron
If you do not have access to the installation server scheduled task, you can still automate the update process.
### For Form Authentication
To do so, you need to create a scheduled task, which need to call a specific URL:
<https://freshrss.example.net/i/?c=feed&a=actualize> (it could be different depending on your installation). Depending on your application authentication method, you need to adapt the scheduled task.
If your FreshRSS instance is using Form Authentication, you can configure an authentication token to grant access to the online cron.
#### No authentication
![Token configuration](../img/users/token.1.png)
This is the most straightforward since you have a public instance; there is nothing special to configure:
You can target a specific user by adding their username to the query string, with `&user=insert-username`:
```cron
0 * * * * curl 'https://freshrss.example.net/i/?c=feed&a=actualize'
```
The scheduled task syntax should look as follows:
### Form authentication
<https://freshrss.example.net/i/?c=feed&a=actualize&maxFeeds=10&ajax=1&user=someone&token=my-token>
If you configure the application to allow anonymous reading, you can also allow anonymous users to update feeds (“Allow anonymous refresh of the articles”).
Alternatively, but not recommended, if you configure the application to allow anonymous reading, you can also allow anonymous users to update feeds (“Allow anonymous refresh of the articles”), and that does not require a token.
![Anonymous access configuration](../img/users/anonymous_access.1.png)
The URL used in the previous section will now become accessible to anyone. Therefore you can use the same syntax for the scheduled task.
### For HTTP authentication
You can also configure an authentication token to grant special access on the server.
If your FreshRSS instance is using HTTP authentication, you’ll need to provide your credentials to the scheduled task.
![Token configuration](../img/users/token.1.png)
The scheduled task syntax should look as follows:
**Note:** This method is discouraged as your credentials are stored in plain text.
```cron
0 * * * * curl 'https://freshrss.example.net/i/?c=feed&a=actualize&token=my-token'
0 * * * * curl -u alice:password123 'https://freshrss.example.net/i/?c=feed&a=actualize&maxFeeds=10&ajax=1&user=alice'
```
You can also target a different user by adding their username to the query string, with `&user=insert-username`:
On some systems, that syntax might also work:
```cron
0 * * * * curl 'https://freshrss.example.net/i/?c=feed&a=actualize&user=someone&token=my-token'
```
<https://alice:password123@freshrss.example.net/i/?c=feed&a=actualize&maxFeeds=10&ajax=1&user=alice>
### HTTP authentication
### For No authentication (None)
When using HTTP authentication, the syntax in the two previous sections is unusable. You’ll need to provide your credentials to the scheduled task. **Note that this method is highly discouraged since it means that your credentials will be in plain sight!**
If your FreshRSS instance uses no authentication (public instance, default user):
```cron
0 * * * * curl -u alice:password123 'https://freshrss.example.net/i/?c=feed&a=actualize'
```
<https://freshrss.example.net/i/?c=feed&a=actualize&maxFeeds=10&ajax=1>
## Manual update

Loading…
Cancel
Save