Skip to content

Conversation

@Nementon
Copy link

@Nementon Nementon commented Dec 6, 2025

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

This PR replaces the hardcoded default GUI listen address --gui-address=0.0.0.0:8384 with a lookup sequence:

  1. Environment variables lookup
    • a. From STGUIADDRESS (eg: 0.0.0.0:4242)
    • b. From STGUIHOST (eg: 0.0.0.0) and/or STGUIPORT (eg: 4242)
  2. Static configuration lookup from Syncthing config.xml
  3. Default to 0.0.0.0 and 8384

Benefits of this PR and context:

After updating the container to the latest version, it was no longer possible to override the --gui-address=0.0.0.0:8384 command argument during initialization, which broke my deployment setup.
This PR introduces a flexible mechanism to control the GUI listening host and port, which is useful for deployments with race conditions or setups requiring custom configuration of the GUI endpoint.

How Has This Been Tested?

  • Built the image locally:
    docker build --no-cache --pull -t lscr.io/linuxserver/syncthing:latest .
  • Verified:
    • Starting a new built container, without previous configuration defaults to 0.0.0.0:8384
    • Updating config.xml to change gui.address, then restarting the container correctly applies the configured values
      • <address>127.0.0.1:4242</address> -> --gui-address=127.0.0.1:4242
      • <adress>:4242<address> -> --gui-address=0.0.0.0:4242
      • <address> :80 </address> -> --gui-address=0.0.0.0:80
    • Setting the environment variable STGUIHOST overrides the address
    • Setting the environment variable STGUIPORT overrides the port

This PR introduces no breaking changes.

Source / References:

  • N/A

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/syncthing/v2.0.12-pkg-8ebbaa3e-dev-b33b028a66ecb507d05375f21d36a1cfc8441428-pr-98/index.html
https://ci-tests.linuxserver.io/lspipepr/syncthing/v2.0.12-pkg-8ebbaa3e-dev-b33b028a66ecb507d05375f21d36a1cfc8441428-pr-98/shellcheck-result.xml

Tag Passed
amd64-v2.0.12-pkg-8ebbaa3e-dev-b33b028a66ecb507d05375f21d36a1cfc8441428-pr-98
arm64v8-v2.0.12-pkg-8ebbaa3e-dev-b33b028a66ecb507d05375f21d36a1cfc8441428-pr-98

@Nementon Nementon force-pushed the feat/override-gui-listen-addr-from-config-or-envs branch from b33b028 to e94bc17 Compare December 7, 2025 18:08
@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/syncthing/v2.0.12-pkg-8ebbaa3e-dev-e94bc17b87991820db373c2d963a2c2c5d2584ab-pr-98/index.html
https://ci-tests.linuxserver.io/lspipepr/syncthing/v2.0.12-pkg-8ebbaa3e-dev-e94bc17b87991820db373c2d963a2c2c5d2584ab-pr-98/shellcheck-result.xml

Tag Passed
amd64-v2.0.12-pkg-8ebbaa3e-dev-e94bc17b87991820db373c2d963a2c2c5d2584ab-pr-98
arm64v8-v2.0.12-pkg-8ebbaa3e-dev-e94bc17b87991820db373c2d963a2c2c5d2584ab-pr-98

@Nementon Nementon force-pushed the feat/override-gui-listen-addr-from-config-or-envs branch 2 times, most recently from 751ff49 to fdf7cbf Compare December 7, 2025 18:37
@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/syncthing/v2.0.12-pkg-8ebbaa3e-dev-fdf7cbf60b59e26346f8d45a394a25d8b41967a6-pr-98/index.html
https://ci-tests.linuxserver.io/lspipepr/syncthing/v2.0.12-pkg-8ebbaa3e-dev-fdf7cbf60b59e26346f8d45a394a25d8b41967a6-pr-98/shellcheck-result.xml

Tag Passed
amd64-v2.0.12-pkg-8ebbaa3e-dev-fdf7cbf60b59e26346f8d45a394a25d8b41967a6-pr-98
arm64v8-v2.0.12-pkg-8ebbaa3e-dev-fdf7cbf60b59e26346f8d45a394a25d8b41967a6-pr-98

@Nementon
Copy link
Author

Nementon commented Dec 7, 2025

Alternatively, as I'm discovering the LinuxServer ecosystem, I've made an equivalent mod for it: https://github.com/Nementon/docker-mods/tree/syncthing-guiaddress-override

If your interested about it but prefere to have a dedicated mod rather than to include it in the base image, kindly create the dedicated branch and let me know, I will proceed to make a PR on https://github.com/linuxserver/docker-mods.

@Nementon Nementon force-pushed the feat/override-gui-listen-addr-from-config-or-envs branch 2 times, most recently from a460572 to f9f6774 Compare December 7, 2025 18:49
configuration file or environs

   - Replace hardcoded default listen address `0.0.0.0:8384` with
     1. Environment variables lookup
        a. From `STGUIADDRESS` (eg: `0.0.0.0:4242`)
        b. From `STGUIHOST` (eg: `0.0.0.0`) and/or STGUIPORT (eg: `4242`)
     2. Static configuration lookup from Syncthing config.xml
     3. Default to `0.0.0.0` and `8384`
@Nementon Nementon force-pushed the feat/override-gui-listen-addr-from-config-or-envs branch from f9f6774 to 3525e14 Compare December 7, 2025 18:50
@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/syncthing/v2.0.12-pkg-8ebbaa3e-dev-3525e14586d03876cd1b43a2c116be93c3c4f298-pr-98/index.html
https://ci-tests.linuxserver.io/lspipepr/syncthing/v2.0.12-pkg-8ebbaa3e-dev-3525e14586d03876cd1b43a2c116be93c3c4f298-pr-98/shellcheck-result.xml

Tag Passed
amd64-v2.0.12-pkg-8ebbaa3e-dev-3525e14586d03876cd1b43a2c116be93c3c4f298-pr-98
arm64v8-v2.0.12-pkg-8ebbaa3e-dev-3525e14586d03876cd1b43a2c116be93c3c4f298-pr-98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants