====== Sync with Thunderbird and Android - CardDAV & CalDAV ======
Updated for Synology DSM 6.2 and Thunderbird v68.
===== TbSync =====
* TbSync is the best sync extension I found, and is updated to the latest Thunderbird v68 as of 2019-09-08. [[https://github.com/jobisoft/TbSync/wiki/Get-the-latest-TbSync-version|Get the latest TbSync version]].
* TbSync will show it's status at the bottom right corner of Thunderbird. Click on it, then add an account with your user's credentials on the Synology NAS.
===== TbSync Account Settings for CalDAV =====
* Open Calendar Synology DSM app, then hover over your desired calendar below CALENDAR on the right
* Click the down arrow and select "CalDAV Account"
* Select the line below "Thunderbird:" and copy the url. Make sure you opened the calendar through the required protocol (HTTP or HTTPS).
* Replace the NAS machine name with the fully qualified domain name, through which the NAS can be reached from the Internet.
* Every user and calendar has a specific url.
===== TbSync Account Settings for CardDAV =====
* Every user has a specific urldomain.name.tld:/addressbooks/users/bco/addressbook/
===== Synology Reverse Proxy =====
* As of 2019-09-08 connections from a client to the Synology NAS via HTTPS break. The workaround is to tunnel the connection through a Reverse Proxy. The proxy uses HTTPS protocol, the NAS is connected regular HTTP.
* Setup the proxy through DSM's Control Panel --> Application Portal --> Reverse Proxy.
* Source
* Protocol: HTTPS
* Hostname: *
* Port: (this port must be forwarded to your NAS in your firewall)
* Enable HSTS
* Enable HTTP/2
* Destination
* Protocol: HTTP
* Hostname: localhost
* Port: 8008 (this is the HTTP port for CardDAV on your NAS, do not open this port in your firewall)
===== Migrate iCloud Contacts to Android =====
* Install DAVx5 from Play Store
* Setup CalDAV connection first, then CardDAV
* Login to icloud.com, select all contacts and export vCard
* Import the vCard file in DSM CardDAV Server
===== Links =====
* [[https://github.com/jobisoft/TbSync/wiki/How-to-get-started|TbSync]]
* [[https://github.com/jobisoft/DAV-4-TbSync/issues/77|Don't work on Synology NAS]]
* [[https://github.com/jobisoft/DAV-4-TbSync/issues/59|XML error when server sends large (response-) XML (HTTPS only)]] (scroll to the bottom last post)
* [[https://github.com/jobisoft/DAV-4-TbSync/issues/104#issuecomment-529086768|Workaround for Synology XML error]]
* [[https://www.copytrans.net/support/how-to-securely-manage-your-synology-nas-calendar/#access-synology-cal|How to securely manage your Synology NAS calendar]]
* [[https://www.synology.com/en-us/knowledgebase/DSM/tutorial/Application/How_to_Sync_Synology_Calendar_with_CalDAV_Clients|How to Sync Synology Calendar with CalDAV Clients]]
* [[https://www.youtube.com/watch?v=twQKeJx-rCg|Kalender auf der DiskStation]]
* [[https://www.synology.com/en-us/knowledgebase/DSM/tutorial/General/What_network_ports_are_used_by_Synology_services|Ports for Synology DSM]]