add gw listen port (#2931)

This commit is contained in:
Abhishek K 2024-05-09 13:00:21 +05:30 committed by GitHub
parent abf3f4f55d
commit 4a355ee9f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -72,6 +72,7 @@ type UserRemoteGws struct {
IsInternetGateway bool `json:"is_internet_gateway"`
GwClient ExtClient `json:"gw_client"`
GwPeerPublicKey string `json:"gw_peer_public_key"`
GwListenPort int `json:"gw_listen_port"`
Metadata string `json:"metadata"`
AllowedEndpoints []string `json:"allowed_endpoints"`
}

View file

@ -10,8 +10,8 @@ import (
"github.com/gravitl/netmaker/logger"
"github.com/gravitl/netmaker/logic"
"github.com/gravitl/netmaker/models"
"github.com/gravitl/netmaker/pro/auth"
"github.com/gravitl/netmaker/mq"
"github.com/gravitl/netmaker/pro/auth"
"github.com/gravitl/netmaker/servercfg"
"golang.org/x/exp/slog"
)
@ -226,6 +226,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
Connected: true,
IsInternetGateway: node.IsInternetGateway,
GwPeerPublicKey: host.PublicKey.String(),
GwListenPort: logic.GetPeerListenPort(host),
Metadata: node.Metadata,
AllowedEndpoints: getAllowedRagEndpoints(&node, host),
})
@ -242,6 +243,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
Connected: true,
IsInternetGateway: node.IsInternetGateway,
GwPeerPublicKey: host.PublicKey.String(),
GwListenPort: logic.GetPeerListenPort(host),
Metadata: node.Metadata,
AllowedEndpoints: getAllowedRagEndpoints(&node, host),
})
@ -276,6 +278,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
Network: node.Network,
IsInternetGateway: node.IsInternetGateway,
GwPeerPublicKey: host.PublicKey.String(),
GwListenPort: logic.GetPeerListenPort(host),
Metadata: node.Metadata,
AllowedEndpoints: getAllowedRagEndpoints(&node, host),
})
@ -304,6 +307,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
Network: node.Network,
IsInternetGateway: node.IsInternetGateway,
GwPeerPublicKey: host.PublicKey.String(),
GwListenPort: logic.GetPeerListenPort(host),
Metadata: node.Metadata,
AllowedEndpoints: getAllowedRagEndpoints(&node, host),
})