Donnerstag, 26. Juni 2014

Updating Syncthing on a Synology DM1812+

Syncthing is a secure directory syncing tool still in its early development stages which runs on various platforms like Linux, Windows, Mac, BSD and Solaris. There are already ports for Android and the Synology NAS.

  

How to install Syncthing on a Synology Diskstation

Disclaimer: These instructions were only tested on a DM1812+ with DSM 4.0. Your mileage may vary.

Open the Package Center and add under Settings the following Package Source

http://cytec.us/spk/

Click Refresh

You'll find the Syncthing package under "Other Sources" from which it can install it as usual.



You can control Syncthing via its web interface on

http://your_diskstation_ip:7070

That's it... You find instructions on how to operate Syncthing here.

Updating Synthing

[Update Oct. 10, 2014]: This part has been superseded by this post.

Usually you would update the Syncthing package via the Package Center.

Currently (mid 2014) there are frequent updates to Syncthing which the cytek repository does not track.

Fortunately, the Synthing binary (the part that actually implements the syncthing server/client) can update itself by starting it with the -upgrade option from the command line.

However, this fails on the Diskstation with the error message

FATAL: Get https://api.github.com/repos/calmh/syncthing/releases?per_page=1: x509: failed to load system roots and no roots provided

The reason for this is that there are no ssl certificates present on the Diskstation.
On a Linux system these can be found in /etc/ssl/certs and usually end with .pem

On the Diskstation this directory is missing.

To fix this, copy the content from the Linux directory /etc/ssl/certs to a directory on the Diskstation and create a link with the name certs to this directory in /etc/ssl.

The following examples assumes:
  • your Syncthing app is installed on volume1 (determined during install)
  • you have created a shared folder on volume1 named mydata which is accessible by you
  • you've copied the certificates into a folder named linuxcerts in the just mentioned shared folder
I.e. change the path names according to your setup.

log into your Diskstation via ssh as root

mkdir -p /etc/ssl
cd /etc/ssl
ln -s /volume1/mydata/linuxcerts certs


Please note:
These certificates will not be updated automatically and they will eventually expire. So you have to refresh them from time to time manually.

And the place I choose is perhaps not the most secure one; but I'm the only one using my Diskstation. Move them somewhere else, if you want.

To upgrade the binary

  • First stop the service via the package center.
  • ssh into your box.
  • Upgrade Syncthing manually on the command line using
cd /volume1/@appstore/syncthing/bin
./syncthing -upgrade


  • Now start the service again from the package center.