Difference between revisions of "Sync"

From Maemo Leste Wiki
Jump to navigationJump to search
(Created page with "= Synchronisation = This page explains and suggests various ways of synchronising contacts, calendars and files. == Calendar, Notes, Tasks and Contacts == Synchronising cal...")
 
Line 32: Line 32:


<pre>
<pre>
https://my.nextcloud.org/remote.php/dav/addressbooks/users/username/contacts/
https://my.nextcloud.org/remote.php/dav/addressbooks/users/userhere/contacts/
</pre>
</pre>


Line 124: Line 124:


If you run into problems with TLS Chain validation, first try to figure out if the problem is on your end. Syncevolution did have a problem for me validation the chain of my next cloud instance, so for testing purposes I set '''SSLVerifyServer = 0''' in '''/home/user/.config/syncevolution/nextcloud/peers/target-config/config.ini'''
If you run into problems with TLS Chain validation, first try to figure out if the problem is on your end. Syncevolution did have a problem for me validation the chain of my next cloud instance, so for testing purposes I set '''SSLVerifyServer = 0''' in '''/home/user/.config/syncevolution/nextcloud/peers/target-config/config.ini'''


==== Radicale synchronising ====
==== Radicale synchronising ====

Revision as of 19:05, 9 October 2022

Synchronisation

This page explains and suggests various ways of synchronising contacts, calendars and files.

Calendar, Notes, Tasks and Contacts

Synchronising calendar, notes and tasks (using CalDav) and contacts (using CardDav) can be done using syncevolution (other backends are available, but not currently documented here). A frontend to running synchronisation tasks is available in the repository (Syncevolution Frontend).

Synchronising with syncevolution CalDav + CardDav

If you get stuck in an odd state setting this up, you could consider running the following to get to a clean state, at least with regards to syncevolution configuration:

rm -rf /home/user/.config/syncevolution

NextCloud synchronising

We will be synchronising the calendar and such using local maemo-events, maemo-notes and maemo-tasks backends using the caldav backend. For contacts, we will synchronise evolution-contacts using carddav.

A few URLs are required, first, the main Nextcloud DAV url, this seems to be of the form:

https://my.nextcloud.org/remote.php/dav

then there is the url for a specific calendar, this is called the "Private Link" and you can get it by clicking "Copy Private Link" for a given calendar in Nextcloud, this might look like so:

https://my.nextcloud.org/remote.php/dav/calendars/userhere/calendarnamehere/

Finally, for your address book (contacts) synchronisation, the contacts URL is needed (in Nextcloud, go to contacts, settings, "Copy Link" for your contacts):

https://my.nextcloud.org/remote.php/dav/addressbooks/users/userhere/contacts/

Given the above, a setup to synchronise calendar, tasks, notes and contacts could look like this:

syncevolution --configure \
              --template webdav \
             username=NEXTCLOUD-USER-HERE \
             password=NEXTCLOUD-PASS-HERE \
             syncURL=MAIN-DAV-URL-HERE \
             target-config@nextcloud

syncevolution --configure \
             database=CALENDAR-URL-HERE \
             backend=caldavtodo \
             target-config@nextcloud nextcloudtodo

syncevolution --configure \
             database=CALENDAR-URL-HERE \
             backend=caldavjournal \
             target-config@nextcloud nextcloudjournal

syncevolution --configure \
             database=CALENDAR-URL-HERE \
             backend=caldav \
             target-config@nextcloud nextcloudcal

syncevolution --configure \
             database=CONTACTS-URL-HERE \
             backend=carddav \
             target-config@nextcloud contacts



syncevolution --configure \
             --template SyncEvolution_Client \
             sync=none \
             syncURL=local://@nextcloud \
             username= \
             password= \
             nextcloud

syncevolution --configure \
             sync=two-way \
             backend=maemo-tasks \
             database= \
             nextcloud nextcloudtodo

syncevolution --configure \
             sync=two-way \
             backend=maemo-notes\
             database= \
             nextcloud nextcloudjournal

syncevolution --configure \
             sync=two-way \
             backend=maemo-events \
             database= \
             nextcloud nextcloudcal

syncevolution --configure \
             sync=two-way \
             backend=evolution-contacts \
             nextcloud contacts

All of the above is configuration that only needs to be done once.

Depending on your exact situation, your initial synchronisation could only use only values from your phone, from your nextcloud, or both. If you want to merge both, my understanding is that the slow method achieves this:

syncevolution --sync slow nextcloud nextcloudjournal
syncevolution --sync slow nextcloud nextcloudtodo
syncevolution --sync slow nextcloud nextcloudcal
syncevolution --sync slow nextcloud contacts

Use the two-way synchronisation method for normal synchronisation (daily, hourly, etc synchronisations), like so:

syncevolution --sync two-way nextcloud nextcloudjournal
syncevolution --sync two-way nextcloud nextcloudtodo
syncevolution --sync two-way nextcloud nextcloudcal
syncevolution --sync two-way nextcloud contacts


Warning: TLS Chain validation issues

If you run into problems with TLS Chain validation, first try to figure out if the problem is on your end. Syncevolution did have a problem for me validation the chain of my next cloud instance, so for testing purposes I set SSLVerifyServer = 0 in /home/user/.config/syncevolution/nextcloud/peers/target-config/config.ini

Radicale synchronising

Radicale is a simple CardDAV and CalDAV server, and is set up similarly to nextcloud. Just browse to the Radicale web URL, and use the following URLs:

  1. The main DAV url is simple the URL to your radicale server (without the .web part)
  2. The calendar URL is simply the http(s) URL to the calendar that you want to synchronise
  3. The contacts URL is simple the http(s) URL of the addressbook that you want to synchronise

The username (and optional password) are the radicale credentials.

Radicale Testing Server

For testing purposes, here is how to quickly run a radicale server, this assumed it's installed.

mkdir -p ~/radicale
cd ~/radicale
python3  -m radicale --config "" --storage-filesystem-folder `pwd` -H localhost:5223 --logging-level info

Now brose to http://localhost:5223, create an account (password is optional), and you should be able to synchronise, assuming the devices can reach your radicale server (don't have it listen on localhost only, perhaps use 0.0.0.0:5223 for LAN testing)

Files synchronisation

TODO