Skip to content

Commit

Permalink
Status page: display peers IPs only to admins (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCA authored Jan 10, 2024
1 parent 84032d1 commit 7856ce9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion handler/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,13 @@ func Status(db store.IStore) echo.HandlerFunc {
LastHandshakeTime: devices[i].Peers[j].LastHandshakeTime,
LastHandshakeRel: time.Since(devices[i].Peers[j].LastHandshakeTime),
AllocatedIP: allocatedIPs,
Endpoint: devices[i].Peers[j].Endpoint.String(),
}
pVm.Connected = pVm.LastHandshakeRel.Minutes() < 3.

if isAdmin(c) {
pVm.Endpoint = devices[i].Peers[j].Endpoint.String()
}

if _client, ok := m[pVm.PublicKey]; ok {
pVm.Name = _client.Name
pVm.Email = _client.Email
Expand Down

0 comments on commit 7856ce9

Please sign in to comment.