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...")
 
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Synchronisation =
This page explains and suggests various ways of synchronizing contacts, calendars and files.


This page explains and suggests various ways of synchronising contacts, calendars and files.
= Calendar, Notes, Tasks and Contacts =


== Calendar, Notes, Tasks and Contacts ==
Synchronizing calendar, notes and tasks (using CalDav) and contacts (using CardDav) can be done using syncevolution (other [https://syncevolution.org/documentation/backends/ backends are available], but not currently documented here). A frontend to running synchronization tasks is available in the repository (Syncevolution Frontend).


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


=== Synchronising with syncevolution CalDav + CardDav ===
The "Syncevolution Frontend" application is a graphical interface to syncevolution. While the interface can technically help you set up the synchronisation configuration through the graphical interface, we haven't tried it and do not have instructions for it at the moment. We only use it for scheduling and running synchronisations - the configuration still has to be done using the console, currently.
 
(Contributions welcome)
 
<gallery widths=320px heights=173px>
File:syncevolution.png|main syncevolution screen
File:syncevolution-2.png|syncevolution for a specific sync target
</gallery>
 
 
== Synchronizing with syncevolution CalDav + CardDav ==
 
First, install syncevolution using '''sudo apt-get install syncevolution'''.


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:
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:
Line 15: Line 27:
</pre>
</pre>


==== NextCloud synchronising ====
=== NextCloud synchronizing ===


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'''.
We will be synchronizing the calendar and such using local '''maemo-events''', '''maemo-notes''' and '''maemo-tasks''' backends using the '''caldav''' backend.  
For contacts, we will synchronize '''evolution-contacts''' using '''carddav'''.


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


<pre>https://my.nextcloud.org/remote.php/dav</pre>
<pre>https://my.nextcloud.org/remote.php/dav</pre>
Line 29: Line 42:
</pre>
</pre>


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


<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>


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


<pre>
<pre>
Line 46: Line 59:


syncevolution --configure \
syncevolution --configure \
              --template webdav \
             database=CALENDAR-URL-HERE \
             database=CALENDAR-URL-HERE \
             backend=caldavtodo \
             backend=caldavtodo \
Line 51: Line 65:


syncevolution --configure \
syncevolution --configure \
              --template webdav \
             database=CALENDAR-URL-HERE \
             database=CALENDAR-URL-HERE \
             backend=caldavjournal \
             backend=caldavjournal \
Line 56: Line 71:


syncevolution --configure \
syncevolution --configure \
              --template webdav \
             database=CALENDAR-URL-HERE \
             database=CALENDAR-URL-HERE \
             backend=caldav \
             backend=caldav \
Line 61: Line 77:


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


syncevolution --configure \
syncevolution --configure \
Line 110: Line 125:
</pre>
</pre>


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


<pre>
<pre>
Line 119: Line 134:
</pre>
</pre>


=== Managing and synchronising additional calendars ===


The default maemo-events / maemo-tasks / maemo-notes database is called "N900" (in the Calendar application, go to Settings, and then click on "Edit claendars") - marked as "DEFAULT_SYNC".


===== Warning: TLS Chain validation issues =====
This means that is no specific database is provided above, the synchronisation will be done against this calendar. If you have a need to have multiple remote calendars and sync them against other Maemo calendars, create a new calendar using the Calendar application (Settings -> Edit calendars -> New). For the sake of the example, call it MoreTasks.


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'''
Then, assuming you used the above nextcloud synchronisation example, run something like this (this example only syncs tasks/todo):


<pre>
syncevolution --configure \
              --template webdav \
            database=TASKS_URL \
            backend=caldavtodo \
            target-config@nextcloud moretaskstodo
syncevolution --configure \
            sync=two-way \
            backend=maemo-tasks \
            database=MoreTasks \
            nextcloud moretaskstodo
syncevolution --sync slow nextcloud nextcloudtodo
syncevolution --sync two-way nextcloud moretaskstodo
</pre>
The trick being that you specify the database name for the "database=" argument to the second syncevolution call.
=== 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'''


On Chimaera this problem should no longer exist - it was only a problem for Beowulf.


==== Radicale synchronising ====
== 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:
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:


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


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


===== Radicale Testing Server =====
=== Radicale Testing Server ===


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


<pre>
<pre>
Line 147: Line 186:
</pre>
</pre>


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)
Now browse to http://localhost:5223, create an account (password is optional), and you should be able to synchronize, 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 synchronization =
 
This section ought to discuss software that can be used for this purpose, e.g. syncthing, nextcloud, ...
 
 
Parazyd started on a GUI for nextcloud file synchronisation, here: https://github.com/maemo-leste-extras/nextcloud-sync
 
= Known Issues =
 
* Synchronizing calendar to radicale gives errors if there are unnamed calendar events.
* Synchronizing contacts to radicale gives errors if there are contacts without Firstname or Lastname.


== Files synchronisation ==
= Further reading =


TODO
The "old" Maemo page on synchronisation might prove fruitful for those wanting to port over more: https://wiki.maemo.org/Sync

Latest revision as of 10:09, 27 April 2024

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

Calendar, Notes, Tasks and Contacts

Synchronizing 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 synchronization tasks is available in the repository (Syncevolution Frontend).

GUI

The "Syncevolution Frontend" application is a graphical interface to syncevolution. While the interface can technically help you set up the synchronisation configuration through the graphical interface, we haven't tried it and do not have instructions for it at the moment. We only use it for scheduling and running synchronisations - the configuration still has to be done using the console, currently.

(Contributions welcome)


Synchronizing with syncevolution CalDav + CardDav

First, install syncevolution using sudo apt-get install syncevolution.

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 synchronizing

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

A few URLs are required, first, the main Nextcloud DAV url, this will appear like:

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) synchronization, 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 synchronize 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 \
              --template webdav \
             database=CALENDAR-URL-HERE \
             backend=caldavtodo \
             target-config@nextcloud nextcloudtodo

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

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

syncevolution --configure \
              --template webdav \
             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 synchronization method for normal synchronization (daily, hourly, etc synchronizations), 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

Managing and synchronising additional calendars

The default maemo-events / maemo-tasks / maemo-notes database is called "N900" (in the Calendar application, go to Settings, and then click on "Edit claendars") - marked as "DEFAULT_SYNC".

This means that is no specific database is provided above, the synchronisation will be done against this calendar. If you have a need to have multiple remote calendars and sync them against other Maemo calendars, create a new calendar using the Calendar application (Settings -> Edit calendars -> New). For the sake of the example, call it MoreTasks.

Then, assuming you used the above nextcloud synchronisation example, run something like this (this example only syncs tasks/todo):

syncevolution --configure \
              --template webdav \
             database=TASKS_URL \
             backend=caldavtodo \
             target-config@nextcloud moretaskstodo
syncevolution --configure \
             sync=two-way \
             backend=maemo-tasks \
             database=MoreTasks \
             nextcloud moretaskstodo
syncevolution --sync slow nextcloud nextcloudtodo
syncevolution --sync two-way nextcloud moretaskstodo

The trick being that you specify the database name for the "database=" argument to the second syncevolution call.

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

On Chimaera this problem should no longer exist - it was only a problem for Beowulf.

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 synchronize
  3. The contacts URL is simple the http(s) URL of the addressbook that you want to synchronize

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 assumes that radicale is installed.

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

Now browse to http://localhost:5223, create an account (password is optional), and you should be able to synchronize, 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 synchronization

This section ought to discuss software that can be used for this purpose, e.g. syncthing, nextcloud, ...


Parazyd started on a GUI for nextcloud file synchronisation, here: https://github.com/maemo-leste-extras/nextcloud-sync

Known Issues

  • Synchronizing calendar to radicale gives errors if there are unnamed calendar events.
  • Synchronizing contacts to radicale gives errors if there are contacts without Firstname or Lastname.

Further reading

The "old" Maemo page on synchronisation might prove fruitful for those wanting to port over more: https://wiki.maemo.org/Sync