Sfoglia il codice sorgente

Merge branch 'develop' of https://github.com/gravitl/netmaker into NET-1227

abhishek9686 1 anno fa
parent
commit
3d58241e14
4 ha cambiato i file con 22 aggiunte e 15 eliminazioni
  1. 4 0
      controllers/network.go
  2. 4 1
      logic/peers.go
  3. 4 0
      pro/auth/headless_callback.go
  4. 10 14
      release.md

+ 4 - 0
controllers/network.go

@@ -490,6 +490,10 @@ func createNetwork(w http.ResponseWriter, r *http.Request) {
 			// make host remote access gateway
 			logic.CreateIngressGateway(network.NetID, newNode.ID.String(), models.IngressRequest{})
 		}
+		// send peer updates
+		if err = mq.PublishPeerUpdate(false); err != nil {
+			logger.Log(1, "failed to publish peer update for default hosts after network is added")
+		}
 	}()
 
 	logger.Log(1, r.Header.Get("user"), "created network", network.NetID)

+ 4 - 1
logic/peers.go

@@ -91,6 +91,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
 		if err != nil {
 			continue
 		}
+
 		if !node.Connected || node.PendingDelete || node.Action == models.NODE_DELETE {
 			continue
 		}
@@ -260,6 +261,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
 				peerAllowedIPs = append(peerAllowedIPs, peerConfig.AllowedIPs...)
 				hostPeerUpdate.Peers[peerIndexMap[peerHost.PublicKey.String()]].AllowedIPs = peerAllowedIPs
 				hostPeerUpdate.Peers[peerIndexMap[peerHost.PublicKey.String()]].Remove = false
+				hostPeerUpdate.Peers[peerIndexMap[peerHost.PublicKey.String()]].Endpoint = peerConfig.Endpoint
 				hostPeerUpdate.HostNetworkInfo[peerHost.PublicKey.String()] = models.HostNetworkInfo{
 					Interfaces:   peerHost.Interfaces,
 					ListenPort:   peerHost.ListenPort,
@@ -344,6 +346,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
 				},
 			}
 		}
+
 	}
 	// == post peer calculations ==
 	// indicate removal if no allowed IPs were calculated
@@ -394,7 +397,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
 // GetPeerListenPort - given a host, retrieve it's appropriate listening port
 func GetPeerListenPort(host *models.Host) int {
 	peerPort := host.ListenPort
-	if host.WgPublicListenPort != 0 {
+	if !host.IsStaticPort && host.WgPublicListenPort != 0 {
 		peerPort = host.WgPublicListenPort
 	}
 	return peerPort

+ 4 - 0
pro/auth/headless_callback.go

@@ -52,6 +52,10 @@ func HandleHeadlessSSOCallback(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
+	if !isEmailAllowed(userClaims.Email) {
+		handleOauthUserNotAllowedToSignUp(w)
+		return
+	}
 	// check if user approval is already pending
 	if logic.IsPendingUser(userClaims.getUserName()) {
 		handleOauthUserSignUpApprovalPending(w)

+ 10 - 14
release.md

@@ -1,22 +1,18 @@
 # Netmaker v0.24.2
 
 ## Whats New ✨
-- Users Can define Multiple Endpoints On The Remote Access Gateway To Choose From While Establishing a Connection.
-- OAUTH Code Moved From CE To Pro.
-- nm-quick.sh Enhancement To Install The Latest Docker To Enable Support Of the Latest Distros.
-- IPv6 Enhancements.
+- Static Host Functionality With Separate Settings For Port and endpoint IP
+- Network Info And Metadata Info Added To Remote-Access-Client
 
 ## What's Fixed/Improved 🛠
-
-- Egress Enhancement In Multiple Networks
-- Fix armv5-v7 Upgrade Download Link
-- Fix Windows Interface Issue In Multiple Networks
-- SSO network join Improvements.
-- Remove Egress Routes After Egress Gateway Removed
-- Remote Access Gateway Connection Handling Improvements.
+- Improved FailOver Functionality
+- Local Peer Routing In Dual-Stack Environment
+- Stale Node Issue On Multinet With `netclient uninstall`
+- IPv6 Internet Gateways Improvements
+- Handled New Oauth User SignUp via Remote-Access-Client
+- PeerUpdate Improvements Around Default Host and Multi-nets
 
 ## Known Issues 🐞
 
-- Erratic Traffic Data In Metrics
-- `netclient server leave` Leaves a Stale Node Record In At Least One Network When Part Of Multiple Networks, But Can Be Deleted From The UI.
-- IPv6 internet traffic does not route to the InetGw in Dual Stack Network
+- Erratic Traffic Data In Metrics.
+- Stale peer on the interface, when forced removed from multiple networks at once.