Setting up Radicale on a raspberry pi

… so I wanted to escape the monster called Google, that wants all my data but at the same time is so convenient. Setting up radicale for CalDAV was more tricky then expected, since most tutorials are outdated. In particular, there is a package in raspbian available, so there is no longer a need to pip-install. In particular:

sudo apt-get install radicale

And then

sudo vim /etc/default/radicale

remove the # before

#ENABLE_RADICALE=yes

This enables radicale to run as a server.

Next there are some permission issues with the raspbian-package. I don’t remember where I picked up the next lines, but it works:

sudo -i

service radicale stop
rm -rf /var/log/radicale
mkdir /var/log/radicale
touch /var/log/radicale/radicale.log
chown -R radicale:adm /var/log/radicale
service radicale start
exit

Since security is no issue for me (radicale runs only in my internal network, and I don’t sync while outside) the next very simple config file works for me:

sudo mv /etc/radicale/config /etc/radicale/config.backup

sudo vim /etc/radicale/config


[server]
hosts = localip:5232

[encoding]
request = utf-8
stock = utf-8

[auth]
type = htpasswd
private_users = alice, bob
htpasswd_filenalme = /etc/radicale/users
htpasswd_encryption = plain

[rights]
type = from_file
file = /etc/radicale/rights

[storage]
type = filesystem
filesystem_folder = /var/lib/radicale/collections

[logging]
config = /etc/radicale/logging
debug = TRUE

where localip is the ip of your raspberry within your local network, e.g. 192.168.0.10

The users file is simple:


alice:alicepassword
bob:bobpassword

And the rights file is roughly taken from the documentation:


[allow-everyone-read]
user: .*
collection: .*
permission: r

[owner-write]
user: .*
collection: ^%(login)s/.*$
permission: w

The idea is: Everyone can read everyones calendar, but only users themselves can edit.

Now this is not a _secure_ solution at all. When testing, it seems everyone can edit everyone’s calendar… So if you want a secure solution, just add an http proxy inbetween or … I don’t know, use owncloud or something. The important point for me was just that my wife and I have two separate calendars and we can view each others.

Then
pi@raspberrypi:~ $ sudo service radicale status
● radicale.service - LSB: Radicale CalDAV and CardDAV server
Loaded: loaded (/etc/init.d/radicale)
Active: active (running) since Fri 2016-12-23 18:28:24 UTC; 2s ago
Process: 1148 ExecStop=/etc/init.d/radicale stop (code=exited, status=0/SUCCESS)
Process: 1157 ExecStart=/etc/init.d/radicale start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/radicale.service
└─1176 /usr/bin/python /usr/bin/radicale --pid=/var/run/radicale/radicale.pid --daemo...

Dec 23 18:28:24 raspberrypi radicale[1157]: Starting Radicale CalDAV server : radicale.
Dec 23 18:28:24 raspberrypi systemd[1]: Started LSB: Radicale CalDAV and CardDAV server.

Great! If you go to http://your_local_ip:5232/ you should see

Radicale works!

Next, start e.g. Lightning, File, New Calendar, Network. Remote calendar access: Protocol is CalDAV. Location is http://your_raspi_ip:5232/alice/calendar.ics/ for alice‘ calendar, then add http://your_raspi_ip:5232/bob/calendar.ics/ for bob’s. Calendars are automatically created. Trailing slash is important!

Next I downloaded DAVdroid. DAVdroid is GPL, but if you download from play store you have to donate approx 3 Euro. I instead use F-Droid, and download from the F-Droid store the GPL’ed version for free. Next open DAVdroid, add new account, check „login with URL and username“, then

a) on Alice smartphone, create one account with URL http://your_raspi_ip:5232/alice/calendar.ics/  and username „alice“ and password „alicepassword“, and another account with the URL http://your_raspi_ip:5232/bob/calendar.ics/ and username „alice“and password „alicepassword“.

b) on Bob’s smartphone, do the same but with bob’s and alice’s urls and bob’s username and password.

If you sync locally like me, afterwards check settings for each account (the cog-wheel in the upper right), check „sync only via WLAN“ and limit the ssid to your home wlan.

Go to the Android calendar apps, go to settings (in Android 6 it’s the button on the upper left corner), uncheck Google Sync, and instead check „calendar.ics“ both for Alice and Bob.

You can now directly edit within the Android Calendar App, and everything is synced.

A few notes:

  • The lack of true open source apps for Android is disturbing. It seems everyone is going for the quick buck, either via apps loaded with ads, or by releasing GPL’ed apps for money (i.e. re-licensing via app store). Sure that’s legally perfectly fine, and I can understand it somehow (spend zillion of hours in open source, with zero donations in return) but still, …. where is the open-source spirit?
  • This whole CalDAV thing sucks big time. I spend a whole day getting radicale to run, the documentation is missing for the crucial things (like the config files), the package on debian is broken, you have to be extremely careful when entering URLs and stuf… seriously, just enabling „sync“ for Google Calendar is way easier. Sure Google then knows again a little bit more about you, your hobbies, everything… but it’s so convenient

Update: I reverted back to Google Calendar & Contacts. That’s two clicks. In particular:

  • Radicale seemed to ignore the rights settings no matter what I set, i.e. from_file with my own definitions, owner_write, etc. So anytime Alice could edit Bobs calendar. For me, security wasn’t really a matter, however safety was – I wanted to prevent Alice from accidentally making changes to Bob’s calendar.
  • DAVDroid would suck too much battery time. At least that was my impression.
  • Syncing contacts was very annoying. Basically you first have to export your local (or Google stored) contacts and then re-import them. But re-import how and where? I finally managed to find a CardDAV add-on for Thunderbird that somehow worked, but it boiled essentially down to lot’s of manual re-edits. Moreover I couldn’t manage to sync with the add-on and radicale.
  • Radicale has no web-frontend. That however would be very convenient if one doesn’t want to rely on Thunderbird add-ons.
  • Radicale seemed to ignore the storage location I specified in the config file. That made backup quite difficult.

I could’ve tried more, maybe I’ll try nextcloud on my shared-hosting box in future. But right now I’ve already wasted almost two days on this, and it seems to me it just isn’t worth the effort…  not mentioning the administrative overhead in future. And yes, maybe DAVical or baikal or anything is easier to set up, but I doubt it.

Advertisements

4 Antworten to “Setting up Radicale on a raspberry pi”

  1. DAVdroid Says:

    Thanks for this interesting article and mentioning DAVdroid 🙂

    Please note that we (DAVdroid developers) have released DAVdroid under GPL from the very first beginning, and we actively support F-Droid distribution of DAVdroid (see related fdroiddata repo commits). What is „true open source“? In my opinion, „true open source“ is when something is published under a „true open source license“, not less and not more. Selling these products (with support, which takes much time) is one method of making a living.

    I think it should also be mentioned that we have improved the CalDAV/CardDAV ecosystem, including open-source libraries like ez-vcard, ical4j and okhttp as well as open-source (and proprietary) servers by creating qualified bug reports (which takes much time), sending patches etc…

    About the server: Radicale is surely a good choice, but there are others as well, which are often more easy to configure. At the moment we use Baikal for our own contacts/events/tasks 🙂

  2. DAVdroid Says:

    We’ve made a short survey on Twitter[1] regarding the battery thing you mentioned – seems that no one has issues on that matter… If you have more details on it we will look at it more closely!

    [1] https://twitter.com/davdroidapp/status/814839593405206529

  3. umij Says:

    Well thanks for the feedback. And yes, you perfectly abide to the license terms of the GNU GPL; I understand that’s your business model (and as for me this is more appreciated than some ad-based model) and DAVdroid is likely the least to blame for this annoying experience.

    Nevertheless I wonder how many users understand that in this case the GNU GPL implies that there is a choice to pay (for convenience to get the binary via Play Store) or not to pay (less convenience, i.e. having the hassle of compiling yourself or in this case downloading another app-store). If all users who paid had a clear understanding that there is this choice available, than that’s perfectly ok. For example I did understand that since I wasn’t just browsing through the various CalDAV adapter apps in PlayStore but reading more deeply into everything, and I chose to not pay before I was sure that I have a running and stable setup, and whether the whole setup works for me and is more convenient than Google Contacts and Calendar.

    Nevertheless I really do appreciate your developing efforts. Maybe I will give the whole thing another try using Baikal if time allows…

    Note that I also improved various open-source projects and the whole eco-system of applications in certain domains by creating qualified bug reports which took me a lot of time, sending patches etc. I still don’t charge for my apps. But I also don’t do this for a living.

  4. Norbert Says:

    Interesting. I have used OwnCloud for testing, but had big problems with Japanese names, so at the end I gave up (there is an open feature request for phonetic name support, without any progress last time I checked). Other than that, the OwnCloud Cal/CardDAV worked nicely with my Android.
    I am planning to install nextcloud and see what has changed there.

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s


%d Bloggern gefällt das: