feat(crash): account system for the crash dashboard#4119
Merged
Conversation
Replace the single shared STATS_PASSWORD with email/password accounts, sessions, and role-based access. New registrations land as `pending` with no access until an admin grants `viewer` or `admin`; the ADMIN_EMAILS secret bootstraps the first admin on register. Admins get user management, crash-group triage (status / note / delete), and an audit log. The /v1 ingest endpoints stay public and unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the single shared
STATS_PASSWORDon/statswith a realemail/password account system for the crash & telemetry dashboard.
What changed
sessions, HttpOnly/Secure/SameSite cookies, and a same-origin CSRF guard on
every state-changing POST.
pending(default on register: signed in, no access),viewer(sees the dashboard),admin(above + user management + crashtriage). Registration is open; a new account sees only an "awaiting approval"
screen until an admin grants access.
/adminuser management (set role / delete user) and/admin/audit, a log of permission and crash-data changes.delete a group and its samples from the group page.
ADMIN_EMAILSsecret (comma-separated) auto-promotesmatching emails to
adminon register, so the first admin needs no manual SQL.The
/v1/report,/v1/ping, and/v1/metricsingest endpoints are unchangedand stay public.
Schema
Fresh installs use
schema.sql(now withusers,sessions,audit_logandgroups.status/groups.note). The existing DB is upgraded once with thenon-idempotent
migrate.sql.Deploy status
Already migrated, secret-set, and deployed to crash.reasonix.io — verified live:
route gating, CSRF rejection, and the full register → session → gate → logout
flow. The worker is split into
env/shell/auth/auth_pages/admin/
stats/index, each under the file-size budget.