Browse Source

return after pushing proxy updateto server

Abhishek Kondur 2 years ago
parent
commit
40a9ae0e76
3 changed files with 3 additions and 2 deletions
  1. 1 1
      logic/peers.go
  2. 1 0
      mq/publishers.go
  3. 1 1
      servercfg/serverconf.go

+ 1 - 1
logic/peers.go

@@ -99,7 +99,7 @@ func GetPeersForProxy(node *models.Node, onlyPeers bool) (manager.ManagerPayload
 			keepalive, _ = time.ParseDuration(strconv.FormatInt(int64(node.PersistentKeepalive), 10) + "s")
 			keepalive, _ = time.ParseDuration(strconv.FormatInt(int64(node.PersistentKeepalive), 10) + "s")
 		}
 		}
 		proxyStatus := peer.Proxy
 		proxyStatus := peer.Proxy
-		if peer.Server == "yes" {
+		if peer.IsServer == "yes" {
 			proxyStatus = servercfg.IsProxyEnabled()
 			proxyStatus = servercfg.IsProxyEnabled()
 		}
 		}
 		peers = append(peers, wgtypes.PeerConfig{
 		peers = append(peers, wgtypes.PeerConfig{

+ 1 - 0
mq/publishers.go

@@ -162,6 +162,7 @@ func ProxyUpdate(proxyPayload *manager.ManagerAction, node *models.Node) error {
 	}
 	}
 	if node.IsServer == "yes" {
 	if node.IsServer == "yes" {
 		logic.ProxyMgmChan <- proxyPayload
 		logic.ProxyMgmChan <- proxyPayload
+		return nil
 	}
 	}
 	logger.Log(3, "publishing proxy update to "+node.Name)
 	logger.Log(3, "publishing proxy update to "+node.Name)
 
 

+ 1 - 1
servercfg/serverconf.go

@@ -674,7 +674,7 @@ func GetStunPort() string {
 }
 }
 
 
 func IsProxyEnabled() bool {
 func IsProxyEnabled() bool {
-	var enabled = true //default
+	var enabled = false //default
 	if os.Getenv("PROXY") != "" {
 	if os.Getenv("PROXY") != "" {
 		enabled = os.Getenv("PROXY") == "on"
 		enabled = os.Getenv("PROXY") == "on"
 	} else if config.Config.Server.Proxy != "" {
 	} else if config.Config.Server.Proxy != "" {