{"id":812,"date":"2014-02-27T18:39:27","date_gmt":"2014-02-27T16:39:27","guid":{"rendered":"http:\/\/www.lucas-nussbaum.net\/blog\/?p=812"},"modified":"2014-02-27T18:39:27","modified_gmt":"2014-02-27T16:39:27","slug":"self-hosting-my-calendar-follow-up","status":"publish","type":"post","link":"https:\/\/www.lucas-nussbaum.net\/blog\/?p=812","title":{"rendered":"self-hosting my calendar, follow-up"},"content":{"rendered":"<p>Following my <a href=\"http:\/\/www.lucas-nussbaum.net\/blog\/?p=808\">blog post<\/a> on the topic, I played a bit with various options.<\/p>\n<p>But let&#8217;s explain my use case (which might be quite specific). I need to deal with three main sources of events:<\/p>\n<ul>\n<li>the Zimbra instance from my lab. It provides a CalDav interface.<\/li>\n<li>the ICS export from my University&#8217;s teaching timetable.<\/li>\n<li>a calendar for personal stuff. I don&#8217;t want to use my lab&#8217;s Zimbra for that.<\/li>\n<\/ul>\n<p>Additionally, I follow some ICS feeds for some colleagues and other events.<br \/>\nI tend to access my calendar mostly on my computer, and sometimes on my N900 phone.<\/p>\n<p>None of the web interfaces I looked at enabled me to (1) manage different calendars hosted on different CalDav servers; (2) subscribe to ICS feeds; (3) provide a CalDav interface to synchronize my phone.<\/p>\n<p>I ended up using a <a href=\"http:\/\/radicale.org\/\">radicale<\/a> instance for my personal calendar, which was extremely easy to set up. It&#8217;s unfortunately a bit slow when there are many events (1600 since 2010 in my case), so I ended up importing only future events, and I will probably have to cleanup from time to time.<\/p>\n<p>I switched to using IceDove with the Lightning add-on to manage all my calendars and ICS feeds. It&#8217;s unfortunately slower and less user-friendly than Google Calendar, but I&#8217;ll live with it.<\/p>\n<p>On my N900, I used <a href=\"https:\/\/syncevolution.org\/\">syncevolution<\/a> to synchronize my various CalDav calendars. It works fine, but understanding how to configure it is rather tricky due to the number of concepts involved (templates, databases, servers, contexts, &#8230;). The synchronization is quite slow (several minutes for the 400-events Zimbra calendar), but works.<\/p>\n<p>I also wanted a way to export my calendars to colleagues (both in a &#8220;free\/busy&#8221; version, and in a &#8220;full information&#8221; version). I quickly hacked something using ruby-agcaldav (which is not packaged in Debian, and required quite a few dependencies, but it was easy to generate packages for all of them using gem2deb &#8212; the situation with other languages did not look better).<br \/>\nThe resulting script is:<\/p>\n<p><code><br \/>\nrequire 'agcaldav'<br \/>\nrequire 'date'<\/p>\n<p>cal = AgCalDAV::Client.new(:uri => 'LABCALDAVSERVER', :user => 'xx', :password => \"xx\")<br \/>\nev = cal.find_events(:start => '2014-02-01', :end => '2200-01-01')<\/p>\n<p>cal = AgCalDAV::Client.new(:uri => 'RADICALESERVER', :user => 'xx', :password => \"xx\")<br \/>\nev2 = cal.find_events(:start => '2014-02-01', :end => '2200-01-01')<\/p>\n<p>limit = (Time::now - 7*86400).to_datetime<\/p>\n<p># create new empty calendars<br \/>\nncpriv = Icalendar::Calendar.new<br \/>\nncpub = Icalendar::Calendar.new<\/p>\n<p>(ev + ev2).each do |e|<br \/>\n  next if e.end < limit # drop old events to keep the calendar small\n\n  #\u00a0build event for the free\/busy calendar\n  pe = Icalendar::Event.new\n  pe.start = e.start\n  pe.end = e.end\n  pe.klass = \"PRIVATE\"\n  pe.transp = e.transp\n  ncpriv.add(pe)\n\n  #\u00a0build event for the calendar with event information\n  pube = Icalendar::Event.new\n  pube.start = e.start\n  pube.end = e.end\n  pube.transp = e.transp\n  if not e.klass == \"PRIVATE\"\n    pube.summary = e.summary\n    pube.location = e.location\n  end\n  ncpub.add(pube)\nend\n\n# export free\/busy calendar\nfd = File::new('xx.ics', 'w')\nfd.puts ncpriv.to_ical\nfd.close\n\n# export calendar with event information\nfd = File::new('yy-Zeeh9bie.ics', 'w')\nfd.puts ncpub.to_ical\nfd.close\n<\/code><\/p>\n<p>So, mostly everything works. The only thing that doesn't is that I haven't found a way to subscribe to an ICS feed on my N900. Any ideas?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following my blog post on the topic, I played a bit with various options. But let&#8217;s explain my use case (which might be quite specific). I need to deal with three main sources of events: the Zimbra instance from my lab. It provides a CalDav interface. the ICS export from my University&#8217;s teaching timetable. a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,13],"tags":[],"class_list":["post-812","post","type-post","status-publish","format-standard","hentry","category-asrall","category-planetdebian"],"_links":{"self":[{"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=812"}],"version-history":[{"count":2,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/812\/revisions"}],"predecessor-version":[{"id":814,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/812\/revisions\/814"}],"wp:attachment":[{"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}