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:
@@ -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)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</li>
|
||||
<li><a href="/backups" class="{{if eq .Page "backups"}}active{{end}}"><svg class="ico"><use href="#i-shield"/></svg>Biztonsági mentés</a></li>
|
||||
<li><a href="/monitoring" class="{{if eq .Page "monitoring"}}active{{end}}"><svg class="ico"><use href="#i-cpu"/></svg>Rendszermonitor</a></li>
|
||||
{{if .DebugMode}}<li><a href="/debug" class="{{if eq .Page "debug"}}active{{end}}"><svg class="ico"><use href="#i-wrench"/></svg>Debug</a></li>{{end}}
|
||||
<li><a href="/debug" class="{{if eq .Page "debug"}}active{{end}}"><svg class="ico"><use href="#i-wrench"/></svg>Debug</a></li>
|
||||
</ul>
|
||||
<div class="sidebar-bottom">
|
||||
<div class="nav-group-label">Beállítások</div>
|
||||
|
||||
Reference in New Issue
Block a user