mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-07 13:44:17 +08:00
if emqx, avoid sending mq creds from server to client
This commit is contained in:
parent
b5db86d1a7
commit
8a777205d5
2 changed files with 7 additions and 5 deletions
|
@ -124,9 +124,6 @@ func pull(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
serverConf := servercfg.GetServerInfo()
|
||||
if servercfg.GetBrokerType() == servercfg.EmqxBrokerType {
|
||||
serverConf.MQUserName = hostID
|
||||
}
|
||||
key, keyErr := logic.RetrievePublicTrafficKey()
|
||||
if keyErr != nil {
|
||||
logger.Log(0, "error retrieving key:", keyErr.Error())
|
||||
|
|
|
@ -117,8 +117,13 @@ func GetRacAutoDisable() bool {
|
|||
func GetServerInfo() models.ServerConfig {
|
||||
var cfg models.ServerConfig
|
||||
cfg.Server = GetServer()
|
||||
cfg.MQUserName = GetMqUserName()
|
||||
cfg.MQPassword = GetMqPassword()
|
||||
if GetBrokerType() == EmqxBrokerType {
|
||||
cfg.MQUserName = "HOST_ID"
|
||||
cfg.MQPassword = "HOST_PASS"
|
||||
} else {
|
||||
cfg.MQUserName = GetMqUserName()
|
||||
cfg.MQPassword = GetMqPassword()
|
||||
}
|
||||
cfg.API = GetAPIConnString()
|
||||
cfg.CoreDNSAddr = GetCoreDNSAddr()
|
||||
cfg.APIPort = GetAPIPort()
|
||||
|
|
Loading…
Add table
Reference in a new issue