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 STGUIHOST and STGUIPORT
  2. Static configuration from Syncthing config.xml
  3. Fallback to the default 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

configuration file or environs

   - Replace hardcoded default listen address `0.0.0.0:8384` with
     1. Environ lookup from `STGUIHOST` and `STGUIPORT`
     2. Static configuration lookup from Syncthing config.xml
     3. Default to `0.0.0.0` and `8384`
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

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