Syncthing

From ArchWiki
Revision as of 17:49, 22 April 2015 by Rumpelsepp (talk | contribs) (Installation)
Jump to navigation Jump to search

Syncthing is an open-source file synchronization client/server application, written in Go, implementing its own, equally free Block Exchange Protocol. All transit communications between syncthing nodes are encrypted, and all nodes are uniquely identified with cryptographic certificates.

Installation

You can install syncthing from the official repositories. After installing, you can either run the syncthing binary manually from a terminal, or you can utilize the syncthing@user.service. Doing this will provide a web interface on localhost port 8080. If you started syncthing manually, it should open the admin page in your browser.

Setup

After installation Syncthing already has a proper start-up configuration. You may now add new servers and/or folders by visiting the web interface. For detailed instructions on how to set up a simple network, read Syncthing's getting started.

After a successful first start, it will create the default repository at ~/Sync. You can see this in the web admin interface. On the right is the list of nodes you have added. On the left is the list of repositories, which are folders you can choose to share with other nodes.

To add another node, click "Add Node" underneath the list of nodes. You will be prompted for their Node ID (which can be found on the other machine by clicking Edit > Show ID) as well as a short name and the address. If you specify "dynamic" for the address, the syncthing announce server will be used to automatically exchange addresses between nodes. If you want to know more about Node IDs, including the cryptographic implications, you can read the appropriate syncthing discourse page.

After saving the configuration, you will be prompted to restart the syncthing server, and once restarted, the changes will be applied.

Next, you can either change the configuration of the default node (click its name and then Edit), or create a new one to share data with. Simply tick the node you wish to share the data with, and they will have permission to access it.

Use Inotify

Inotify (inode notify) is a Linux kernel subsystem that acts to extend filesystems to notice changes to the filesystem, and report those changes to applications. Syncthing does not support Inotify yet but there is an official extension module which talks to the Syncthing REST API. The usage of Inotify avoids expensive rescans every minute. The rescan interval of each folder can be safely increased to 3600 (an hour) or even 86400 (a day). syncthing-inotifyAUR can be installed from AUR. There are systemd service files available so you just have to enable and start it:

# systemctl enable syncthing-inotify@user.service
# systemctl start syncthing-inotify@user.service

Or as a user unit:

$ systemctl --user enable syncthing-inotify.service
$ systemctl --user start syncthing-inotify.service

The syncthing-inotify service requires syncthing so you don't have to start/enable syncthing seperately.

Troubleshooting

See Debugging syncthing.