mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-23 15:18:24 +00:00
65d0ca8aa9
### Purpose When generating a new `config.xml` file with default options, the GUI address is populated with a hard-coded default value of `127.0.0.1:8384`, except for a random free port if that default one is occupied. This is independent from the GUI configuration default address defined in the protobuf description. More importantly, it ignores any `STGUIADDRESS` override given via environment variable or command-line option, thus probing for the default port instead of the one specified via override. The `ProbeFreePorts()` function now respects the override, by reading the `GUIConfiguration.Address()` method instead of using hard-coded defaults. When not calling `ProbeFreePorts()`, the override should still be persisted rather than the default address. This happens only when generating a fresh default `config.xml`, never on an existing one.