mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-25 13:37:00 +08:00
re-add server mq port
This commit is contained in:
parent
a02a63c5a6
commit
5c2106dd46
3 changed files with 14 additions and 2 deletions
|
|
@ -67,6 +67,7 @@ type ServerConfig struct {
|
||||||
PortForwardServices string `yaml:"portforwardservices"`
|
PortForwardServices string `yaml:"portforwardservices"`
|
||||||
HostNetwork string `yaml:"hostnetwork"`
|
HostNetwork string `yaml:"hostnetwork"`
|
||||||
MQPort string `yaml:"mqport"`
|
MQPort string `yaml:"mqport"`
|
||||||
|
MQServerPort string `yaml:"mqserverport"`
|
||||||
Server string `yaml:"server"`
|
Server string `yaml:"server"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ func GetMessageQueueEndpoint() string {
|
||||||
} else if config.Config.Server.MQHOST != "" {
|
} else if config.Config.Server.MQHOST != "" {
|
||||||
host = config.Config.Server.MQHOST
|
host = config.Config.Server.MQHOST
|
||||||
}
|
}
|
||||||
return host + ":" + GetMQPort()
|
return host + ":" + GetMQServerPort()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMasterKey - gets the configured master key of server
|
// GetMasterKey - gets the configured master key of server
|
||||||
|
|
@ -577,3 +577,14 @@ func GetAzureTenant() string {
|
||||||
func GetRce() bool {
|
func GetRce() bool {
|
||||||
return os.Getenv("RCE") == "on" || config.Config.Server.RCE == "on"
|
return os.Getenv("RCE") == "on" || config.Config.Server.RCE == "on"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetMQServerPort - get mq port for server
|
||||||
|
func GetMQServerPort() string {
|
||||||
|
port := "1883" //default
|
||||||
|
if os.Getenv("MQ_SERVER_PORT") != "" {
|
||||||
|
port = os.Getenv("MQ_SERVER_PORT")
|
||||||
|
} else if config.Config.Server.MQServerPort != "" {
|
||||||
|
port = config.Config.Server.MQServerPort
|
||||||
|
}
|
||||||
|
return port
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ func portForwardServices(force bool) error {
|
||||||
for _, service := range services {
|
for _, service := range services {
|
||||||
switch service {
|
switch service {
|
||||||
case "mq":
|
case "mq":
|
||||||
err = iptablesPortForward("mq", servercfg.GetMQPort(), servercfg.GetMQPort(), false, force)
|
err = iptablesPortForward("mq", servercfg.GetMQServerPort(), servercfg.GetMQServerPort(), false, force)
|
||||||
case "dns":
|
case "dns":
|
||||||
err = iptablesPortForward("coredns", "53", "53", false, force)
|
err = iptablesPortForward("coredns", "53", "53", false, force)
|
||||||
case "ssh":
|
case "ssh":
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue