add external IP to peers
This commit is contained in:
parent
0e95b26b11
commit
dd5ab03771
@ -98,11 +98,17 @@ func GenerateReport(dev *wgtypes.Device, conf *DsnetConfig, oldReport *DsnetRepo
|
|||||||
status = StatusOffline
|
status = StatusOffline
|
||||||
}
|
}
|
||||||
|
|
||||||
|
externalIP := net.IP{}
|
||||||
|
if wgPeer.Endpoint != nil {
|
||||||
|
externalIP = wgPeer.Endpoint.IP
|
||||||
|
}
|
||||||
|
|
||||||
peerReports[i] = PeerReport{
|
peerReports[i] = PeerReport{
|
||||||
Hostname: peer.Hostname,
|
Hostname: peer.Hostname,
|
||||||
Owner: peer.Owner,
|
Owner: peer.Owner,
|
||||||
Description: peer.Description,
|
Description: peer.Description,
|
||||||
IP: peer.IP,
|
IP: peer.IP,
|
||||||
|
ExternalIP: externalIP,
|
||||||
Status: status,
|
Status: status,
|
||||||
Networks: peer.Networks,
|
Networks: peer.Networks,
|
||||||
LastHandshakeTime: wgPeer.LastHandshakeTime,
|
LastHandshakeTime: wgPeer.LastHandshakeTime,
|
||||||
@ -162,8 +168,10 @@ type PeerReport struct {
|
|||||||
// Description of what the host is and/or does
|
// Description of what the host is and/or does
|
||||||
Description string
|
Description string
|
||||||
// Internal VPN IP address. Added to AllowedIPs in server config as a /32
|
// Internal VPN IP address. Added to AllowedIPs in server config as a /32
|
||||||
IP net.IP
|
IP net.IP
|
||||||
Status Status
|
// Last known external IP
|
||||||
|
ExternalIP net.IP
|
||||||
|
Status Status
|
||||||
// TODO ExternalIP support (Endpoint)
|
// TODO ExternalIP support (Endpoint)
|
||||||
//ExternalIP net.UDPAddr `validate:"required,udp4_addr"`
|
//ExternalIP net.UDPAddr `validate:"required,udp4_addr"`
|
||||||
// TODO support routing additional networks (AllowedIPs)
|
// TODO support routing additional networks (AllowedIPs)
|
||||||
|
Loading…
Reference in New Issue
Block a user