Search form

HTTP server HOWTO

SyncEvolution 1.0 alpha and above can act as a SyncML server over HTTP. This lets clients sync to the SyncEvoluton server, with SyncEvolution acting as a hub between servers and clients. This HOWTO focuses on the usage of the HTTP on a remote server and thus stores data in plain files instead of depending on Evolution.

Instructions

Install SyncEvolution, version 1.2 or greater.1 See the documentation for general installation instructions.2
On MeeGo 1.2, SyncEvolution 1.2 is already installed, so only the HTTP server needs to be installed. To do this, go to the ‘Applications’ panel and launch ‘Manage Apps’. Type ‘syncevolution-http-server’ in the search field at the top left, and then click the ‘Find’ button. Once the search has finished, click the checkbox next to the ‘SyncEvolution HTTP SyncML server’ package, and then click the ‘Apply’ button at the bottom right to install the package.

To start the HTTP server, on port 9000, run:
syncevo-http-server http://localhost:9000/syncevolution &
The port and path (‘syncevolution’ in this case) can be replaced with alternative values.

Setup a client to connect to the server, using the synchronization URI:
http://${host}:${port}/syncevolution
where you should replace ‘${host}’ with the host or IP address of the server, ‘${port}’ with the port and ‘syncevolution’ with the path that you chose earlier.

Start the sync process from the client now. The process will fail, so look in the output from the SyncEvolution HTTP server for the string:
[ERROR] no configuration found for deviceID XYZ123
where ‘XYZ123’ will be a string unique to the client.

Store the device ID in a shell variable:
deviceID=XYZ123
and do the same for a peer name (this can be any name that you like):
peer=myPeerName

Configure the server, by running the following commands:

# Choose a directory where SyncEvolution will# store the PIM data, using its internal file backend.# To store in some other backend, like Evolution,# you'll have to use different "type" and "evolutionsource"# values in the commands below.datapath=$HOME/some-directory

# Enable the sources the client is meant to have access to.# The real sync mode is chosen by the client; all that matters# here is that sync != disabled.syncevolution --configure \ --source-property sync=two-way \ ${peer} addressbook calendar todo memo

Start synchronization with the client again. If desired, the individual synchronization databases can be accessed by changing the sync URI to add either 'addressbook', 'calendar', 'todo' or 'memo'. For clients which only support a combined storage of events and tasks (not the case for SyncEvolution itself as client), use 'calendar+todo' for the URI. The server still stores events and tasks separately.
If the client does not allow configuring the URIs, then it is possible to set aliases on the server side via the ‘uri’ property in the commands above.

Usage notes

The server must have been started as described above whenever a client wants to synchronize. Automating this is left as an exercise to the reader…

HTTPS is probably possible by extending the way how Twisted is used and/or configured. Patches and instructions are welcome.

It is possible to manipulate items on the server by adding, removing or editing the files in ‘${datapath}’. The file modification time stamp is used to detect updated files.

In the configuration above, the server runs ‘synccompare’ at the start and end of each sync session. This can be avoided like this:
syncevolution --configure printChanges=0 ${peer}

Limitations

There are some limitations to the HTTP synchronization mode:

all processes run in the same user account

the data being synchronized is owned the that user

the processes depend on D-Bus for communicating with each other

HTTP server mode is not the primary use case, and is therefore more experimental than direct Bluetooth sync with phones, so it is only manually tested

Troubleshooting

Full log files and database dumps are stored in the directory ‘~/.cache/syncevolution’.

When the server is running, check the output of the command:
syncevolution --print-sessions ${peer}

If compiling SyncEvolution from source, pass the following flags to configure:
--enable-dbus-service --disable-ecal --disable-ebook --disable-shared↩

If using a version of SyncEvolution installed in a custom location, or compiled from source and not installed, some environment variables must be set so that SyncEvolution can find its files. A D-Bus session must be started. Both can be done automatically with syncevo-http-server --start-syncevolution --start-dbus-session↩