Running a CalDAV server on Ubuntu (2020 edition)
When playing with calDAV it makes sense to have a reference implementation to refer to. The GOLD standard ist Apple's CalendarServer with its lovely Open Source Repository.
Getting it to work on Linux (Ubuntu in my case), isn't for the faint of heart. Here is what you need to do.
File system preparation
Calendar server needs extended attributes. The default Ext4 file system does support them out of the box, but you want to check first (you might have a different file system after all):
Check if file system supports extended attributes
Check using this command:
touch test.txt
setfattr -n user.test -v "hello" test.txt
getfattr test.txt
Expected output: user.test
If the command setfattr is not available, install with sudo install attr
Enable extended atttributes if required
Important if the previous command worked, skip this step. Don't mess with fstab! Make a backup copy if required and have your emergency boot stick ready. A messed up fstab will prevent your machine from booting!
Edit /etc/fstab. In the 4th colum of the file system add user_xattr. There might be values like noatime or defaults. Add user_xattr separated by a comma. Reboot.
Install calendar server
Execute sudo apt install calendarserver postgresql.
The server wants a postgresql database, so you need to be sure to have that installed too. Apple loves Python, so there ill be quite some phython packages installed, as well as a new user caldavd Since this is a system user, its home directory is /var/spool/caldav
Read more
Posted by Stephan H Wissel on 31 January 2020 5 comments categories: calDAVProtocolsWebDevelopment