mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-24 16:12:59 +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"`
|
||||
HostNetwork string `yaml:"hostnetwork"`
|
||||
MQPort string `yaml:"mqport"`
|
||||
MQServerPort string `yaml:"mqserverport"`
|
||||
Server string `yaml:"server"`
|
||||
}
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ func GetMessageQueueEndpoint() string {
|
|||
} else if config.Config.Server.MQHOST != "" {
|
||||
host = config.Config.Server.MQHOST
|
||||
}
|
||||
return host + ":" + GetMQPort()
|
||||
return host + ":" + GetMQServerPort()
|
||||
}
|
||||
|
||||
// GetMasterKey - gets the configured master key of server
|
||||
|
@ -577,3 +577,14 @@ func GetAzureTenant() string {
|
|||
func GetRce() bool {
|
||||
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 {
|
||||
switch service {
|
||||
case "mq":
|
||||
err = iptablesPortForward("mq", servercfg.GetMQPort(), servercfg.GetMQPort(), false, force)
|
||||
err = iptablesPortForward("mq", servercfg.GetMQServerPort(), servercfg.GetMQServerPort(), false, force)
|
||||
case "dns":
|
||||
err = iptablesPortForward("coredns", "53", "53", false, force)
|
||||
case "ssh":
|
||||
|
|
Loading…
Reference in a new issue