hub v0.42.0: remote "Debug mód" toggle on the customer config editor

Adds a form-level debug-mode checkbox to the customer config editor so an
operator can flip the controller's Logging.Level=debug (/debug menu + verbose
log) remotely, without SSH. Form field (not raw-JSON injection) because
handleConfigUpdate rebuilds ConfigJSON from the form on every save; the
config-version bump makes the controller re-pull + self-restart next cycle.

- buildConfigJSON: debug_mode checked -> "logging":{"level":"debug"};
  unchecked -> logging key omitted.
- config_form.html: "Hibakeresési mód (fejlesztői)" section + render state.
- configs_debug_test.go: form->JSON both ways; full-path survival test
  (debug lands, offsite descriptor unchanged, foreign-key red-proof); render
  state; red-proof exercised.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSK5g6qYLknKj8u3QAFEr6
This commit is contained in:
2026-07-10 15:14:43 +02:00
parent f835203bc9
commit c918baa656
5 changed files with 290 additions and 28 deletions
+9
View File
@@ -955,6 +955,15 @@ func buildConfigJSON(r *http.Request) string {
overrides["git"] = git
}
// Logging (remote debug-mode toggle). The controller's /debug menu + verbose log key off
// Logging.Level=="debug" (controller isDebug()). This lives in the FORM — not raw-JSON injection —
// on purpose: handleConfigUpdate rebuilds ConfigJSON from the form on every save (buildConfigJSON),
// so a foreign key would be dropped on the next save. Checked → logging.level=debug; unchecked → the
// logging key is OMITTED entirely (the generated controller.yaml default stands — no needless "info").
if r.FormValue("debug_mode") != "" {
overrides["logging"] = map[string]interface{}{"level": "debug"}
}
data, _ := json.Marshal(overrides)
return string(data)
}