mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-11 15:44:52 +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
|
return
|
||||||
}
|
}
|
||||||
serverConf := servercfg.GetServerInfo()
|
serverConf := servercfg.GetServerInfo()
|
||||||
if servercfg.GetBrokerType() == servercfg.EmqxBrokerType {
|
|
||||||
serverConf.MQUserName = hostID
|
|
||||||
}
|
|
||||||
key, keyErr := logic.RetrievePublicTrafficKey()
|
key, keyErr := logic.RetrievePublicTrafficKey()
|
||||||
if keyErr != nil {
|
if keyErr != nil {
|
||||||
logger.Log(0, "error retrieving key:", keyErr.Error())
|
logger.Log(0, "error retrieving key:", keyErr.Error())
|
||||||
|
|
|
@ -117,8 +117,13 @@ func GetRacAutoDisable() bool {
|
||||||
func GetServerInfo() models.ServerConfig {
|
func GetServerInfo() models.ServerConfig {
|
||||||
var cfg models.ServerConfig
|
var cfg models.ServerConfig
|
||||||
cfg.Server = GetServer()
|
cfg.Server = GetServer()
|
||||||
cfg.MQUserName = GetMqUserName()
|
if GetBrokerType() == EmqxBrokerType {
|
||||||
cfg.MQPassword = GetMqPassword()
|
cfg.MQUserName = "HOST_ID"
|
||||||
|
cfg.MQPassword = "HOST_PASS"
|
||||||
|
} else {
|
||||||
|
cfg.MQUserName = GetMqUserName()
|
||||||
|
cfg.MQPassword = GetMqPassword()
|
||||||
|
}
|
||||||
cfg.API = GetAPIConnString()
|
cfg.API = GetAPIConnString()
|
||||||
cfg.CoreDNSAddr = GetCoreDNSAddr()
|
cfg.CoreDNSAddr = GetCoreDNSAddr()
|
||||||
cfg.APIPort = GetAPIPort()
|
cfg.APIPort = GetAPIPort()
|
||||||
|
|
Loading…
Add table
Reference in a new issue