Skip to content

feat: admin dashboard UI with live activity feed#22

Open
ServerSideHannes wants to merge 1 commit intomainfrom
feat/admin-dashboard-ui
Open

feat: admin dashboard UI with live activity feed#22
ServerSideHannes wants to merge 1 commit intomainfrom
feat/admin-dashboard-ui

Conversation

@ServerSideHannes
Copy link
Copy Markdown
Owner

Summary

  • Add an optional admin dashboard served at /admin (opt-in via S3PROXY_ADMIN_UI=true), matching the requested light, card-based design: summary cards with sparklines, live recent-activity feed, buckets/keys tables, and a status footer.
  • Gated by HTTP Basic Auth. Falls back to the configured AWS credentials when admin_username / admin_password aren't set.
  • Dashboard is self-contained HTML/CSS/JS (no new deps); JSON updates come from /admin/api/status, which is hydrated every 5s.
  • Request log ring buffer hooked into request_handler.py so the activity feed reflects real traffic. Sparklines and rate totals are computed from Prometheus counters via a sliding-window rate tracker.

New settings

Env Default Description
S3PROXY_ADMIN_UI false Enable the dashboard
S3PROXY_ADMIN_PATH /admin URL prefix
S3PROXY_ADMIN_USERNAME AWS access key Basic-Auth user
S3PROXY_ADMIN_PASSWORD AWS secret key Basic-Auth password

Test plan

  • pytest tests/unit — 310 passed (includes 9 new test_admin.py cases)
  • ruff check clean on new files (template file exempted from E501 for unavoidable inline HTML)
  • Manual smoke: TestClient renders /admin/ with 200 + seeded request log renders the activity feed, buckets, keys, and footer as expected
  • /admin/ returns 401 + WWW-Authenticate: Basic realm="S3Proxy Admin" without creds
  • Live browser preview against running uvicorn (please verify post-merge on a staging cluster)

Add an optional admin dashboard at `/admin` (gated by `S3PROXY_ADMIN_UI`)
that renders summary cards, a live request feed, bucket/key tables, and
a status footer. Matches the light, card-based design spec.

- Basic Auth (falls back to configured AWS credentials if unset)
- `/admin/` serves the HTML; `/admin/api/status` returns JSON
- Request log ring buffer hooked into request_handler for live traffic
- Sparklines fed from a rolling rate tracker over Prometheus counters
- Single self-contained HTML template (no extra deps)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant