Archive for Dezember 2016

Setting up Radicale on a raspberry pi

Dezember 24, 2016

… 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

Die zauberhafte Beruhigungskraft von Takemoto Piano

Dezember 4, 2016

Die hzB und ich sind im Moment wirklich ziemlich fertig. Konstanter Schlafentzug – nie mehr als vier Stunden am Stück – und überhaupt, gesunde Säuglinge finden immer einen Grund zum Schreien: Windel voll, Hunger auf Stillen, wollen auf den Arm, Bauchschmerzen, sind einfach mit der Gesamtsituation unzufrieden – im Bauch war bequemer, hier muss man selbst atmen, essen etc. – das nervt natürlich.

Aus Informatikersicht quasi ein nicht-deterministischer Zustandsautomat, bei dem man verschiedenste Inputs ‚reingibt (neue Windel, im Arm halten, Stillen, vor der Spülmaschine oder Dunstabzugshaube hin- und herlaufen) und hofft, dass man zwischendurch mal eine kleine Schreipause bekommt.

Die hzB fand dann auf jeden Fall dieses Video von Takemoto Piano.

Takemoto ist ein Gebrauchtpianohändler (An- und Verkauf). Naja, und die haben dann halt diesen Jingle produziert, in dem freundlich gebeten wird doch dort anzurufen, um sein gebrauchtes Klavier zu verkaufen. Und irgendeine verzweifelter Mutter oder ein verzweifelter Vater hat dann herausgefunden, dass dieser Jingle die Kleinen aus irgendeinem Grund beruhigt. Und ein einstündiges Youtubevideo daraus zusammengeschnitten. Warum sollte das funktionieren? Vielleicht, weil viel schwarz- weiß darin vorkommt, was die schon wahrnehmen können? Vielleicht weil der Jingle so eingängig ist? Vielleicht weil völlig sinnfrei vier Frauen in hautengen Kostümen mit ihren Brüsten wackeln?

Fühle ich mich schuldig, weil ich mein Kind schon in Alter von vier Wochen mit Youtube-Videos beruhige?

Etwas. Aber das Erstaunliche ist: ES FUNKTIONIERT WIRKLICH.

Die einzige Frage dabei ist allerdings, was meine Nerven mehr angreift: Eine Stunde Geschrei aus voller Lunge, oder eine Stunde dieser bescheuerte Jingle…