Updated Configuration (markdown)

master
El RIDO 8 years ago
parent 6a1fb4359a
commit 084b20c96b

@ -115,14 +115,24 @@ Using a value of 0 for the seconds means to never expire this post. Remove this
In the section `[traffic]` you can add a rate `limit` in seconds. This is the time limit between creating pastes or comments from the same IP address in seconds. Set this to 0 to disable rate limiting.
If your site runs behind a reverse proxy or a load balancer, the traffic limiter will see its IP instead of the visitors. Therefore the traffic limit would be global and not per IP. You can set the HTTP `header` to use instead. In most cases this is "X_FORWARDED_FOR", but check your proxy settings to be sure.
If your site runs behind a reverse proxy or a load balancer, the traffic limiter will see that systems IP instead of the visitors IP. Therefore the traffic limit would be global and not per IP. You can set the HTTP `header` to use instead. In most cases this is "X_FORWARDED_FOR", but check your proxy settings to be sure.
Note that malicious visitors may set a different header in every request, so only enable this in a proxy installation and set it to the header you know your proxy sets or these visitors would circumvent the traffic limiter.
Note that malicious visitors may set a different header in every request, so only enable this in a proxy installation and set it to the header you know your proxy overrides or such visitors could circumvent the traffic limiter.
The option `dir` controls where the lock file is stored. Note that this directory needs to be writable for the process running PHP (i.e. your webserver, FPM or CGI process).
### purge
The section `[purge]` controls how frequently the system should look for expired pastes to remove. If an expired paste is accessed it will be immediately deleted, but if nobody accesses it any more the purge will eventually find and remove it.
As this operation can take a bit of time it is only done when a paste is created and not more frequently then the time in seconds given in the `limit` option. It defaults to running the purge at most once every 5 minutes.
To further reduce the delay caused by the purge, not more then `batchsize` pastes are purged at once.
It is suggested to only adjust the `limit` down if your installation has many users and the automatic purge isn't able to keep up with the expiration, when only a maximum of 10 pastes per 5 minutes are purged. On systems storing their data in a database instead of the filesystem (see `model` section below) the `batchsize` can safely be increased to 100 or more. The filesystem data structure is not optimized for searching, hence in that case even finding up to 10 pastes to delete can take a couple of seconds, as it needs to randomly open pastes to check their expiration time. In the database this is done with a single, simple query.
### model
The sections `[model]` and `[model_options]` control how your pastes are stored. Currently PrivateBin stores its pastes as flat files by default (`[model]` section, `class = privatebin_data`) and the option `dir` in the section `[model_options]` tells it in what folder to store them. Note that this directory needs to be writable for the process running PHP (i.e. your webserver, FPM or CGI process).
The sections `[model]` and `[model_options]` control how your pastes are stored. Currently PrivateBin stores its pastes as flat files by default (`[model]` section, `class = Filesystem`) and the option `dir` in the section `[model_options]` tells it in what folder to store them. Note that this directory needs to be writable for the process running PHP (i.e. your webserver, FPM or CGI process).
Alternatively you can store the pastes in a relational database. This is tested with MySQL and SQLite and examples for these two databases are provided in commented form. A more detailed explanation of the database feature can be found in the [installation instructions](Installation#using-a-database-instead-of-flat-files).
Alternatively you can store the pastes in a relational database (`[model]` section, `class = Database`). This is tested with MySQL, PostgreSQL and SQLite and examples for these MySQL and SQLite databases are provided in commented form. A more detailed explanation of the database feature can be found in the [installation instructions](Installation#using-a-database-instead-of-flat-files).

Loading…
Cancel
Save