Add admin diagnostics: env-var config check and log tail
Deploy with Docker Compose / deploy (push) Successful in 45s

Two admin-only REST endpoints and a Diagnostics tab in the admin panel:

- GET /admin/config reports which known environment variables are set,
  what each is for, and the value only for non-credential vars. Secrets
  are never returned, only their presence.
- GET /admin/logs returns the tail of backend/logs/go.log (Gin traffic
  plus application lines), bounded to 256 KiB and 500 lines so the read
  is constant-size however large the file has grown.

tailLogFile is split out from the handler and tested for the line cap,
the partial-first-line rule, and the empty/missing cases.

Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
2026-09-22 23:02:57 +01:00
co-authored by Claude Code
parent 49909037db
commit 8bd93cbd8e
5 changed files with 414 additions and 0 deletions
+4
View File
@@ -189,6 +189,10 @@ func main() {
// NOTES
admin.GET("/notes/*path", store.GetNoteFile)
// ADMIN DIAGNOSTICS: env-var checklist and log tail for the admin panel.
admin.GET("/admin/config", store.ConfigCheck)
admin.GET("/admin/logs", store.Logs)
// GRAPHQL
// GraphQL is assembled by hand rather than with handler.NewDefaultServer
// so the transports and extensions below are explicit.