re-add server mq port

This commit is contained in:
0xdcarns 2022-07-07 14:08:24 -04:00
parent a02a63c5a6
commit 5c2106dd46
3 changed files with 14 additions and 2 deletions

View file

@ -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"`
}

View file

@ -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
}

View file

@ -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":