radicale

radicale is a server for CardDAV and CalDAV. [0]

Some steps are borrowed from chaosdaten.org. [1]

ToC

Prerequisities

  • daemontools

Installation

python3.6 -m pip install radicale --user

Configuration

You can find a config on radicale's documentation page. [2]
For further hardening of the config look here. [3]

Find a TCP port, open it [4] and specify it in the config.

When using htpasswd as auth you should now create a htpasswd file. [5]

Daemon

mkdir ~/etc/run-radicale
cat <<__EOF__ > ~/etc/run-radicale/run
#!/bin/sh
exec python3.6 -m radicale -Df 2>&1
__EOF__
chmod +x ~/etc/run-radicale/run
mkdir ~/etc/run-radicale/log
cat <<__EOF__ > ~/etc/run-radicale/log/run
#!/bin/sh
exec multilog t ./main
__EOF__
chmod +x ~/etc/run-radicale/log/run
ln -s ~/etc/run-radicale ~/service/radicale

update from radicale 1.x

Stop the service:

svc -d ~/service/radicale/

Get the newest version of the 1.x tree:

python3.6 -m pip install --upgrade radicale==1.1.6 --user

If you logged your collections via git, move them somewhere safe. It is not longer supported:

mv ~/var/radicale/collections/.git ~/radicale-backup.git

Export the collections in a format the updated version can work with:

python3.6 -m radicale -Df --config ~/etc/radicale/config --export-storage ~/radicale-export/

Upgrade radicale:

python3.6 -m pip install --upgrade radicale --user

Change the run-script, because pip won't place the executable in ~/bin/ anymore; also we want to use python3.6:

sed -i \
  -e 's|~/bin/radicale|-m radicale|' \
  -e 's|python3|python3.6|' \
  service/radicale/run

Move the original, 1.x-format collections somewhere safe and place the new-format exported collections in the right place:

mv ~/var/radicale/collections ~/var/radicale/radicale-collections-1.x
mkdir ~/var/radicale/collections
mv ~/radicale-export/collection-root ~/var/radicale/collections/

Make some changes to the config:

sed -i \
  -e '/^base_prefix/d' \
  -e '/^\[git\]/d' \
  -e '/^committer/d' \
  -e '/^type = filesystem/d' \
  ~/etc/radicale/config

Restart:

svc -u ~/service/radicale/