v0.116.1: ungate /debug + /api/debug from logging.level — the viewer must exist wherever the ring does

Live validation at logging.level=info 404'd the whole debug surface (the
motivating incident's blind spot). Auth unchanged (RequireAuth + CSRF).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSK5g6qYLknKj8u3QAFEr6
This commit is contained in:
2026-07-11 17:12:20 +02:00
parent 26a43708b7
commit 458d7e1ebc
4 changed files with 16 additions and 10 deletions
+4 -9
View File
@@ -252,12 +252,10 @@ func (s *Server) isDebug() bool {
}
// ServeDebugAPI handles /api/debug/* routes (JSON API for debug operations).
// Called from the mux carve-out; debug mode check is done here.
// v0.116.1: NO logging-level gate — the capture ring always exists now, and gating
// the viewer on logging.level=debug was exactly the motivating incident's blind
// spot (an info box 404'd the whole debug surface). Auth: RequireAuth at the mux.
func (s *Server) ServeDebugAPI(w http.ResponseWriter, r *http.Request) {
if !s.isDebug() {
http.NotFound(w, r)
return
}
s.handleDebugAPI(w, r)
}
@@ -373,10 +371,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
slug := strings.TrimPrefix(path, "/apps/")
s.appDetailHandler(w, r, slug)
case path == "/debug":
if !s.isDebug() {
http.NotFound(w, r)
return
}
// v0.116.1: available at ANY logging.level (the ring always captures; see ServeDebugAPI).
s.debugPageHandler(w, r)
default:
s.logger.Printf("[WARN] [web] 404 Not Found: %s %s", r.Method, path)