Owning my own data, part 1: Integrating a self-hosted calendar solution
156 comments
·April 10, 2025ravenstine
kridsdale1
I worked on the CalDAV client that’s in every Apple product.
I agree, the protocol sucks. But we also had a ton of trouble handling Exchange and Google’s non-compliant CalDAV server, which all the users blamed us for.
Now that I work at Google I can see that gCal apps use an entirely different protocol.
bflesch
Would be nice if you use your experience and financial stability of a Google job in order to build a better open-source protocol. Just like when ZX2C4 decided he's fed up with OpenVPN and went to create Wireguard this might be your moment to shine.
IMO the quality of software is only pushed forward by motivated individuals with the right skillset.
rsto
The JMAP for Calendars RFC [1] is soon to get published by IETF. Disclaimer: I work for Fastmail and am the co-author of RFC 8984 [2] which defines the calendar event data model used in JMAP.
[1] https://www.ietf.org/archive/id/draft-ietf-jmap-calendars-22... [2] https://www.rfc-editor.org/rfc/rfc8984.html
kridsdale1
It was 14 years ago, I’ve forgotten everything by now.
To be honest if I were to do that today, I’d vibe-code it by writing a strong set of tests against the protocol rfc, then a client against the tests. The client would be low level and have higher level interfaces in various languages.
_hyn3
"Would be nice if you use your.. financial stability of a Google job to build an open-source protocol"
Well, sure, it'd be nice if we could all spend our time building things to give away for free, but it's just not always possible. Life happens and people shouldn't have to explain or apologize for it.
noirscape
I think the core issue with CalDAV (and by extension, the protocol it's build on top of, WebDAV) is one somewhat endemic with most W3 approved standards: it's way too overengineered to do too many things at the same time rather than a lean format.
The result is a protocol that's essentially become a furball of different ideas mashed together, which inevitably leads to the situation where a lot of services just... don't try to be full spec compliant since it's out of scope for what they actually want to do.
I don't think I've ever seen a W3 data format spec that didn't end up this way, it just always seems to happen. (It doesn't seem to happen with their lower level protocol specifications.)
tannhaeuser
WebDAV is what it is because it's designed (largely by Julian Reschke who also took over the HTTP spec from TBL back then I believe) to be addable conflict-free and routable without complex payload inspection to existing HTTP services/practices. Its use of XML can be regarded over-engineered, but it follows what was available and considered adequate at a time that had much much more consideration for interoperability and multi-party buy-in than is even conceivable today. I wouldn't dismiss it so quickly, especially considering WebDAV is an IETF RFC not W3C spec to begin with.
mercutio2
WebDAV is pretty darn simple.
It just builds on actual HTTP, i.e. you have to actually think about the transport layer in a way that’s out of fashion now.
And some people don’t like XML.
It’s certainly true that CalDAV specifically is complicated, but… multi user calendaring is intrinsically very complicated.
Other systems are not less complicated, they just tend to be more vendor specific.
mbreese
The book Dreaming in Code [1] goes into great detail about how CalDAV (and WebDAV) came about through the work of the group who built the Chandler calendar program (or tried to). It’s been a while since I read it (at least 15 years), but I think it partially discusses some of the ways a protocol like this can get lost in committees during the design process. The fact that this project started around 2001 should also be informative about how long calendaring has been a problem. So, if you’d like to know about why it sucks, I’d recommend it.
It’s also a good story about the conflict between startups and open source, building products, and software development in general.
[1] http://www.dreamingincode.com/ ; https://en.m.wikipedia.org/wiki/Dreaming_in_Code
aklemm
Very good book. I read it way back when as well.
yonatan8070
I use Nextcloud's CalDAV and CardDAV with DAVx5 and it works pretty much perfectly
Jnr
I also use Nextcloud as the backend and iOS Calendar app as frontend on mobile and Gnome Calendar as frontend on PC.
It mostly works great, except for 3rd party Office365 calendars imported into Nextcloud. It has issues with some events on some clients displaying correct time when event invitees are from different time zone.
jp191919
I've been using Nextcloud as well for about 5 years now, and using Etar on my android. It's been great.
EbNar
Nextcloud calendar is a bit annoying in my case, as email reminders often come late, sometimes 10 minutes or more. I guess it's because they rely on the cron process.
edg5000
My CalDAV provider is ZOHO.
To sync with Android I use DAVX5 which runs a background sync service (open source and non-root). I had a lot of issues getting it working, could be because of different CalDAV implementations. DAVX5 to ZOHO calendar sync takes forever.
Evolution on Ubuntu has pretty good CalDAV support, but it would refresh the entire calendar each time upon switchin between the mail view and calendar view. Refreshing that ZOHO calendar takes forever and ZOHO has pretty frugal rate limits, so it ends up soft-banning me.
Latest Thunderbird has a CaldDAV incompatibility where it expects a different HTTP success code. ZOHO gives a 200, but Thunderbird expects something else. (PS Thunderbird CalDAV code is written in JS). PS This only happens on the second calendar. Whenever you add a second one, it starts failing.
So it is quite a pain, at least with ZOHO.
mxuribe
I also use zoho (for mail, calendar, contacts) for my family and I...and yeah the first time i set it up with DavX5, it was odd to say the least...though not sure if it was zoho's fault, or maybe both some possible glitch with zoho and DavX5, that didn't quite jive with my brain - at first. Now, i see no issues with Davx5 and zoho cal and contacts...at least it sync really well on my android phone. I have not tried Evolution for years (and certainly not with zoho yet), since i tend to default to thunderbird...But am about to set up my partner on one of the Gnome-based linux distros once their Windows 10 dies later this year...and considering how they like to use their computer and their workflow, gnome seems most appropriate for them, so have been considering suggesting for them to us Evolution as email client...so will be interesting to see how zoho works there. (Glad to hear it works for you!) As i noted, i like to use thunderbird, and as far as mail and calendar, actually i guess i have been lucky, since zoho seems to be working great for me - and for a couple of years now! However, contacts synching has never worked right - like, never at all. Sure i can export contacts from zoho and import them into thunderbird...so the issue is not the basics of contacts functionality within thunderbird per se...but the syncing between t'bird and zoho is certainly an issue, and have not had a chance to dive deeply enough to see if the issue is a t'bird issue or zoho...although like calendaring on my android phone, contact synching is not an issue with zoho from my phone (again via Davx5)...so, i'm confused. But, agreed with your points: i'm happ[y zoho customer, but they're not perfect...then again, at their low costs, i kinda can't complain too much. ;-)
NoTeslaThrow
> Instead, initially went with the approach of hosting my dynamically updating iCal file in an S3 bucket and using ICSx5 on Android to sync with it. No CalDAV needed – just HTTPS.
Well you also can't integrate this into most calendars. I don't even know what the hell an iCal file is. I haven't even heard "iCal" in what feels like decades.
> I know I will probably get pushback over this, but CalDAV sucks.
All the alternatives are worse.
ravenstine
Short for iCalendar. (.ics files)
Suppafly
[flagged]
NoTeslaThrow
> I'm not even sure you're qualified to comment then.
I'm qualified to point out that this is a hugely dickish way to communicate
eulenteufel
Another CalDav server I can recommend is Radicale. It's written in python and designed in a pretty modular way, enabling authentication and authorization (and more) plugins.
Data is saved in plain text files and I track/backup it using git.
Over the time I've accumulated some interesting modifications:
- Authentication runs with pam on the host system.
- To enable sharing of calendars I run a periodic script symlinking the calendars to all authorized users. Unfortunately this suffers from combinatiorial explosion.
- Using a rights plugin with custom CalDav Attributes and a modified web plugin I added support for access Control Lists.
- To enable public calendars you give read permissions to the `public` user using ACL. Then a nginx hack gives blanket acces for read operations:
location /public {
proxy_pass http://127.0.0.1:{%RADICALE_PORT%};
include proxy_params;
proxy_set_header Authorization "Basic {%RADICALE_PUBLIC_AUTH%}";
proxy_hide_header Authorization;
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods "GET, OPTIONS, PROPFIND";
add_header Access-Control-Allow-Headers "Depth";
limit_except GET OPTIONS PROPFIND { deny all; }
}
These public calendars are can be viewed on a web calendar (https://gitlab.nomagic.uk/popi/js_calendar_from_ics)I should probably write a blog post about the setup.
HumblyTossed
Let us know when that blog post goes live… ;)
frainfreeze
Yup, also interested in that. I have a half broken home cooked software that is basically radicale x monica crm that I would like to phase out for something better.
jesterson
This. Have been using Radicale for years. Except occasional issues with BusyCal it's been a very smooth ride.
emacsen
This is exactly the post I've needed.
I have two calendars, one on my personal server running Mailcow (SoGO) and my work calendar with Fastmail.
They don't work together- I've never found a way to get mailcow's calendar to work with other tools well, and so I spend time syncing between them semi-manually.
I've wanted to de-couple the calendar for a while but the only alternative I knew about was Nextcloud, which I think is a bit heavy weight.
This Baïkal looks great and I can't wait to give it a try. Doing this will also allow me to explore changing out Mailcow for another self-hosted mail service.
axegon_
I too have been on a very aggressive mission to decloudify myself lately(as in, since comrade musk and co took over everything and I have 0 reason to trust him or anyone around him). And to be fair, for all the hundreds of gigabytes of data I have, the migration took no longer than two weeks, on and off, and it works infinitely better than I was hoping. The only service I've outsourced is email since I hate dealing with MX records, IMAP/SMTP. For everything else, the one thing that did wonders was an Asus PN40 with a dual core celeron CPU. It's biggest strength is that it's both accessible and has a slot for an M.2 NVME and a SATA drive so you can have a safe backup in one spot. I too share the opinion that CalDAV is kind of sketchy. That said, Nextcloud covered most of my needs(although it can be slow for some things, even with redis backing it up). Calendars, dropbox/google drive, docs, photos, backups and automatic syncing - it covers everything really well. That, combined with several other open source solutions truly cover all my needs(music and video streaming, monitoring, alerting, vpn, readers, management, and various other utilities). And as under-powered this mini PC is, it handles everything insanely well with lots of room to spare, given that my ISP is a solid 10/10. In fact it would be perfectly capable of handling another 5-6 people like me with ease.
Tijdreiziger
> It's biggest strength is that it's both accessible and has a slot for an M.2 NVME and a SATA drive so you can have a safe backup in one spot.
If you want to increase the resiliency of your data, look up the 3-2-1 backup strategy (and maybe also RAID).
axegon_
It is next in the pipeline but I need to clean up my home lab first cause it's become a bit of a mess.
donatj
Everything old is new again.
Back in the early 2000's I used Mozilla Sunbird to host my calendar on my personal Win2k server via IIS's WebDAV module… I don't think CardDAV was a thing yet but I might be mistaken.
I ended up importing all that data from it into my Google Calendar which is kind of fun because I've got all my homework and whatnot for college courses on there if you go back far enough.
EvanAnderson
Sunbird was almost what I wanted, back in the '04 timeframe, but it seemed unstable. I lost some appointments when they never made it up to the server. I used CalDAV with Sunbird using a DAViCal server.
Sunbird was abandoned. I haven't looked recently to see if there's a reasonable replacement that might run on Windows.
EvanAnderson
Baikal looks interesting. I used DAViCal[0] in the past to share calendars between a couple of Apple iOS devices. When it worked it worked well, but as iOS versions changed it seemed to get unreliable and I eventually gave up.
When I do eventually revisit this I am going to look at DAViCal again, as well as Radicale[1], and now Baikal.
charles_f
I've used Radicale for a long time. It works well. I recently moved to next cloud, only because my shared host is handling the deployment, and it comes with an integrated web UI, which is much less hassle to setup.
ranger207
I've been using Baikal for a few years now and it's very solid, although it's just for myself and I don't have all of OP's requirements. For my desktop I just use Thunderbird's built in calendar to connect, and on my phone I use DAVx5 and Fossify Calendar from F-Droid. It's forked from Simple Mobile Tools's Calendar app, but unlike the name it's actually the most fully-featured calendar app I've seen. It's "simple" in the way that it just presents you with every option instead of forcing you do dig through half a dozen menus and dialogs to do what you want to do, which is very nice.
dariosalvi78
I have Outlook (at work) and Google Calendar (at home) and synchronising them through HTTP is completely unreliable. They seem to mess the time zone all the time, sometimes they publish in UTC, sometimes not, with the consequence of having meeting always at the wrong time.
I really don't understand how these 2 major providers cannot fix what seems to me such a basic feature.
If using my own system would solve it, I'd do it immediately, but I am afraid that it would be just the same: meeting created on Outlook and imported with 2 hours difference.
jofla_net
Timezones across google products have been hopelessly broken across apps for decades. I'm sure the AI devs will get to it tout de suite now tho.
stackskipton
They have little financial incentive to solve it because it helps with lock in.
Also, alot of companies actually prohibit syncing between personal and work due to data leakage issues.
itissid
Nice!. I would like to do something like this but for Photos. I want to get off Dropbox and Google for a while. At the top of my list are:
1. Create a memories like feature from my photos to send on my cell phone, grouping by different features I like: anniversaries, similar activities, A `Me an X(X is Spouse, family, friends etc)`, Over the years(how x has evolved over the years).
2. Be able to save photos taken from my device to my servers.
I've set up three true-nas machines in different places with 2TB of space and want to slowly build this feature.
e-clinton
I just did this with Immich. I have 2TB of photos in it and I backup my phone automatically. Using cloudflare tunnels to access remotely.
johntitorjr
same. super convenient to be able to go to photos.[domain].com for my photos. the immich android app is great too.
cloudflare tunnels is a game changer, I can't believe it's free.
FloatArtifact
> same. super convenient to be able to go to photos.[domain].com for my photos. the immich android app is great too. > > cloudflare tunnels is a game changer, I can't believe it's free.
Could you explain cloudflare tunnels are secure. I understand not punching holes through one's firewall and dealing with a residential connection that's often targeted for exploits. However, if one targets the tunnel endpoint to exploit is it more secure even though it's still exposed to the public?
snapplebobapple
Check out pangolin. You can get all the awesome of cloudflare tunnela without having your traffic sold to dat aggregators. Jims garge on youtube just did a decent video on it.
murki
If you use a synology NAS their OS (Diskstation Manager) supports this via their Photos[1] and Moments[2] apps
[1] https://www.synology.com/en-global/dsm/feature/photos [2] https://www.synology.com/en-global/dsm/feature/moments
fourseventy
I just did this a few months ago. I used PhotoPrism https://github.com/photoprism/photoprism
darkwater
I used Photoprism for over a year, even paid the "server license" and I'm now using Immich which is much more powerful, sleek, gets new features very quickly (sometimes it's even too fast paced) and in general has got much more traction with the community.
darkwater
Oh and I forgot to mention the mobile app! When I did the switch the difference was like night and day. Actually Photoprism didn't even have an official mobile app, you could just sync photos in the background with SyncThing for example and keep using your phone's photo galley app, although there was a Photoprism app as well. Immich is just a backend service like a mobile app, it's only current big defect is that it's useless if it cannot contact the server on start-up
no-reply
Nextcloud memories if you use NC already, otherwise immich is pretty good like others have mentioned
qntmfred
same. some projects in that space from a comment I made a while back https://news.ycombinator.com/item?id=39155977
easyKL
Another route is to go serverless and use DecSync. Thunderbird (or Evolution) will sync with the Android app (F-Droid available) and your Cal, your Cards, and tasks, and even RSS will be replicated on the other peers.
FloatArtifact
Interesting. I don't see any iOS support, and unfortunately it doesn't seem to be maintained.
barryhennessy
"My calendar is a true nightmare."
Check
"calendar systems suck. All of them."
Double check
"I’m trying to break off of big tech as much as I can"
I wish I could check this more ...
I've had similar needs/desires/gripes with my calendars and the terrible state of calendaring apps for a while. So thank you for scratching your own itch and sharing it with us.
I'm curious when you say that "[CalDAV] is an area begging for disruption". Can you enlighten us as to what your wishlist could be for (a) better protocol/systems/ecosystem might be? (a rant about your pain points might work too).
Thanks again!
smeej
This is the kind of thing I think about doing every so often, before realizing it would take me a lot more time, energy, and money than I'm willing to spend to save 10 minutes once a week manually copying my work events from GCal to Etar on my phone and vice versa, and both to the weekly dry erase calendar on my wall.
My recurring events are all blocked off on the calendars already ("private" for personal events on my work calendar), so it really is quite a quick update.
bob1029
I've been using WritePads and Pilot G2s to keep track of things these days.
I know I will probably get pushback over this, but CalDAV sucks. People say that it's great and that it's easy; yet if that were true there would be way more self-hosted CalDAV solutions out there and they would be far more ergonomic than what's available. I was not impressed with Radicale. Because there's really only one calendar file I wanted to serve to myself, I tried implementing my own CalDAV server just for that purpose and pretty much gave up because of how unintuitive and complicated it was merely to make a single file available. I can see why it would be needed if sharing a calendar with other people with calendar apps that support CalDAV, but I think it's kind of a waste of time if hosting a calendar for one's self.
Instead, initially went with the approach of hosting my dynamically updating iCal file in an S3 bucket and using ICSx5 on Android to sync with it. No CalDAV needed – just HTTPS.
However, FOSS calendars for Android still suck, and for some reason I couldn't get ICSx5 to work within GrapheneOS, so I now use almost the same approach but with Proton Calendar which happens to support calendars from direct links to iCal files. It's not perfect, but it suits my needs enough.
I think the author's approach for using iCalendar format is a good one, though what I've discovered is the amount of support for various iCalendar features varies drastically between calendar software. Rather than dealing with that headache, I somewhat gave up and decided to shove most metadata into the description field rather than use the respective properties.
EDIT: My use case is software I wrote to grab data from various sites (Eventbrite, Meetup, pub trivia companies, public event calendars, etc.), filter for only social events I would be interested in, and combine them into a single calendar I can view in my normal calendar software.