|
@@ -38,7 +38,6 @@ func GetServerConfig() config.ServerConfig {
|
|
cfg.CoreDNSAddr = GetCoreDNSAddr()
|
|
cfg.CoreDNSAddr = GetCoreDNSAddr()
|
|
cfg.APIHost = GetAPIHost()
|
|
cfg.APIHost = GetAPIHost()
|
|
cfg.APIPort = GetAPIPort()
|
|
cfg.APIPort = GetAPIPort()
|
|
- cfg.MQPort = GetMQPort()
|
|
|
|
cfg.MasterKey = "(hidden)"
|
|
cfg.MasterKey = "(hidden)"
|
|
cfg.DNSKey = "(hidden)"
|
|
cfg.DNSKey = "(hidden)"
|
|
cfg.AllowedOrigin = GetAllowedOrigin()
|
|
cfg.AllowedOrigin = GetAllowedOrigin()
|
|
@@ -92,13 +91,11 @@ func GetServerConfig() config.ServerConfig {
|
|
func GetServerInfo() models.ServerConfig {
|
|
func GetServerInfo() models.ServerConfig {
|
|
var cfg models.ServerConfig
|
|
var cfg models.ServerConfig
|
|
cfg.Server = GetServer()
|
|
cfg.Server = GetServer()
|
|
- cfg.Broker = GetBroker()
|
|
|
|
cfg.MQUserName = GetMqUserName()
|
|
cfg.MQUserName = GetMqUserName()
|
|
cfg.MQPassword = GetMqPassword()
|
|
cfg.MQPassword = GetMqPassword()
|
|
cfg.API = GetAPIConnString()
|
|
cfg.API = GetAPIConnString()
|
|
cfg.CoreDNSAddr = GetCoreDNSAddr()
|
|
cfg.CoreDNSAddr = GetCoreDNSAddr()
|
|
cfg.APIPort = GetAPIPort()
|
|
cfg.APIPort = GetAPIPort()
|
|
- cfg.MQPort = GetMQPort()
|
|
|
|
cfg.DNSMode = "off"
|
|
cfg.DNSMode = "off"
|
|
if IsDNSMode() {
|
|
if IsDNSMode() {
|
|
cfg.DNSMode = "on"
|
|
cfg.DNSMode = "on"
|
|
@@ -227,24 +224,17 @@ func GetCoreDNSAddr() string {
|
|
return addr
|
|
return addr
|
|
}
|
|
}
|
|
|
|
|
|
-// GetMQPort - gets the mq port
|
|
|
|
-func GetMQPort() string {
|
|
|
|
- port := "8883" //default
|
|
|
|
- if os.Getenv("MQ_PORT") != "" {
|
|
|
|
- port = os.Getenv("MQ_PORT")
|
|
|
|
- } else if config.Config.Server.MQPort != "" {
|
|
|
|
- port = config.Config.Server.MQPort
|
|
|
|
- }
|
|
|
|
- return port
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// GetMessageQueueEndpoint - gets the message queue endpoint
|
|
// GetMessageQueueEndpoint - gets the message queue endpoint
|
|
func GetMessageQueueEndpoint() (string, bool) {
|
|
func GetMessageQueueEndpoint() (string, bool) {
|
|
host, _ := GetPublicIP()
|
|
host, _ := GetPublicIP()
|
|
- if os.Getenv("BROKER_ENDPOINT") != "" {
|
|
|
|
|
|
+ if os.Getenv("SERVER_BROKER_ENDPOINT") != "" {
|
|
|
|
+ host = os.Getenv("SERVER_BROKER_ENDPOINT")
|
|
|
|
+ } else if config.Config.Server.ServerBrokerEndpoint != "" {
|
|
|
|
+ host = config.Config.Server.ServerBrokerEndpoint
|
|
|
|
+ } else if os.Getenv("BROKER_ENDPOINT") != "" {
|
|
host = os.Getenv("BROKER_ENDPOINT")
|
|
host = os.Getenv("BROKER_ENDPOINT")
|
|
- } else if config.Config.Server.MQHOST != "" {
|
|
|
|
- host = config.Config.Server.MQHOST
|
|
|
|
|
|
+ } else if config.Config.Server.BrokerEndpoint != "" {
|
|
|
|
+ host = config.Config.Server.BrokerEndpoint
|
|
} else {
|
|
} else {
|
|
host += ":1883" // default
|
|
host += ":1883" // default
|
|
}
|
|
}
|
|
@@ -376,17 +366,6 @@ func GetServer() string {
|
|
return server
|
|
return server
|
|
}
|
|
}
|
|
|
|
|
|
-// GetBroker - gets the broker name
|
|
|
|
-func GetBroker() string {
|
|
|
|
- server := ""
|
|
|
|
- if os.Getenv("BROKER_NAME") != "" {
|
|
|
|
- server = os.Getenv("BROKER_NAME")
|
|
|
|
- } else if config.Config.Server.Broker != "" {
|
|
|
|
- server = config.Config.Server.Broker
|
|
|
|
- }
|
|
|
|
- return server
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
func GetVerbosity() int32 {
|
|
func GetVerbosity() int32 {
|
|
var verbosity = 0
|
|
var verbosity = 0
|
|
var err error
|
|
var err error
|