Failing to get syncthing working

Hi
Is there anyone willing to share a guide to properly install and configure syncthing?
My first roadblock is to go past the credentials page on the web app: the root or syncthing don’t seem to work.

Thanks in advance

Steps to follow:

  1. install the syncthing package from reForis;
  2. from the Turris OS shell or from LuCI enable the syncthing service;
  3. Edit the configuration file /etc/config/syncthing: change "option ‘enabled’ from 0 to 1.
  4. reboot the router;
  5. access the router page, which by deafult is at IP address 192.168.1.1 and you will find in the webapp screen the syncthing application;
  6. in the Turris OS shell create a directory on the external disk and with chown assign user and group owners to the syncthing user and group.
  7. select syncthing and when asked for credentials enter the root user’s credentials for LuCI;
  8. when the home screen pops up and warns you that you don’t have a password or user set up, go ahead and ignore it (unless you want a special configuration and access from the WAN as well);
  9. a warning will also appear that syncthing failed to create the Sync directory, because it cannot do so in the device home, which in standard configuration is root: it does not have sufficient privileges, because the service starts with the user syncthing. Ignore the warning and add as a directory, the one created in step 6.
  10. add as many devices as you want, on the LAN, on which syncthing is installed and with which you want to share one or more folders.

These instructions apply if your router configuration is the default and you want to access the service only from the LAN or via VPN (OpenVPN or Wireguard, for example I use the latter).
As for the IP address and listening port they are hardcoded in the service init script, but they can be overridden by the /etc/config/syncthing file. For this you will still get a warning in the web interface settings, which you can safely ignore.

If you have any particular problems or configurations in mind, please ask, I will try to help you as much as I can.

4 Likes

Thanks for the guide.
When entering root credentials on the syncthing webapp, an error is thrown: “503 Service Unavailable”.
If I check the processes running I can’t find anything related to syncthing although the service is enabled an supposed to auto-start.

True, I was forgetting a piece and now I will update my answer with the guide. In addition to being enabled, the service must also be explicitly confirmed in the configuration file /etc/config/syncthing in order to run. At the beginning of that file, by default, there is the “enabled” option set to 0, change it to 1. Then manually start the service. You will see that it works. In the guide on I will also add a part about the folder to share. In fact, syncthing tries to create a folder “Sync” in root (which is the home of the router), the Sync folder, but it fails, because the user of the syncthing service is just “syncthing” by default (you can always change it in the usual /etc/config/syncthing file), to prevent it from having too many privileges. Then after the first boot, create a folder on the external disk (highly recommended, otherwise either the service is too slow in case of SD or you burn the built-in memory) and with chown assigns user and group owners to the syncthing user and group. Then from the GUI, delete the default folder on the home screen and add the one you just created, calling it whatever you want, both on the disk and in syncthing.

2 Likes

Remember also that the service is nice, but it does not provide any kind of security to the data once it is copied to the disk. The disk itself must be encrypted, otherwise the data will only be safe as long as no one has physical access to the disk.

1 Like

When I tried to install Syncthing years ago I had similar issue. Then I chose a different way to install it. I simply run it in a dedicated VM (LXC containers).

My choice was Debian and it’s pretty straight forward. Everything is installed from Debian repos.

Thanks @lucenera, I got it working.
On my baby steps yet. Need to get things working inside my network and later venturing to OpenVPN.

Thank you

I’m glad to have been helpful to you. Only I would suggest WireGuard instead of OpenVPN. It is the new standard protocol for VPN, built into mainstream Linux, more efficient and more secure than OpenVPN. You can check out this excellent video Turris Academy #4: Site 2 Site VPN using WireGuard on Turris routers - YouTube or this still good and perfectly working guide WireGuard setup [Turris wiki].

1 Like

I noticed the same problem as described above after deinstalling and reinstalling syncthing. The first installation went well, but the second was super slow. Even very radical reinstallation by removeing the package and the syncthing directory was not helping. Perhaps this can be reproduced by others and the pre and post intall scripts of syncthing packages can perhaps cope bether with this. Perhaps some config or cache or whatever is not properly cleared or updated.

Ah, figured it out. The first installation, I used the web gui on my phone with Firefox and was reasonably responsive. The one in my Firefox browser on laptop is super slow. Same situation after reinstalls. So it might be another cause people experience slow responses in the web gui. Ungoogled Chromium on desktop however is responsive. Curious to experiences of others.

UPDATE: I think it is related to web gui over HTTPS. HTTP is responsive, HTTPS is slow and you will notice that not even the dark theme is loaded.