#10888·syncthing

More secure way to provide Syncthing relay token

Author: SigheryCreated Sep 17, 2026Updated Sep 18, 2026
Labelsenhancementneeds-triage

Feature description

Token for a relay has to be provided in clear text through a CLI flag. Would be nice if it can be provided as a file path instead. I have looked at the Syncthing Relay code and seems pretty contained, so I'd be up for implementing another flag that can take in a file for the token.

The clients too have to hardcode the value in clear text in the listenAddresses. Would be nice to somehow keep it a secret here as well, but I'm not sure how feasible that is.

Problem or use case

Right now the token leaks in clear text in a bunch of places, including logs and Systemd service definitions. I am trying to expose this functionality in the NixOS module but the reviewers are understandably wary that a secret value is provided in clear text and leaks in a bunch of places.

I have tried searching the issues, discussions and forums for this topic, but I haven't been able to find an official position on whether the token is to be considered/treated as a full secret, or if it's mostly accepted because the worst case scenario is an attacker can use your private relay to transmit E2E data.

Alternatives or workarounds

I checked the Syncthing Relay codebase a couple of times to see if the token could be provided any other way, but it seems only through a CLI flag in clear text is possible. I have not checked the main Syncthing codebase to check for alternatives to the token showing up in clear text in listenAddresses.