Difference between revisions of "Sync"

From Maemo Leste Wiki
Jump to navigationJump to search
 
(7 intermediate revisions by the same user not shown)
Line 7: Line 7:
== GUI ==
== 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)


<gallery widths=320px heights=173px>
<gallery widths=320px heights=173px>
Line 15: Line 18:


== Synchronizing with syncevolution CalDav + CardDav ==
== 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 76: Line 81:
             backend=carddav \
             backend=carddav \
             target-config@nextcloud contacts
             target-config@nextcloud contacts


syncevolution --configure \
syncevolution --configure \
Line 131: 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".
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):
<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 ===


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


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 ==
Line 149: Line 178:
=== 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 161: Line 190:
= Files synchronization =
= Files synchronization =


TODO
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 =
= Known Issues =
Line 167: Line 199:
* Synchronizing calendar to radicale gives errors if there are unnamed calendar events.
* 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.
* 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

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