Skip to content

Commit 4a355ee

Browse files
authored
add gw listen port (#2931)
1 parent abf3f4f commit 4a355ee

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

models/structs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ type UserRemoteGws struct {
7272
IsInternetGateway bool `json:"is_internet_gateway"`
7373
GwClient ExtClient `json:"gw_client"`
7474
GwPeerPublicKey string `json:"gw_peer_public_key"`
75+
GwListenPort int `json:"gw_listen_port"`
7576
Metadata string `json:"metadata"`
7677
AllowedEndpoints []string `json:"allowed_endpoints"`
7778
}

pro/controllers/users.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"github.com/gravitl/netmaker/logger"
1111
"github.com/gravitl/netmaker/logic"
1212
"github.com/gravitl/netmaker/models"
13-
"github.com/gravitl/netmaker/pro/auth"
1413
"github.com/gravitl/netmaker/mq"
14+
"github.com/gravitl/netmaker/pro/auth"
1515
"github.com/gravitl/netmaker/servercfg"
1616
"golang.org/x/exp/slog"
1717
)
@@ -226,6 +226,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
226226
Connected: true,
227227
IsInternetGateway: node.IsInternetGateway,
228228
GwPeerPublicKey: host.PublicKey.String(),
229+
GwListenPort: logic.GetPeerListenPort(host),
229230
Metadata: node.Metadata,
230231
AllowedEndpoints: getAllowedRagEndpoints(&node, host),
231232
})
@@ -242,6 +243,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
242243
Connected: true,
243244
IsInternetGateway: node.IsInternetGateway,
244245
GwPeerPublicKey: host.PublicKey.String(),
246+
GwListenPort: logic.GetPeerListenPort(host),
245247
Metadata: node.Metadata,
246248
AllowedEndpoints: getAllowedRagEndpoints(&node, host),
247249
})
@@ -276,6 +278,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
276278
Network: node.Network,
277279
IsInternetGateway: node.IsInternetGateway,
278280
GwPeerPublicKey: host.PublicKey.String(),
281+
GwListenPort: logic.GetPeerListenPort(host),
279282
Metadata: node.Metadata,
280283
AllowedEndpoints: getAllowedRagEndpoints(&node, host),
281284
})
@@ -304,6 +307,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
304307
Network: node.Network,
305308
IsInternetGateway: node.IsInternetGateway,
306309
GwPeerPublicKey: host.PublicKey.String(),
310+
GwListenPort: logic.GetPeerListenPort(host),
307311
Metadata: node.Metadata,
308312
AllowedEndpoints: getAllowedRagEndpoints(&node, host),
309313
})

0 commit comments

Comments
 (0)