From d2301db49c6a7760b7e478e6f11f1541b45be915 Mon Sep 17 00:00:00 2001 From: Andrew Dunham Date: Fri, 3 Feb 2023 10:53:08 -0500 Subject: [PATCH] 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 Change-Id: I1597c783efc06574fa4c8f211e68d835f20b6ccb --- ipn/localapi/localapi.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ipn/localapi/localapi.go b/ipn/localapi/localapi.go index 8689d5023..debd908dd 100644 --- a/ipn/localapi/localapi.go +++ b/ipn/localapi/localapi.go @@ -314,6 +314,14 @@ func (h *Handler) serveBugReport(w http.ResponseWriter, r *http.Request) { } else { 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) { h.b.Doctor(r.Context(), logger.WithPrefix(h.logf, "diag: ")) }