How to make syncthing autostart using the socks5 proxy?

I followed the instructions from the Docs and got proxy to work but when it autostarts on my linux box it does not make use of the proxy.

I eventually could get it to work as the root user but then all my Syncthing settings where gone. I was thinking maybe I need to edit the syncthing-start.desktop file and include the proxy there or some other solution?

Any tips on how to autostart syncthing using a proxy?

I guess you need to make sure the relevant environment variables are set in whatever manner is required for the auto start.

If I am on Linux where do I have to ad those environment variables if it starts from the syncthing-start.desktop file placed in the ~/.config/autostart/ as described here: Starting Syncthing Automatically — Syncthing documentation?

Wouldn´t it be cool :sunglasses: if the gui had a field to safe the proxy server :slight_smile: :slight_smile: :slight_smile: :slight_smile:

I don’t know, that’s some desktop environment thing so perhaps their documentation explain how and where to set environment variables.

No, this is the problem. This is missing in the documentation.

I’d expect adding the env variable to the Exec line in the desktop entry to work:

Exec=ALL_PROXY=<your-proxy> /usr/bin/syncthing serve --no-browser --logfile=default

I’m not sure, the prefix the command with env vars is a bash syntax, not related to the exec syscall syntax.

Suggest you check systemd docs.

Ah right. You could wrap it in /bin/bash -c "..." then, but that’s becoming a bit ugly.
This is a desktop entry implemented by the DE and speced by freedesktop though, not systemd: Desktop Entry Specification. I don’t see any dedicated config option for env variables there.