1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-26 16:45:52 +00:00

Minor fixes

This commit is contained in:
Guillaume Ayoub 2017-05-27 12:06:41 +02:00
parent ad72c218c3
commit e69970ed56
10 changed files with 108 additions and 107 deletions

View file

@ -11,6 +11,7 @@ An example configuration file looks like:
```ini ```ini
[server] [server]
hosts = 0.0.0.0:5232 # Bind all addresses hosts = 0.0.0.0:5232 # Bind all addresses
[auth] [auth]
type = htpasswd type = htpasswd
htpasswd_filename = /path/to/users htpasswd_filename = /path/to/users
@ -19,35 +20,35 @@ htpasswd_encryption = bcrypt
filesystem_folder = ~/.var/lib/radicale/collections filesystem_folder = ~/.var/lib/radicale/collections
``` ```
Radicale tries to load configuration files from */etc/radicale/config*, Radicale tries to load configuration files from `/etc/radicale/config`,
*~/.config/radicale/config* and the ``RADICALE_CONFIG`` environment variable. `~/.config/radicale/config` and the `RADICALE_CONFIG` environment variable.
This behaviour can be overwritten by specifying a path with the This behaviour can be overwritten by specifying a path with the
``--config /path/to/config`` command line argument. `--config /path/to/config` command line argument.
The same example configuration via command line arguments looks like: The same example configuration via command line arguments looks like:
```sh ```shell
python3 -m radicale --config "" --server-hosts 0.0.0.0:5232 --auth-type htpasswd --htpasswd-filename /path/to/htpasswd --htpasswd-encryption bcrypt python3 -m radicale --config "" --server-hosts 0.0.0.0:5232 --auth-type htpasswd --htpasswd-filename /path/to/htpasswd --htpasswd-encryption bcrypt
``` ```
The ``--config ""`` argument is required to stop Radicale from trying The `--config ""` argument is required to stop Radicale from trying
to load configuration files. Run ``python3 -m radicale --help`` for more information. to load configuration files. Run `python3 -m radicale --help` for more information.
In the following, all configuration categories and options are described. In the following, all configuration categories and options are described.
## server ## server
Most configuration options in this category are only relevant in standalone Most configuration options in this category are only relevant in standalone
mode. All options beside ``max_content_length`` and ``realm`` are ignored, mode. All options beside `max_content_length` and `realm` are ignored,
when Radicale runs via WSGI. when Radicale runs via WSGI.
### hosts ### hosts
A comma separated list of addresses that the server will bind to. A comma separated list of addresses that the server will bind to.
Default: ``127.0.0.1:5555`` Default: `127.0.0.1:5555`
### daemon ### daemon
Daemonize the Radicale process. It does not reset the umask or double fork. Daemonize the Radicale process. It does not reset the umask or double fork.
Default: ``False`` Default: `False`
### pid ### pid
If daemon mode is enabled, Radicale will write its PID to this file. If daemon mode is enabled, Radicale will write its PID to this file.
@ -55,39 +56,39 @@ If daemon mode is enabled, Radicale will write its PID to this file.
Default: Default:
### max_connections ### max_connections
The maximum number of parallel connections. Set to ``0`` to disable the limit. The maximum number of parallel connections. Set to `0` to disable the limit.
Default: ``20`` Default: `20`
### max_content_length ### max_content_length
The maximum size of the request body. (bytes) The maximum size of the request body. (bytes)
Default: ``10000000`` Default: `10000000`
### timeout ### timeout
Socket timeout. (seconds) Socket timeout. (seconds)
Default: ``10`` Default: `10`
### ssl ### ssl
Enable transport layer encryption. Enable transport layer encryption.
Default: ``False`` Default: `False`
### certificate ### certificate
Path of the SSL certifcate. Path of the SSL certifcate.
Default: ``/etc/ssl/radicale.cert.pem`` Default: `/etc/ssl/radicale.cert.pem`
### key ### key
Path to the private key for SSL. Only effective if ``ssl`` is enabled. Path to the private key for SSL. Only effective if `ssl` is enabled.
Default: ``/etc/ssl/radicale.key.pem`` Default: `/etc/ssl/radicale.key.pem`
### protocol ### protocol
SSL protocol used. See python's ssl module for available values. SSL protocol used. See python's ssl module for available values.
Default: ``PROTOCOL_TLSv1_2`` Default: `PROTOCOL_TLSv1_2`
### ciphers ### ciphers
Available ciphers for SSL. See python's ssl module for available ciphers. Available ciphers for SSL. See python's ssl module for available ciphers.
@ -97,23 +98,23 @@ Default:
### dns_lookup ### dns_lookup
Reverse DNS to resolve client address in logs. Reverse DNS to resolve client address in logs.
Default: ``True`` Default: `True`
### realm ### realm
Message displayed in the client when a password is needed. Message displayed in the client when a password is needed.
Default: ``Radicale - Password Required`` Default: `Radicale - Password Required`
## encoding ## encoding
### request ### request
Encoding for responding requests. Encoding for responding requests.
Default: ``utf-8`` Default: `utf-8`
### stock ### stock
Encoding for storing local collections Encoding for storing local collections
Default: ``utf-8`` Default: `utf-8`
## auth ## auth
### type ### type
@ -128,7 +129,7 @@ Available backends:
: Use an [Apache htpasswd file](https://httpd.apache.org/docs/current/programs/htpasswd.html) to store : Use an [Apache htpasswd file](https://httpd.apache.org/docs/current/programs/htpasswd.html) to store
usernames and passwords. usernames and passwords.
Default: ``None`` Default: `None`
### htpasswd_filename ### htpasswd_filename
Path to the htpasswd file. Path to the htpasswd file.
@ -169,7 +170,7 @@ Available methods:
: This uses UNIX [crypt(3)](http://man7.org/linux/man-pages/man3/crypt.3.html). : This uses UNIX [crypt(3)](http://man7.org/linux/man-pages/man3/crypt.3.html).
It's insecure! It's insecure!
Default: ``bcrypt`` Default: `bcrypt`
## rights ## rights
### type ### type
@ -194,10 +195,10 @@ Available backends:
`from_file` `from_file`
: Load the rules from a file. : Load the rules from a file.
Default: ``owner_only`` Default: `owner_only`
### file ### file
File for the rights backend ``from_file``. See the File for the rights backend `from_file`. See the
[Rights]({{ site.baseurl }}/logging/) page. [Rights]({{ site.baseurl }}/logging/) page.
## storage ## storage
@ -209,14 +210,14 @@ Available backends:
`multifilesystem` `multifilesystem`
: Stores the data in the filesystem. : Stores the data in the filesystem.
Default: ``multifilesystem`` Default: `multifilesystem`
### filesystem_fsync ### filesystem_fsync
Sync all changes to disk during requests. (This can impair performance.) Sync all changes to disk during requests. (This can impair performance.)
Disabling it increases the risk of data loss, when the system crashes or Disabling it increases the risk of data loss, when the system crashes or
power fails! power fails!
Default: ``True`` Default: `True`
### hook ### hook
Command that is run after changes to storage. Take a look at the Command that is run after changes to storage. Take a look at the
@ -228,17 +229,17 @@ Default:
## debug ## debug
Set the default logging level to debug. Set the default logging level to debug.
Default: ``False`` Default: `False`
### full_environment ### full_environment
Log all environment variables (including those set in the shell). Log all environment variables (including those set in the shell).
Default: ``False`` Default: `False`
### mask_passwords ### mask_passwords
Don't include passwords in logs. Don't include passwords in logs.
Default: ``True`` Default: `True`
### config ### config
Logging configuration file. See the [Logging]({{ site.baseurl }}/logging/) page. Logging configuration file. See the [Logging]({{ site.baseurl }}/logging/) page.

View file

@ -9,7 +9,7 @@ Radicale from 1.x.x to 2.0.x, please follow
our [migration guide]({{ site.baseurl }}/1to2/). You can find on GitHub the our [migration guide]({{ site.baseurl }}/1to2/). You can find on GitHub the
[documentation page for the 1.1.x versions](https://github.com/Kozea/Radicale/blob/website/pages/user_documentation.rst). [documentation page for the 1.1.x versions](https://github.com/Kozea/Radicale/blob/website/pages/user_documentation.rst).
## Install and set up ## Install and Set Up
You're new to Radicale and you want to know how to use it? Welcome aboard! You're new to Radicale and you want to know how to use it? Welcome aboard!

View file

@ -5,4 +5,4 @@ permalink: /edit/
--- ---
To change or complement the documentation create a pull requests to To change or complement the documentation create a pull requests to
https://github.com/Kozea/Radicale/tree/gh-pages. [https://github.com/Kozea/Radicale/tree/gh-pages].

View file

@ -35,8 +35,8 @@ layout: default
{{ site.title }} is really easy to install and works out-of-the-box. {{ site.title }} is really easy to install and works out-of-the-box.
</p> </p>
<pre>$ pip install radicale <pre>$ python3 -m pip install --upgrade radicale
$ radicale --verbose $ python3 -m radicale --verbose
Listening to localhost port 5232 Listening to localhost port 5232
Radicale server ready</pre> Radicale server ready</pre>

View file

@ -4,9 +4,9 @@ title: Logging
permalink: /logging/ permalink: /logging/
--- ---
Radicale logs to ``stderr``. The verbosity of the log output can be controlled Radicale logs to `stderr`. The verbosity of the log output can be controlled
with ``--debug`` command line argument or the ``debug`` configuration option in with `--debug` command line argument or the `debug` configuration option in
the ``logging`` section. the `logging` section.
This is the recommended configuration for use with modern init systems This is the recommended configuration for use with modern init systems
(like **systemd**) or if you just test Radicale in a terminal. (like **systemd**) or if you just test Radicale in a terminal.
@ -16,11 +16,11 @@ rotate them).
This is useful if the process daemonizes or if your chosen method of running This is useful if the process daemonizes or if your chosen method of running
Radicale doesn't handle logging output. Radicale doesn't handle logging output.
A logging configuration file can be specified in the ``config`` configuration A logging configuration file can be specified in the `config` configuration
option in the ``logging`` section. The file format is explained in the option in the `logging` section. The file format is explained in the
[Python Logging Module](https://docs.python.org/3/library/logging.config.html#configuration-file-format). [Python Logging Module](https://docs.python.org/3/library/logging.config.html#configuration-file-format).
An example configuration to write the log output to the file */var/log/radicale/log*: An example configuration to write the log output to the file `/var/log/radicale/log`:
```ini ```ini
[loggers] [loggers]
keys = root keys = root

View file

@ -14,7 +14,7 @@ plugin, that accepts login attempts if the username and password are equal.
The easiest way to develop and install **python** modules is The easiest way to develop and install **python** modules is
[Distutils](https://docs.python.org/3/distutils/setupscript.html). [Distutils](https://docs.python.org/3/distutils/setupscript.html).
For a minimal setup create the file **setup.py** with the following content For a minimal setup create the file `setup.py` with the following content
in an empty folder: in an empty folder:
```python ```python
@ -25,10 +25,10 @@ from distutils.core import setup
setup(packages=["silly_auth_plugin"]) setup(packages=["silly_auth_plugin"])
``` ```
In the same folder create the sub-folder **silly_auth_plugin**. The folder In the same folder create the sub-folder `silly_auth_plugin`. The folder
must have the same name as specified in ``packages`` above. must have the same name as specified in `packages` above.
Create the file **\_\_init\_\_.py** in the **silly_auth_plugin** folder with the Create the file `\_\_init\_\_.py` in the `silly_auth_plugin` folder with the
following content: following content:
```python ```python
@ -42,28 +42,28 @@ class Auth(BaseAuth):
``` ```
Install the python module by running the following command in the same folder Install the python module by running the following command in the same folder
as **setup.py**: as `setup.py`:
```sh ```shell
python3 -m pip install --upgrade . python3 -m pip install --upgrade .
``` ```
To make use this great creation in Radicale, set the configuration option To make use this great creation in Radicale, set the configuration option
``type`` in the ``auth`` section to ``silly_auth_plugin``. `type` in the `auth` section to `silly_auth_plugin`.
## Authentication plugins ## Authentication plugins
This plugin type is used to check login credentials. This plugin type is used to check login credentials.
The module must contain a class ``Auth`` that extends The module must contain a class `Auth` that extends
``radicale.auth.BaseAuth``. Take a look at the file *radicale/auth.py* in `radicale.auth.BaseAuth`. Take a look at the file `radicale/auth.py` in
Radicale's source code for more information. Radicale's source code for more information.
## Rights management plugins ## Rights management plugins
This plugin type is used to check if a user has access to a path. This plugin type is used to check if a user has access to a path.
The module must contain a class ``Rights`` that extends The module must contain a class `Rights` that extends
``radicale.auth.BaseAuth``. Take a look at the file *radicale/rights.py* in `radicale.auth.BaseAuth`. Take a look at the file `radicale/rights.py` in
Radicale's source code for more information. Radicale's source code for more information.
## Storage plugins ## Storage plugins
This plugin is used to store collections and items. This plugin is used to store collections and items.
The module must contain a class ``Storage`` that extends The module must contain a class `Storage` that extends
``radicale.auth.BaseStorage``. Take a look at the file *radicale/storage.py* in `radicale.auth.BaseStorage`. Take a look at the file `radicale/storage.py` in
Radicale's source code for more information. Radicale's source code for more information.

View file

@ -5,11 +5,11 @@ permalink: /proxy/
--- ---
When a everse proxy is used, the path at which Radicale is available must When a everse proxy is used, the path at which Radicale is available must
be provided via the ``X-Script-Name`` header. be provided via the `X-Script-Name` header.
Example **nginx** configuration: Example **nginx** configuration:
``` ```nginx
location /sub/folder/radicale { location /sub/folder/radicale {
proxy_pass localhost:5232/; # The / is important! proxy_pass localhost:5232/; # The / is important!
proxy_set_header X-Script-Name /radciale; proxy_set_header X-Script-Name /radciale;

View file

@ -4,12 +4,12 @@ title: Authentication and Rights
permalink: /rights/ permalink: /rights/
--- ---
This page describes the format of the rights file for the ``from_file`` This page describes the format of the rights file for the `from_file`
authentication backend. The configuration option ``file`` in the ``rights`` authentication backend. The configuration option `file` in the `rights`
section must point to the rights file. section must point to the rights file.
The recommended rights mehtod is ``owner_only``. If access to calendars The recommended rights mehtod is `owner_only`. If access to calendars
and address books outside of the home directory of users (that's */USERNAME/*) and address books outside of the home directory of users (that's `/USERNAME/`)
is granted, clients won't detect these collections and will not show them to is granted, clients won't detect these collections and will not show them to
the user. the user.
This is only useful if you access calendars and address books directly via URL. This is only useful if you access calendars and address books directly via URL.
@ -18,41 +18,41 @@ An example rights file:
```ini ```ini
# The user "admin" can read and write any collection. # The user "admin" can read and write any collection.
[admin] [admin]
user: admin user = admin
collection: .* collection = .*
permission: rw permission = rw
# Block access for the user "user" to everything. # Block access for the user "user" to everything.
[block] [block]
user: user user = user
collection: .* collection = .*
permission: permission =
# Authenticated users can read and write their own collections. # Authenticated users can read and write their own collections.
[owner-write] [owner-write]
user: .+ user = .+
collection: %(login)s/.* collection = %(login)s/.*
permission: rw permission = rw
# Everyone can read the root collection # Everyone can read the root collection
[read] [read]
user: .* user = .*
collection: collection =
permission: r permission = r
``` ```
The titles of the sections are ignored (but must be unique). The keys ``user`` The titles of the sections are ignored (but must be unique). The keys `user`
and ``collection`` contain regular expressions, that are matched against the and `collection` contain regular expressions, that are matched against the
user name and the path of the collection. Permissions from the first user name and the path of the collection. Permissions from the first
matching section are used. If no section matches, access gets denied. matching section are used. If no section matches, access gets denied.
The user name is empty for anonymous users. Therefore, the regex ``.+`` only The user name is empty for anonymous users. Therefore, the regex `.+` only
matches authenticated users and ``.*`` matches everyone (including anonymous matches authenticated users and `.*` matches everyone (including anonymous
users). users).
The path of the collection is separated by ``/`` and has no leading or trailing The path of the collection is separated by `/` and has no leading or trailing
``/``. Therefore, the path of the root collection is empty. `/`. Therefore, the path of the root collection is empty.
``%(login)s`` gets replaced by the user name and ``%(path)s`` by the path of `%(login)s` gets replaced by the user name and `%(path)s` by the path of
the collection. You can also get groups from the ``user`` regex in the the collection. You can also get groups from the `user` regex in the
``collection`` regex with ``{0}``, ``{1}``, etc. `collection` regex with `{0}`, `{1}`, etc.

View file

@ -9,9 +9,9 @@ Installation instructions can be found on the
## Configuration ## Configuration
Radicale tries to load configuration files from */etc/radicale/config*, Radicale tries to load configuration files from `/etc/radicale/config`,
*~/.config/radicale/config* and the ``RADICALE_CONFIG`` environment variable. `~/.config/radicale/config` and the `RADICALE_CONFIG` environment variable.
A custom path can be specified with the ``--config /path/to/config`` command A custom path can be specified with the `--config /path/to/config` command
line argument. line argument.
You should create a new configuration file at the desired location. You should create a new configuration file at the desired location.
@ -26,12 +26,12 @@ All configuration options are described in detail on the
In it's default configuration Radicale doesn't check user names or passwords. In it's default configuration Radicale doesn't check user names or passwords.
If the server is reachable over a network, you should change this. If the server is reachable over a network, you should change this.
First a **users** file with all user names and passwords must be created. First a `users` file with all user names and passwords must be created.
It can be stored in the same directory as the configuration file. It can be stored in the same directory as the configuration file.
The file can be created and managed with The file can be created and managed with
[htpasswd](https://httpd.apache.org/docs/current/programs/htpasswd.html): [htpasswd](https://httpd.apache.org/docs/current/programs/htpasswd.html):
```bash ```shell
# Create a new htpasswd file with the user "user1" # Create a new htpasswd file with the user "user1"
$ htpasswd -B -c /path/to/users user1 $ htpasswd -B -c /path/to/users user1
New password: New password:
@ -43,7 +43,7 @@ Re-type new password:
``` ```
**bcrypt** is used to secure the passwords. Radicale required additional **bcrypt** is used to secure the passwords. Radicale required additional
dependencies for this encryption method: dependencies for this encryption method:
```bash ```shell
$ python3 -m pip install --upgrade passlib $ python3 -m pip install --upgrade passlib
$ python3 -m pip install --upgrade bcrypt $ python3 -m pip install --upgrade bcrypt
``` ```
@ -71,7 +71,7 @@ More addresses can be added (separated by commas).
## Storage ## Storage
Data is stored in the folder */var/lib/radicale/collections*. The path can Data is stored in the folder `/var/lib/radicale/collections`. The path can
be changed with the foloowing configuration: be changed with the foloowing configuration:
```ini ```ini
@ -103,8 +103,8 @@ requirements.
### Linux with systemd as a user ### Linux with systemd as a user
Create the file *~/.config/systemd/user/radicale.service*: Create the file `~/.config/systemd/user/radicale.service`:
``` ```ini
[Unit] [Unit]
Description=A simple CalDAV (calendar) and CardDAV (contact) server Description=A simple CalDAV (calendar) and CardDAV (contact) server
@ -119,7 +119,7 @@ You may have to add addition command line arguments to Radicale for the
configuration file, etc. configuration file, etc.
To enable and manage the service run: To enable and manage the service run:
```bash ```shell
# Enable the service # Enable the service
$ systemctl --user enable radicale $ systemctl --user enable radicale
# Start the service # Start the service
@ -136,8 +136,8 @@ Create the **radicale** user and group for the Radicale service.
The configuration files must be readable by this user and the storage folder The configuration files must be readable by this user and the storage folder
must be writable. must be writable.
Create the file */etc/systemd/system/radicale.service*: Create the file `/etc/systemd/system/radicale.service`:
``` ```ini
[Unit] [Unit]
Description=A simple CalDAV (calendar) and CardDAV (contact) server Description=A simple CalDAV (calendar) and CardDAV (contact) server
@ -153,7 +153,7 @@ You may have to add addition command line arguments to Radicale for the
configuration file, etc. configuration file, etc.
To enable and manage the service run: To enable and manage the service run:
```bash ```shell
# Enable the service # Enable the service
$ systemctl enable radicale $ systemctl enable radicale
# Start the service # Start the service
@ -170,8 +170,8 @@ $ journalctl --unit radicale.service
## Classic daemonization ## Classic daemonization
Set the configuration option ``daemon`` in the section ``server`` to ``True``. Set the configuration option `daemon` in the section `server` to `True`.
You may want to set the option ``pid`` to the path of a PID file. You may want to set the option `pid` to the path of a PID file.
After daemonization the server will not log anything. You have to configure After daemonization the server will not log anything. You have to configure
[Logging]({{ site.baseurl }}/tutorial/). [Logging]({{ site.baseurl }}/tutorial/).
@ -181,15 +181,15 @@ The main process exits, after the PID file is written.
## Windows with "NSSM - the Non-Sucking Service Manager" ## Windows with "NSSM - the Non-Sucking Service Manager"
First install [NSSM](https://nssm.cc/) and start ``nssm install`` in a command First install [NSSM](https://nssm.cc/) and start `nssm install` in a command
prompt. Apply the following configuration: prompt. Apply the following configuration:
* Service name: ``Radicale`` * Service name: `Radicale`
* Application * Application
* Path: ``C:\Path\To\Python\python.exe`` * Path: `C:\Path\To\Python\python.exe`
* Arguments: ``-m radicale --config C:\Path\To\Config`` * Arguments: `-m radicale --config C:\Path\To\Config`
* I/O redirection * I/O redirection
* Error: ``C:\Path\To\Radicale.log`` * Error: `C:\Path\To\Radicale.log`
Be aware that the service runs in the local system account, you might want to change this. Managing user accounts is beyond the scope of this manual. Be aware that the service runs in the local system account, you might want to change this. Managing user accounts is beyond the scope of this manual.

View file

@ -7,18 +7,18 @@ permalink: /versioning/
This page describes how to keep track of all changes to calendars and This page describes how to keep track of all changes to calendars and
address books with **git** (or any other version control system). address books with **git** (or any other version control system).
The repository must be initialized by running ``git init`` in the file The repository must be initialized by running `git init` in the file
system folder. Internal files of Radicale can be excluded by creating the system folder. Internal files of Radicale can be excluded by creating the
file **.gitignore** with the following content: file `.gitignore` with the following content:
``` ```
.Radicale.cache .Radicale.cache
.Radicale.lock .Radicale.lock
.Radicale.tmp.* .Radicale.tmp.*
``` ```
The configuration option ``hook`` in the ``storage`` section must be set to The configuration option `hook` in the `storage` section must be set to
the following command: the following command:
```sh ```shell
git add -A && (git diff --cached --quiet || git commit -m "Changes by "%(user)s) git add -A && (git diff --cached --quiet || git commit -m "Changes by "%(user)s)
``` ```