Add admin diagnostics: env-var config check and log tail
Deploy with Docker Compose / deploy (push) Successful in 45s
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user