Commit Graph
2 Commits
Author SHA1 Message Date
Hermes bc4df53684 [grade=A urn:ump:vk45vbr6hs5b7qnbwzfsn2nbcofrpyjkzoesouupbevtmljzgd4q] ux(DC-171): dashboard smoothness pass chunk 1 — header overlap, dead-card collapse, accessible card actions, ON/OFF vocabulary
Live-browser audit (authenticated session, real viewport) produced a
ranked critique; this chunk ships the top 4 fixes, each verified in the
live page with before/after numbers:

1. HEADER OVERLAP: .reload-caddy-container was position:absolute and
   covered the clock (4700px² measured overlap, clock pushed off-screen,
   horizontal scrollbar at 1440px). Now an in-flow flex item with
   flex-wrap on .top-row/.brand-weather-group and a ≤1700px brand cap.
   AFTER: overlap 0px², clock fully visible, no horizontal scroll
   (scrollWidth 1425 ≤ 1440).
2. DEAD CARD COLLAPSE: Tailscale's 'not installed' card occupied a full
   ~205px grid slot forever. Now collapses (content rows hidden, dimmed)
   until Tailscale is actually installed.
3. ACCESSIBLE CARD ACTIONS: all dynamically generated icon-only service
   actions (logs/update/terminal/credentials/options/share/delete/open)
   now carry per-service aria-labels — 64/97 btn-row buttons labelled;
   the rest are text-labelled system buttons. Tailscale refresh labelled.
4. STATUS VOCABULARY: Auth card YES/NO → ON/OFF, matching every other
   card (active + inactive branches + initial markup).

Frontend 68/68; SW dashcaddy-shell-da61d3a0a1; CSP hash unchanged.
2026-11-19 00:33:24 -08:00
Krystie a92eeceae5 DC-029: skip authLimiter for already-authenticated requests
CI / Security audit (push) Has been cancelled
CI / Test & Lint (push) Has been cancelled
The DC-027 rate limiter on /api/v1/auth/* shipped with skip: () => isTest,
which counted every request — including those from a logged-in TOTP session.
Caddy's forward_auth fires /auth/gate/* on every page-load asset (HTML, JS,
CSS, XHR), so a normal browser session exhausted the 20-req/15-min budget
within ~3 page loads and started getting 429 'Too many auth requests' even
with a valid session cookie.

Fix: extend skip to also return true when req.auth.type is 'session',
'jwt', or 'apikey' (set by jwtApiKeyAuthMiddleware, which runs upstream
of the limiter). The unauthenticated path is still rate-limited — DC-027's
credential-scraping defense is preserved.

Also closes the uncommitted working-tree changes for:
- DC-026: routes/auth/sso-gate.js — pre-auth check in buildLoginPage,
  redirected error fallbacks to status.sami?auth=required&return=...
- DC-022: dashcaddy-api/VERSION bumped to fef7e07
- status/index.html + status/js/tailscale-devices.js — Tailscale device card

4 new regression tests pin the fix:
- skips when req.auth.type === 'session'
- skips when req.auth.type === 'jwt'
- skips when req.auth.type === 'apikey'
- still counts UNAUTHENTICATED requests (defense preserved)

Live verified: 50/50 authenticated /auth/gate/plex calls passed (was
20/30 before fix). plex.sami/dashcaddy-login returns 200 with no redirect
loop. Plex auto-login token round-trips end-to-end.
2026-07-02 18:27:03 -07:00