ipn/localapi: print node IDs, pubkeys, and expiry on bugreport

Having this information near the "user bugreport" line makes it easier
to identify the node and expiry without spelunking through the rest of
the logs.

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I1597c783efc06574fa4c8f211e68d835f20b6ccb
pull/5208/head
Andrew Dunham 2 years ago
parent 0aa7b495d5
commit d2301db49c

@ -314,6 +314,14 @@ func (h *Handler) serveBugReport(w http.ResponseWriter, r *http.Request) {
} else { } else {
h.logf("user bugreport health: ok") h.logf("user bugreport health: ok")
} }
if nm := h.b.NetMap(); nm != nil {
if self := nm.SelfNode; self != nil {
h.logf("user bugreport node info: nodeid=%q stableid=%q expiry=%q", self.ID, self.StableID, self.KeyExpiry.Format(time.RFC3339))
}
h.logf("user bugreport public keys: machine=%q node=%q", nm.MachineKey, nm.NodeKey)
} else {
h.logf("user bugreport netmap: no active netmap")
}
if defBool(r.URL.Query().Get("diagnose"), false) { if defBool(r.URL.Query().Get("diagnose"), false) {
h.b.Doctor(r.Context(), logger.WithPrefix(h.logf, "diag: ")) h.b.Doctor(r.Context(), logger.WithPrefix(h.logf, "diag: "))
} }

Loading…
Cancel
Save