Skip to content

Commit 7856ce9

Browse files
authored
Status page: display peers IPs only to admins (#521)
1 parent 84032d1 commit 7856ce9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

handler/routes.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,10 +979,13 @@ func Status(db store.IStore) echo.HandlerFunc {
979979
LastHandshakeTime: devices[i].Peers[j].LastHandshakeTime,
980980
LastHandshakeRel: time.Since(devices[i].Peers[j].LastHandshakeTime),
981981
AllocatedIP: allocatedIPs,
982-
Endpoint: devices[i].Peers[j].Endpoint.String(),
983982
}
984983
pVm.Connected = pVm.LastHandshakeRel.Minutes() < 3.
985984

985+
if isAdmin(c) {
986+
pVm.Endpoint = devices[i].Peers[j].Endpoint.String()
987+
}
988+
986989
if _client, ok := m[pVm.PublicKey]; ok {
987990
pVm.Name = _client.Name
988991
pVm.Email = _client.Email

0 commit comments

Comments
 (0)