Audit log panel answers "404 not found" — feature-detect, and decide whether the dogfood enables audit #173
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/Cairn#173
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dogfood note (Nikola): opening the audit log window immediately shows "404 not found" before any user/path filter, and every query 404s too.
Probable root cause (to verify):
/api/v1/admin/auditis only registered whenaudit.enabledis true in the config — and thecairn-enc-configsecret likely doesn't enable it, so the route falls through to 404. The UI shows the Audit button to every admin regardless of whether the feature is on: a feature-detection bug, same class as the trash view (which 404-detects properly).Fix: the admin UI feature-detects audit (probe once, hide the button or show "Audit logging is not enabled on this server — set
audit.enabledin the configuration" instead of a raw 404)./api/v1/admin/infocould carryauditEnabledexplicitly.Follow-up question for Nikola: do you want audit logging ON for the dogfood/beta? It writes JSONL month files under
/data/.cairn/audit(local scratch, PVC-backed). For the beta with Manuel it would exercise #63/#61 surfaces for real — recommended. If yes, that's one line in thecairn-enc-configsecret (your edit — I don't touch the secret) plus a pod restart.Already implemented in current code (v0.6.8) — verified by reading
web/static/index.html.loadAuditfeature-detects the 404 and shows a friendly message instead of the raw error:When audit is disabled the
/api/v1/admin/auditroute is never registered (registerAuditruns only whenh.Audit != nil && h.Admin != nil, api.go), so the panel gets a 404 →adminFetchsurfaces"404 Not Found"→ the regex matches → the panel showsauditDisabled("Audit logging is not enabled on this server — set audit.enabled…").Closing as implemented. Reopen if the panel still shows a bare 404 on the dogfood (that would only happen if the server returned a JSON error body without "404"/"not found" text — in which case the fix is to switch the detection to the HTTP status instead of the message string).