From SynologyWiki
Jump to: navigation, search

Setting up a CalDav configuration for Synology

CalDav is a system to share Calendars and tasks between users. The Synology hosts the calendars. Each user must have a Software Client. CalDav clients exist for Android, iPhone, Windows, and I'm sure the are many other supported OS. For Android you can use e.g. CalendarSync which works well on my Android devices.

I tried to use the Windows CalDav client from Mozilla called Sunbird (1.0 beta 1). This document describes what I had to do to set everything up.

The CalDav functionality was introduced in DSM 3.2 so it is the minimum DSM version requirement.

To be able to activate the CalDav functionality (serverbased calendaring), the WebDav functionality (file sharing over http) must be activated before. For more security, it is recommended only to activate the https version of it.

It is possible to set up access rights so that a user has write access only on his calendars (readonly on others'). This procedure is based on this choice.

Step 1 : setting up WebDav

In the Synology admin interface, click the Web Service entry in the Control panel. Web services.jpg

In the « WebDav » tab, click « Enable WebDav HTTPS connection (change the 5006 default port if needed). Activate webdav.jpg

Click Ok.

From now, any synology user (login / password needed) may connect to the Synology with a WebDav client (for example : windows explorer : right click on the « Computer » Icon ; « add network location ») and access to any share the Synology allows to, so choose passwords carfully and set access rights with care too. Ajouter emplacement réseau.jpg

Step 2 : setting up the shares

At least one network share is needed on the syno with the apropriate access rights. Caldav calendars will be stored on those.

In the configuration panel, click on the « file share » icon. Net share.jpg

Choose or create one or more network shares. For each of them, click on the « privileges setup » button. In the window that appears, choose the « local user » display, and set access rights up per user.

Net share access rights.jpg

The best thing to do is to have users for calendars, and users for the rest. The users for the rest must have tough passwords. The users for calendar must have access only to the shares were calendars are hosted. The shares were calendars are hosted must host nothing else.

Step 3 : Activate CalDav

In the configuration Pannel, click on the Web Services icon. Web services.jpg

On the WebDav tab, click « Activate CalDav », Activate caldav.jpg

then click on the « View Calendar List » button.

Create calendar.jpg

On the window that appears, add as many calendars as you need. See the recommandations above to choose on which network share you want to put them. Share list.jpg

In the « Location » column, you find a path. You'll need it later to declare the calendar in the CalDav Client.

Step 4 : ensure that the Syno is accessible from your network(s)

Few details on this part because it depends on everyone's isp and configuration, and it would be too long to cover everything here.

If a local access only is needed, you shouldn't need any more network configuration. Most of the time, an access through the net is needed though.

To allow this, you must open a port on your isp router (see your isp provider for more info), forward it to the syno (WebDav https port : 5006 if you followed this procedure).

You need to have a permanent IP on internet and to remember it, or to have a domain name to which you can add an A entry with your home ip, or to use the dyndns system if you have a volatile IP.

Step 5 : find a client and configure it

With Sunbird 1.0 beta 1 (english version ; the French one didn't work) for Windows (Vista), this is how it goes :

First configure the certificates settings to allow Sunbird to communicate with the Synology. The calendars will be accessible on https://my-ip-or-dns-name:5006/MyShare/MyDirectory/MyCalendarName with :

  • my-ip-or-dns-name a way of joining the synology.

At home, « diskstation » should work by default.

From outside, see above...

  • 5006 is the default port set up in the webdav settings above (it's better (necessary most of the time) always to specify the port even if it's the default value)

  • MyShare is the network share on the Synology where the calendars are stored.

  • MyDirectory is/are the directory(ies) on the network share of the Synology where the calendars are stored.

  • MyCalendarName is the name chosen after having clicked on the « Add » button in the Calendar List in the Synology admin interface (see above).

Certificate stuff in sunbird

The Synology sends a Synology certificate when Sunbird connects to the calendars. Sunbird says that the certificate is not regognised, and is self signed. The access to the calendars is then impossible. To bypass this, you must set up a certificate exception in sunbird there

Sunbird certif.jpg

Then, you register the calendar(s) with what follows

Sunbird subscribe.jpg

Sunbird remote.jpg

Sunbird url.jpg

The hole url is : https://my-ip-or-dns-name:5006/MyShare/MyDirectory/MyCalendarName

Sunbird name.jpg

The synology user / password is now asked

Sunbird user pwd.jpg

Sundbird is still a beta version, also it works for at least me (the user who wrote this article). Sometimes, some entry won't be displayed. In the debug screen, there are some clues to help notice that there are errors, and very often to find a solution (if not, contact Mozilla... ?...).

Sunbird debug.jpg

Known bugs : The amper sign mustn't be used anywhere in the calendars* It is wise to avoid accents, even if it seemed to work at least sometimes... If an entry in not displayed anymore in Sunbird because of such an error, there are two solutions to bypass the problem : Try to use another CalDAv client to see if it works better, and correct the mistake in the entry Edit the ics files with Notepad on the Syno (experimental... but it worked once for the user of this article...)

Step 6 : think about backups !

As usual, it's very important to make backups regularly. To know how often, the good question to awnser too is : who much data do you agree to re type in if a problem happens ?

To make the backup, simply copy the files of the calendar you want to backup :

  • ics files
  • a .DAV directory with two files in it

To restore a calendar (with renaming if wanted), simply put the files back in a newly created calendar directory. If you get "access denied" messages, do the copy with the admin interface of the Synology (admin account).