NET-186: Wg public listen port (#2344)

* fetch public listen of wg if present

* check if wg pub listen port has been changed on host update

* wg public port to host api model for visibility

* rm comment
This commit is contained in:
Abhishek K
2023-05-31 08:21:02 +05:30
committed by GitHub
parent 5271a2084b
commit 47edf65b1f
4 changed files with 83 additions and 63 deletions

View File

@@ -173,6 +173,10 @@ func UpdateHostFromClient(newHost, currHost *models.Host) (sendPeerUpdate bool)
currHost.ListenPort = newHost.ListenPort
sendPeerUpdate = true
}
if newHost.WgPublicListenPort != 0 && currHost.WgPublicListenPort != newHost.WgPublicListenPort {
currHost.WgPublicListenPort = newHost.WgPublicListenPort
sendPeerUpdate = true
}
if newHost.ProxyListenPort != 0 && currHost.ProxyListenPort != newHost.ProxyListenPort {
currHost.ProxyListenPort = newHost.ProxyListenPort
sendPeerUpdate = true