Browse Source

Merge pull request #3544 from gravitl/release-v1.0.0

Release v1.0.0
Abhishek K 2 months ago
parent
commit
2e47484c7b
2 changed files with 10 additions and 7 deletions
  1. 6 6
      logic/acls.go
  2. 4 1
      mq/handlers.go

+ 6 - 6
logic/acls.go

@@ -657,12 +657,12 @@ var IsAclPolicyValid = func(acl models.Acl) (err error) {
 
 var IsPeerAllowed = func(node, peer models.Node, checkDefaultPolicy bool) bool {
 	var nodeId, peerId string
-	if node.IsGw && peer.IsRelayed && peer.RelayedBy == node.ID.String() {
-		return true
-	}
-	if peer.IsGw && node.IsRelayed && node.RelayedBy == peer.ID.String() {
-		return true
-	}
+	// if node.IsGw && peer.IsRelayed && peer.RelayedBy == node.ID.String() {
+	// 	return true
+	// }
+	// if peer.IsGw && node.IsRelayed && node.RelayedBy == peer.ID.String() {
+	// 	return true
+	// }
 	if node.IsStatic {
 		nodeId = node.StaticNode.ClientID
 		node = node.StaticNode.ConvertToStaticNode()

+ 4 - 1
mq/handlers.go

@@ -281,7 +281,7 @@ func HandleHostCheckin(h, currentHost *models.Host) bool {
 		(h.ListenPort != 0 && h.ListenPort != currentHost.ListenPort) ||
 		(h.WgPublicListenPort != 0 && h.WgPublicListenPort != currentHost.WgPublicListenPort) || (!h.EndpointIPv6.Equal(currentHost.EndpointIPv6))
 	if ifaceDelta { // only save if something changes
-		if !h.EndpointIP.Equal(currentHost.EndpointIP) || !h.EndpointIPv6.Equal(currentHost.EndpointIPv6) {
+		if !h.EndpointIP.Equal(currentHost.EndpointIP) || !h.EndpointIPv6.Equal(currentHost.EndpointIPv6) || currentHost.Location == "" {
 			if h.EndpointIP != nil {
 				h.Location = logic.GetHostLocInfo(h.EndpointIP.String(), os.Getenv("IP_INFO_TOKEN"))
 			} else if h.EndpointIPv6 != nil {
@@ -293,6 +293,9 @@ func HandleHostCheckin(h, currentHost *models.Host) bool {
 		currentHost.Interfaces = h.Interfaces
 		currentHost.DefaultInterface = h.DefaultInterface
 		currentHost.NatType = h.NatType
+		if h.Location != "" {
+			currentHost.Location = h.Location
+		}
 		if h.ListenPort != 0 {
 			currentHost.ListenPort = h.ListenPort
 		}