1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-29 16:55:32 +00:00
Radicale/configuration.md

265 lines
6 KiB
Markdown
Raw Normal View History

2016-08-11 19:03:50 +02:00
---
layout: page
title: Configuration
permalink: /configuration/
---
2017-05-24 19:13:47 +02:00
Radicale can be configured with a configuration file or with
command line arguments.
An example configuration file looks like:
```ini
2017-05-24 19:13:47 +02:00
[server]
# Bind all addresses
hosts = 0.0.0.0:5232
2017-05-27 12:06:41 +02:00
2017-05-24 19:13:47 +02:00
[auth]
type = htpasswd
htpasswd_filename = /path/to/users
htpasswd_encryption = bcrypt
[storage]
filesystem_folder = ~/.var/lib/radicale/collections
```
2017-05-27 12:06:41 +02:00
Radicale tries to load configuration files from `/etc/radicale/config`,
`~/.config/radicale/config` and the `RADICALE_CONFIG` environment variable.
2017-05-24 19:13:47 +02:00
This behaviour can be overwritten by specifying a path with the
2017-05-27 12:06:41 +02:00
`--config /path/to/config` command line argument.
2017-05-24 19:13:47 +02:00
The same example configuration via command line arguments looks like:
2017-05-27 12:06:41 +02:00
```shell
2017-05-24 21:12:18 +02:00
python3 -m radicale --config "" --server-hosts 0.0.0.0:5232 --auth-type htpasswd --htpasswd-filename /path/to/htpasswd --htpasswd-encryption bcrypt
2017-05-24 19:13:47 +02:00
```
2017-05-27 12:06:41 +02:00
The `--config ""` argument is required to stop Radicale from trying
to load configuration files. Run `python3 -m radicale --help` for more information.
2017-05-24 19:13:47 +02:00
In the following, all configuration categories and options are described.
## server
Most configuration options in this category are only relevant in standalone
2017-05-27 12:06:41 +02:00
mode. All options beside `max_content_length` and `realm` are ignored,
2017-05-24 19:13:47 +02:00
when Radicale runs via WSGI.
### hosts
A comma separated list of addresses that the server will bind to.
2017-05-27 12:06:41 +02:00
Default: `127.0.0.1:5555`
2017-05-24 19:13:47 +02:00
### daemon
Daemonize the Radicale process. It does not reset the umask.
2017-05-24 19:13:47 +02:00
2017-05-27 12:06:41 +02:00
Default: `False`
2017-05-24 19:13:47 +02:00
### pid
If daemon mode is enabled, Radicale will write its PID to this file.
Default:
### max_connections
2017-05-27 12:06:41 +02:00
The maximum number of parallel connections. Set to `0` to disable the limit.
2017-05-24 19:13:47 +02:00
2017-05-27 12:06:41 +02:00
Default: `20`
2017-05-24 19:13:47 +02:00
### max_content_length
The maximum size of the request body. (bytes)
2017-05-27 12:06:41 +02:00
Default: `10000000`
### timeout
Socket timeout. (seconds)
2017-05-27 12:06:41 +02:00
Default: `10`
2017-05-24 19:13:47 +02:00
### ssl
Enable transport layer encryption.
2017-05-27 12:06:41 +02:00
Default: `False`
2017-05-24 19:13:47 +02:00
### certificate
Path of the SSL certifcate.
2017-05-27 12:06:41 +02:00
Default: `/etc/ssl/radicale.cert.pem`
2017-05-24 19:13:47 +02:00
### key
2017-05-27 12:06:41 +02:00
Path to the private key for SSL. Only effective if `ssl` is enabled.
2017-05-24 19:13:47 +02:00
2017-05-27 12:06:41 +02:00
Default: `/etc/ssl/radicale.key.pem`
2017-05-24 19:13:47 +02:00
### protocol
SSL protocol used. See python's ssl module for available values.
2017-05-27 12:06:41 +02:00
Default: `PROTOCOL_TLSv1_2`
2017-05-24 19:13:47 +02:00
### ciphers
Available ciphers for SSL. See python's ssl module for available ciphers.
Default:
### dns_lookup
Reverse DNS to resolve client address in logs.
2017-05-27 12:06:41 +02:00
Default: `True`
2017-05-24 19:13:47 +02:00
### realm
Message displayed in the client when a password is needed.
2017-05-27 12:06:41 +02:00
Default: `Radicale - Password Required`
2017-05-24 19:13:47 +02:00
## encoding
### request
Encoding for responding requests.
2017-05-27 12:06:41 +02:00
Default: `utf-8`
2017-05-24 19:13:47 +02:00
### stock
Encoding for storing local collections
2017-05-27 12:06:41 +02:00
Default: `utf-8`
2017-05-24 19:13:47 +02:00
## auth
### type
The method to verify usernames and passwords.
Available backends:
`None`
: Just allows all usernames and passwords. It also disables rights checking.
2017-05-24 19:13:47 +02:00
`htpasswd`
: Use an [Apache htpasswd file](https://httpd.apache.org/docs/current/programs/htpasswd.html) to store
usernames and passwords.
2017-05-27 12:06:41 +02:00
Default: `None`
2017-05-24 19:13:47 +02:00
### htpasswd_filename
Path to the htpasswd file.
Default:
### htpasswd_encryption
The encryption method that is used in the htpasswd file. Use the
[htpasswd](https://httpd.apache.org/docs/current/programs/htpasswd.html)
or similar to generate this files.
Available methods:
`plain`
: Passwords are stored in plaintext. This is obviously not secure!
The htpasswd file for this can be created by hand and looks like:
```htpasswd
user1:password1
user2:password2
```
`bcrypt`
: This uses a modified version of the Blowfish stream cipher. It's very secure.
The **passlib** python module is required for this. Additionally you may need
one of the following python modules: **bcrypt**, **py-bcrypt** or **bcryptor**.
`md5`
: This uses an iterated md5 digest of the password with a salt.
The **passlib** python module is required for this.
`sha1`
: Passwords are stored as SHA1 hashes. It's insecure!
`ssha`
: Passwords are stored as salted SHA1 hashes. It's insecure!
`crypt`
2017-05-29 02:04:19 +02:00
: This uses UNIX
[crypt(3)](https://manpages.debian.org/unstable/manpages-dev/crypt.3.en.html).
2017-05-24 19:13:47 +02:00
It's insecure!
2017-05-27 12:06:41 +02:00
Default: `bcrypt`
2017-05-24 19:13:47 +02:00
## rights
### type
The backend that is used to check the access rights of collections.
The recommended backend is `owner_only`. If access to calendars
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
the user. Choosing any other method is only useful if you access calendars and
address books directly via URL.
2017-05-24 19:13:47 +02:00
Available backends:
`None`
: Everyone can read and write everything.
`authenticated`
: Authenticated users can read and write everything.
`owner_only`
: Authenticated users can read and write their own collections under the path
*/USERNAME/*.
`owner_write`
: Authenticated users can read everything and write their own collections under
the path */USERNAME/*.
`from_file`
: Load the rules from a file.
2017-05-27 12:06:41 +02:00
Default: `owner_only`
2017-05-24 19:13:47 +02:00
### file
2017-05-27 12:06:41 +02:00
File for the rights backend `from_file`. See the
[Rights]({{ site.baseurl }}/rights/) page.
2017-05-24 19:13:47 +02:00
## storage
### type
The backend that is used to store data.
Available backends:
`multifilesystem`
: Stores the data in the filesystem.
2017-05-27 12:06:41 +02:00
Default: `multifilesystem`
2017-05-24 19:13:47 +02:00
### filesystem_fsync
Sync all changes to disk during requests. (This can impair performance.)
Disabling it increases the risk of data loss, when the system crashes or
power fails!
2017-05-27 12:06:41 +02:00
Default: `True`
2017-05-24 19:13:47 +02:00
### hook
Command that is run after changes to storage. Take a look at the
[Versioning]({{ site.baseurl }}/versioning/) page for an example.
Default:
## logging
## debug
Set the default logging level to debug.
2017-05-27 12:06:41 +02:00
Default: `False`
2017-05-24 19:13:47 +02:00
### full_environment
Log all environment variables (including those set in the shell).
2017-05-27 12:06:41 +02:00
Default: `False`
2017-05-24 19:13:47 +02:00
### mask_passwords
Don't include passwords in logs.
2017-05-27 12:06:41 +02:00
Default: `True`
2017-05-24 19:13:47 +02:00
### config
Logging configuration file. See the [Logging]({{ site.baseurl }}/logging/) page.
Default:
## headers
In this section additional HTTP headers that are sent to clients can be
specified.
An example to relax the same-origin policy:
```ini
2017-05-24 19:13:47 +02:00
Access-Control-Allow-Origin = *
```