Notes on getting a syncthing relay server running on Ubuntu 18.04LTS

published May 02, 2019 12:55   by admin ( last modified May 02, 2019 02:16 )

I created a dedicated user with a shell so that I could easier see why things did not work. It may also automagically work if you do everything right from the beginning.

It can be good to know that the server is called "strelaysrv" on Ubuntu, which the Ubuntu man page does not mention, but instead uses the "relaysrv" name.

You have to make sure the keys for the server are stored where the server can find them. One way of doing this is to supply the -keys parameter to ExecStart in systemd. For a systemd conf, see https://wiki.archlinux.org/index.php/Syncthing#Running_a_relay

Clients will not connect to the server unless they know the server's key, so you have to configure them with an id parameter and not just protocol, server and port:

relay://server.example.com:22067?id=<id string>

The key is output by the server on startup, which you can catch if you run it from the command line (if you have shell).

If you forget to incude the id of the relay server, these are the errors you get (or at least I got) on the client side:

Disconnecting from relay relay://relay.example.com:22067 due to error: EOF
c.S.listenerSupervisor: Failed service 'relay://relay.example.com:22067' (2.985913 failures of 2.000000), restarting: false, \
error: "{relay://relay.example.com:22067 relay://relay.example.com:22067} returned unexpectedly", stacktrace: [unknown stack trace]

On the server side I believe it was:

read: connection reset by peer

and:

connection refused