Skip to content

Commit 9a623e8

Browse files
authored
Merge pull request #3520 from gravitl/develop
Develop
2 parents db8e012 + da024c2 commit 9a623e8

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

controllers/hosts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ func updateHost(w http.ResponseWriter, r *http.Request) {
308308
}
309309
}
310310
}()
311+
311312
logic.LogEvent(&models.Event{
312313
Action: models.Update,
313314
Source: models.Subject{

pro/auth/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ var oauthNotConfigured = fmt.Sprintf(htmlBaseTemplate, `<h2>Your Netmaker server
9898
var oauthStateInvalid = fmt.Sprintf(htmlBaseTemplate, `<h2>Invalid OAuth Session. Please re-try again.</h2>`)
9999

100100
var userNotAllowed = fmt.Sprintf(htmlBaseTemplate, `<h2>Your account does not have access to the dashboard. Please contact your administrator for more information about your account.</h2>
101-
<p>Non-Admins can access the netmaker networks using <a href="https://docs.netmaker.io/docs/remote-access-client-rac#downloadinstallation" target="_blank" rel="noopener">our Netmaker Desktop App.</a></p>`)
101+
<p>Non-Admins can access the netmaker networks using <a href="https://docs.netmaker.io/docs/client-installation/netmaker-desktop#downloadinstallation" target="_blank" rel="noopener">our Netmaker Desktop App.</a></p>`)
102102

103103
var userFirstTimeSignUp = fmt.Sprintf(htmlBaseTemplate, `<h2>Thank you for signing up. Please contact your administrator for access.</h2>`)
104104

pro/controllers/users.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,12 @@ func getUserRemoteAccessGwsV1(w http.ResponseWriter, r *http.Request) {
13041304
if extClient.DNS == "" {
13051305
extClient.DNS = node.IngressDNS
13061306
}
1307+
1308+
extClient.IngressGatewayEndpoint = utils.GetExtClientEndpoint(
1309+
host.EndpointIP,
1310+
host.EndpointIPv6,
1311+
logic.GetPeerListenPort(host),
1312+
)
13071313
extClient.AllowedIPs = logic.GetExtclientAllowedIPs(extClient)
13081314
gws = append(gws, models.UserRemoteGws{
13091315
GwID: node.ID.String(),

utils/utils.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package utils
22

33
import (
4+
"fmt"
45
"log/slog"
6+
"net"
57
"runtime"
68
"strings"
79
"time"
@@ -75,3 +77,12 @@ func NoEmptyStringToCsv(strs ...string) string {
7577
}
7678
return sb.String()
7779
}
80+
81+
// GetExtClientEndpoint returns the external client endpoint in the format "host:port" or "[host]:port" for IPv6
82+
func GetExtClientEndpoint(hostIpv4Endpoint, hostIpv6Endpoint net.IP, hostListenPort int) string {
83+
if hostIpv4Endpoint.To4() == nil {
84+
return fmt.Sprintf("[%s]:%d", hostIpv6Endpoint.String(), hostListenPort)
85+
} else {
86+
return fmt.Sprintf("%s:%d", hostIpv4Endpoint.String(), hostListenPort)
87+
}
88+
}

0 commit comments

Comments
 (0)