Blog - Unity Behind Diversity

Searching for beauty in the dissonance

Tagged: calendar

Degooglifying (Part IV): Calendar

This post is part of a series in which I am detailing my move away from centralized, proprietary network services. Previous posts in this series: email, feed reader, search.

Finding a replacement for Google Calendar has been one of the most difficult steps so far in my degooglification process, but in the end I’ve found a bunch of great, libre alternatives.

Beyond the basic criteria for free network services, I was looking for:

  • desktop, web and mobile clients
  • offline access, especially for mobile
  • multiple calendars
  • access controls for sharing calendars
  • ability to subscribe and share calendars with other servers
  • applicable for business and personal use

First Attempt: SyncML using SyncEvolution and Funambol

I started with SyncML, an open standard for syncing calendar and contact data. SyncEvolution is a great SyncML client, with both GUI and command line tools available for GNOME and Maemo GNU/Linux, and Funambol is an AGPL SyncML server, with an Android client.

I setup Funambol and migrated from Google Calendar in July 2011, using SyncEvolution on my N900 and my laptop, but there were a bunch of problems. It was unstable around the edges, not handling deletes very well, and sometimes choking and failing with certain characters ( ” maybe?) in event titles. When I tried to switch my parents over in Android, it was a nightmare trying to figure out where the sync was failing, and they eventually moved to Google Calendar instead. SyncEvolution only syncs with Evolution on the desktop; there’s no mature SyncML solution for Lightning. The Funambol free software edition felt like a bit of an afterthought as well, with poor or outdated documentation, and a crippled, totally useless “demo” web UI. There was no calendar sharing or access controls either. Plus, Funambol is a pretty heavy application, targeted at mobile carriers, not someone who wants to run it from their living room.

SyncML with Funambol and SyncEvolution allowed me to leave Google Calendar behind, but I ended up living off my mobile calendar, using Funambol essentially as a backup service. I had no web client, no shared calendars, and eventually stopped syncing to Evolution on my laptop. Part of the problem was Funambol, but part of the problem was also SyncML, which seems to be a clunky standard, designed for an older paradigm of syncing with offline mobile clients.

I quickly realized that CalDAV was the better open standard.

The Solution: CalDAV

CalDAV is an extension of WebDAV, an internet standard for remote access to calendar data. It’s a more modern standard that SyncML — though SyncML does have better support on older mobile devices. (There’s also CardDAV for contacts, but I’ll leave that for a future post.)

Servers: SOGo, ownCloud or Radicale

However, there are a ton of CalDAV servers.

Here are my favourites so far:

Application Pros Cons
SOGo
[demo]
Works with anything via connectors; well-integrated with Thunderbird/Lightning, and web UI modelled after Lightning; Ubuntu/Debian repos UI isn’t super pretty; comes with a webmail client I don’t want; heavy, took some effort to install (e.g. made a custom MySQL user auth table, in the absence of an LDAP server)
ownCloud
[demo]
Very alive; support for contacts, photos, music, etc.; Ubuntu/Debian repos Newer (immature when I first tried in 2011); seemed more of a personal than business tool, but that may have changed.This has changed. As of 2015, ownCloud is strong, mature and thriving.
Radicale Simple, elegant, light-weight For sysadmins: no UI

I tried a few others, but I wouldn’t recommend them:

  • Funambol CalDAV connector: In theory, best of both worlds with SyncML and CalDAV support, but I couldn’t figure out if there was an updated stable version, how to get it working with Funambol, etc., and this would still carry the Funambol issues and lack a web client or CardDAV support
  • DAViCal: seemed robust, but also onerous to configure and administer, and the web UI is only for administration (no web calendar client). This could work, but it just felt a bit onerous to use.
  • Update: lnxwalt mentions PHP Web Calendar, which I’d missed. I tried the online demo, but it looks/feels pretty ~2005: awkward and not fully-featured UI, focus on old standares like iCal (rather than true CalDAV?), with a CVS wishlist that includes SyncML support and a Java servlet, and import/export from Palm as a key feature, etc.

Others I didn’t bother to try:

  • Zimbra: Seemed like heavy-duty Groupware with a bunch of things I didn’t need or want — though could make sense if that’s what you’re looking for.
  • Horde (Kronolith): I did try Horde, but using the old interface a few years back. That UI felt 10+ years old, but it’s since undergone a complete overhaul and I haven’t looked at it since. Also, a groupware suite, which may be a plus or a minus. However, I don’t think it uses real CalDAV
  • Bedework: Java, seems heavy, without any obvious benefits or easy packaging
  • Apple Calendar and Contacts Server: while Apache licensed, it really doesn’t seem to be designed to enable other people to run the software — I didn’t get very far looking into this
  • Update: Jean Baptiste Favre has a great tutorial on implementing SabreDAV, a PHP library which implements WebDAV and its CalDAV and CardDAV extensions, if you want to build your own solution.

I’m using SOGo. Though, that’s partially because it was the most comprehensive solution that I had working at the time when my wife went back to work after maternity leave and we needed sharable calendars again to coordinate scheduling for childcare. But SOGo also has some nice, more advanced features, like the ability to subscribe to remote CalDAV feeds on other servers through the web UI.

I’m pretty happy with SOGo, though I’ll certainly be revisiting ownCloud and Radicale at some point. When I first tried ownCloud, it was immature, but it’s since grown a lot. And when I first tried Radicale, it was using a “strange” ACL model, but that’s been overhauled in 0.8. DAViCal was working, though it wasn’t a pleasure to configure, and I’m sure there are a few other workable servers I passed over.

I highly recommend ownCloud. At the end of 2014, I switched from SOGo to ownCloud, and have not looked back. ownCloud has a better web UI, has a much stronger and vibrant community, is alive and growing, is much easier to host (e.g. repos for popular GNU/Linux distributions, and GLAMP stack), and is useful for more than just CalDAV (I’m already using it for file syncronization and CardDAV as well).

Desktop Client: Lightning

Since I’m a Thunderbird/IceDove user, Lightning is the obvious choice for a desktop client. We also use Thunderbird at the office and in my family. Lightning also supports Google Calendar, so just like with degooglifying email, you can switch your frontend and backend in separate steps.

The Evolution calendar is pretty awkward. I tried it when I was using SyncML, but it didn’t last long. There are other options too.

Web Client: SOGo, ownCloud or CalDavZap

I’d prefer a server with a web client, like SOGo or ownCloud, but for a standalone CalDAV web client (e.g. to pair with Radicale or DAViCal), CalDavZap [demo] seems pretty cool.

Mobile Client: SyncEvolution or aCal

Maemo: The reason I spent so much time on SyncML was that there was no CalDAV client for Maemo, but now SyncEvolution supports CalDAV/CardDAV sync!

Android: Use Davdroid. It syncs CalDAV and CardDAV to native AOSP storage.

aCal is an Android CalDAV client, and a replacement for the proprietary Google calendar application. It works really well, but the UI feels really awkward and non-native. [Update: There’s also CalDAV-Sync, which I’d skipped over because it’s proprietary, but maiki pointed out that the developer at least intends to open source it eventually. I’m not sure if the Android Calendar is free software or one of the proprietary “Google experience” apps?] Both sync to local storage for offline support.

Conclusion

It took me a long time to figure this out, especially since I was focused on SyncML at first, but I’ve finally fully replaced Google Calendar with CalDAV solutions. SOGo, ownCloud and Radicale are all great CalDAV servers. SOGo and ownCloud have built-in web clients, but there’s also CalDavZap as a standalone web client. Lightning is the obvious cross-platform desktop CalDAV client of choice, and SyncEvolution and aCalDavdroid provide mobile clients for Maemo and Android.

The good news is there are plenty of options. As a bonus, most of these come with CardDAV support (which will be the focus of a future post), and ownCloud handles photos, music, and other files as well, so you may get more than just a calendar. Or, if it’s just a calendar you want, light-weight solutions like Radicale and CalDavZap give you just that.

I’m just thrilled to have finally figured this out.

Creative Commons Attribution-ShareAlike 4.0 International Permalink | Comments (20)

HOWTO: CalDAV/CardDAV Sync from N900 to SOGo using SyncEvolution

When I moved to Maemo in 2010, I was using Google Calendar. I setup a sync via Exchange and eventually Erminig, which allowed me to sync my wife’s Google calendar too. But, when I started degooglifying and moving to free network services, I left Google Calendar for Funambol, using SyncEvolution as a Maemo SyncML client.

This was far from ideal: we lost shared calendars, there was no web UI, and desktop SyncML options were lacking. I quickly realized that CalDAV would be the better long-term option. I choose SOGo as my CalDAV server, but I couldn’t find a CalDAV client for the N900. (I tried the Funambol SOGo Connector. but just couldn’t figure it out.)

I’d just about given up on a comprehensive sync solution in Maemo… until I hit the jackpot a few days ago and stumbled upon a post by Thomas Tanghus on a CalDAV/CardDAV sync from the N900 to ownCloud using SyncEvolution.

It looks like SyncEvolution gained CalDAV/CardDAV support in version 1.2 — the N900 has a CalDAV client!

CalDAV/CardDAV Sync using SyncEvolution

Thomas’ instructions were for ownCloud, but they work for any CalDAV/CardDAV server. I only ran into two issues, I think because I’d been using SyncEvolution pre-1.2. The steps included here are 90% from Thomas, with those two additions.

Reinstallation

First, I ran into the same problem as Wolfgang: the SyncEvolution WebDAV template wasn’t there when I tried to run Thomas’ first step. Wolfgang’s solution worked for me as well: just uninstall and reinstall SyncEvolution.

$ root
# apt-get remove syncevolution syncevolution-frontend
# apt-get install syncevolution syncevolution-frontend

I suspect you’ll need to do this if you initially installed SyncEvolution before it included WebDAV support.

Configuration

After reinstalling, I was successfully able to follow Thomas’ instructions (ignore the “backend failed” notices in the first command):

syncevolution --configure --template webdav username=YOURUSERNAME password=YOURPASSWORD target-config@sogo
syncevolution --configure database=CALDAVURL backend=caldav target-config@sogo calendar
syncevolution --configure database=CARDAVURL backend=carddav target-config@sogo contacts

The CalDAV URL for your default SOGo calendar is http://YOURSOGOINSTALL/dav/YOURUSERNAME/Calendar/personal and the CardDAV URL for your default SOGo addressbook is http://YOURSOGOINSTALL/dav/YOURUSERNAME/Contacts/personal. Your can right-click on any additional calendars in SOGo and select Properties > Links to find the CalDAV link for that particular calendar.

I ran into another issue with the next step in Thomas’ instructions. The above commands created new configuration files in /home/user/.config/syncevolution/sogo/, but the following commands operate on /home/user/.config/syncevolution/default/, in which I already had existing, older SyncEvolution configuration files. SyncEvolution complained about my pre-existing configuration, probably because I’d installed a much earlier version of SyncEvolution, and it said that I’d need to “migrate” with the following command:

syncevolution --migrate '@default'

Again, I suspect you’ll need to run this if you’d installed SyncEvolution pre-1.2. After this, I was able to continue with Thomas’ instructions.

In the following command, the username/password should stay blank:

syncevolution --configure --template SyncEvolution_Client sync=none syncURL=local://@sogo username= password= sogo

Then, configure the databases, backend and sync mode for calendar and contacts:

syncevolution --configure sync=two-way backend=calendar database=N900 sogo calendar
syncevolution --configure sync=two-way backend=contacts database=file:///home/user/.osso-abook/db sogo contacts

I’m running SSL on my server, so I had to add this step to get past an SSL error:
syncevolution --configure SSLVerifyServer=0 target-config@sogo

(I bet there’s a way to configure it to properly verify the SSL certificate… but I’ll save that for another day.)

Testing

To test the configuration:

syncevolution --print-items target-config@sogo calendar
syncevolution --print-items target-config@sogo contacts

If that shows the data you expect to be there, then go ahead and run your first sync.

First Sync

SyncEvolution has several sync modes. The above commands configured the default mode to be ‘two-way’, but if you have initial data on both your client and server, you’ll want to run a ‘slow’ sync first.

syncevolution --sync slow sogo

My initial slow sync took almost an hour for ~2540 calendar events and ~160 contacts.

(If you want to overwrite your client with data from the server, or vice versa, look up ‘refresh-from-client’ or ‘refresh-from-server’ instead of ‘slow’.)

Scheduling

After that initial sync, you can run a normal sync at anytime:

syncevolution sogo

While the command line is great for configuration and testing, you don’t want to open a terminal every time you want to sync your calendar. You could schedule the sync command via fcrontab, but the Maemo syncevolution-frontend GUI has a daily scheduler.

Maemo SyncEvolution Frontend

UPDATE: Syncing Multiple Calendars

I’ve adapted the above commands to create new target-configs for two other calendars I want to sync — my wife’s and my childcare calendar for my son. There may be a more elegant way to reuse the same target-config, but this works.

First, in the Calendar application, under Settings > Calendars, I created one for my wife’s calendar called “Heather” and one for my son’s calendar called “Noah.”

You can view all the available databases with the follow command:syncevolution --print-databases

You should see your new calendar listed here. It can be used by name, so long as that name is unique (and there aren’t any special characters to escape).

Then, adapting the above commands:
##### Heather
syncevolution --configure --template webdav username=MYUSERNAME password=MYPASSWORD target-config@sogoheather
syncevolution --configure database=HEATHERCALDAVURL backend=caldav target-config@sogoheather calendar
syncevolution --configure --template SyncEvolution_Client sync=none syncURL=local://@sogoheather username= password= heather@heather
# A one-way sync is fine here, because I just want to view my wife's calendar
syncevolution --configure sync=one-way-from-remote backend=calendar database=Heather heather@heather calendar
syncevolution --configure SSLVerifyServer=0 target-config@sogoheather
syncevolution --print-items target-config@sogoheather calendar
# no need for a first slow sync with one-way mode set
syncevolution heather
##### Noah
syncevolution --configure --template webdav username=MYUSERNAME password=MYPASSWORD target-config@sogonoah
syncevolution --configure database=NOAHCALDAVURL backend=caldav target-config@sogonoah calendar
syncevolution --configure --template SyncEvolution_Client sync=none syncURL=local://@sogonoah username= password= noah@noah
syncevolution --configure sync=two-way backend=calendar database=Noah noah@noah calendar
syncevolution --configure SSLVerifyServer=0 target-config@sogonoah
syncevolution --print-items target-config@sogonoah calendar
# refresh-from-remote is faster than slow, and I know the local calendar is empty
syncevolution --sync refresh-from-remote noah

YMMV and you may want different configuration for your additional calendars, but this should give you some examples for how to configure additional calendars. The key different in these commands, besides the straight replacements, is to add a unique source name to all the –configure commands from SyncEvolution_Client on (except the SSL fix for the target-config), so that the client config ends up distinct from your primary calendar above.

Lastly, using the syncevolution-frontend, I scheduled daily automatic syncs for these two calendars as well, at different times.

Conclusion

I’m not sure if there’s a more elegant/concise configuration. I’m curious if there’s some way to combine the ‘target-config’ and ‘sogo’ steps… but Thomas spent over 12 hours on this and it works, so I’m not going to mess with it. I’m just thrilled that I’ve got this up and running.

After more than a decade in proprietary software slavery, and nearly two years of wandering in the calendar/contacts desert, I’ve finally reached the promised land of seamless and libre mobile, web and desktop calendar/contact sync. [Edit: Almost: The Maemo calendar application is proprietary…] Thank you, Thomas!

Creative Commons Attribution-ShareAlike 4.0 International Permalink | Post a Comment