### 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.
This commit is contained in:
@@ -63,6 +63,8 @@ func DefaultConfig(path string, myID protocol.DeviceID, evLogger events.Logger,
|
||||
|
||||
if skipPortProbing {
|
||||
l.Infoln("Using default network port numbers instead of probing for free ports")
|
||||
// Record address override initially
|
||||
newCfg.GUI.RawAddress = newCfg.GUI.Address()
|
||||
} else if err := newCfg.ProbeFreePorts(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user