Publish a Thunderbird Calendar in Nextcloud

I have a calendar in Nextcloud that I want to publish. Let’s call it Party. I want this to be a public link and have a readable name. I want it to be read-only. Sharing it directly from within the Calendar app in Nextcloud will unfortunately give users opportunity to use the caldav entity of the calendar – i.e. write in it. So what do we do?

Obviously, this is a task for an .ics document: a bit of a convoluted (but what standard isn’t, these days), but still quite usable document format for read-only calendar information.

All the pieces of the puzzle are all there. Thunderbird can export a calendar to a webdav share. Nextcloud will gladly share your document read-only and any other calendar application with .ics compatibility can then import your calendar.

However, there are a couple of challenges. Nextcloud normally will not export a file with a nice name and if you do enable the “custom share tokens” setting, it will not let you add a dot, so if we want a PartyCalendar.ics file, that is out of bounds. Also, Thunderbird doesn’t seem to bother with the CN or NAME parameter in an .ics document, and simply names your calender after the name of the link. If that’s gci7GRLdRkFSnjk, your parties will show up in a calendar with that very name.

So here’s what we’ll do. In Nextcloud:

  • Set the Allow users to set custom share tokens setting in our nextcloud instance to Yes/ON/Ja/True at https://example.com/settings/admin/sharing
  • Setup a new Nextcloud directory
  • Share it, read-only. This is share number 1.
  • Change the link name to something pretty, like Partyhouse
    • As a side note: you may turn off the custom share tokens immediately afterwards, the Partyhouse name will remain active
  • Create yet another share link to the same directory, this time read-write, adding a password to it. This is share number 2. Leave this link as is.

Let’s assume your read-only link, number 1, is https://example.com/s/Partyhouse Your read/write link, number 2, is https://example.com/s/gci7GRLdRkFSnjk with password g;xa@hmqg{.

In Thunderbird:

  • Go to the Calendar tab (Events and tasks – Calendar or simply type ctrl-3)
  • Make a new calendar: On My Computer, name it anything you like, for example MyParty.
  • Add all your partying events to this calendar.

Nextcloud documentation

We are almost ready now, but the Nextcloud documentation is a bit iffy. If your Nextcloud instance is at https://example.com/ and you have a public share with the value of https://example.com/s/gci7GRLdRkFSnjk, then the documentation tells you that the webdav share is accessible through https://example.com/public.php/dav/files/gci7GRLdRkFSnjk. This turns out to be unusable because Thunderbird will not recognize the username/password obligation and simply refuse with a 401 (or so).

So in Thunderbird, right click on the new calendar, choose Publish Calendar. For publishing URL use https://example.com/public.php/webdav/PartyCalendar.ics. The last part will become the name of your calendar document. Now you may wonder: isn’t this a very generic publishing URL? Well in fact: it is. But a dialog will pop up, asking for a username and a password. For username, use the last part of the sharing URL, i.e. in our example it is gci7GRLdRkFSnjk. For password, fill in the password for share number 2, in our case g;xa@hmqg{.

Click on the Publish button. If everything is fine, the button changes to “Close” and you’re done.

Now your calendar can be found on the other, public, link, i.e. on https://example.com/s/Partyhouse/PartyCalendar.ics

Happy partying!

Leave a Reply

Your email address will not be published. Required fields are marked *