Allow sending correct public name in autodiscovery
This commit is contained in:
parent
b1e9a2099e
commit
b250a6b3c8
2 changed files with 9 additions and 5 deletions
|
@ -52,6 +52,7 @@ type jsonConf struct {
|
|||
Port int `json:"port"`
|
||||
Mode string `json:"mode"`
|
||||
SockPath string `json:"sock"`
|
||||
PublicHost string `json:"public_host"`
|
||||
} `json:"server"`
|
||||
BootProvider struct {
|
||||
Iface string `json:"interface"`
|
||||
|
@ -67,6 +68,7 @@ type AppConfig struct {
|
|||
DataFilepath string
|
||||
StaticDir string
|
||||
Host string
|
||||
PublicHost string
|
||||
Port int
|
||||
SockPath string
|
||||
UPDMcastGroup string
|
||||
|
@ -98,6 +100,7 @@ func (ac *AppConfig) UnmarshalJSON(data []byte) error {
|
|||
ac.ServerMode = lm
|
||||
ac.SockPath = jsonConf.Server.SockPath
|
||||
ac.Host = jsonConf.Server.Host
|
||||
ac.PublicHost = jsonConf.Server.PublicHost
|
||||
ac.Port = jsonConf.Server.Port
|
||||
ac.UPDMcastGroup = jsonConf.BootProvider.McastGroup
|
||||
ac.UDPIface = jsonConf.BootProvider.Iface
|
||||
|
@ -113,6 +116,7 @@ var defaultConfig AppConfig = AppConfig{
|
|||
ServerMode: ModeNet,
|
||||
DataFilepath: "boot_options.json",
|
||||
Host: "0.0.0.0",
|
||||
PublicHost: "http://127.0.0.1:5000",
|
||||
Port: 5000,
|
||||
UPDMcastGroup: "ff02::abcd:1234",
|
||||
UDPPort: 42,
|
||||
|
|
|
@ -28,7 +28,7 @@ type discoveryPayload struct {
|
|||
|
||||
func payloadFromConfig(conf config.AppConfig) discoveryPayload {
|
||||
return discoveryPayload{
|
||||
ManagementAddress: conf.Host,
|
||||
ManagementAddress: conf.PublicHost,
|
||||
Version: "1",
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue