Gerhard Scheikl
c4aae01209
tunnel: clear stale kill-switch key on subdomain rename
...
When a user renames their tunnel subdomain, the upsert (onConflict=user_id)
overwrote the tunnels row in place, but the old subdomain's Redis
tunnel:active:<sub> flag was never cleared. The edge tunnel-active gate kept
serving the stale flag for up to its ~30s TTL, after which it fell back to a
Postgres miss and (currently) returned a misleading suspended response.
Capture the user's previous subdomain before the upsert and, when it changes,
DEL the old kill-switch key (new clearTunnelActive helper) so the edge gate
immediately stops treating the old subdomain as a live tunnel.
2026-06-02 22:57:13 +02:00
Gerhard Scheikl
2c2afa458e
feat(device): OAuth2 device-pairing flow for HA add-on (code/approve/token/tunnel + /activate)
2026-06-01 10:35:41 +02:00
Gerhard Scheikl
2256f8359b
feat(security): server-side guard preventing removal of last MFA factor
2026-05-31 23:02:40 +02:00
Gerhard Scheikl
e14e909700
feat(auth): mandatory 2FA (TOTP + WebAuthn passkeys) with hard enrollment gate, AAL2 step-up, and single-use recovery codes
2026-05-31 21:38:01 +02:00
Gerhard Scheikl
8e8df7ae64
fix(admin): eliminate GoTrue empty-body 500s under bulk load (retry-all + undici keep-alive + sequential bulk), CSV formula-injection guard
2026-05-31 17:30:04 +02:00
Gerhard Scheikl
17fe642168
fix(admin): retry GoTrue admin reads on transient empty-body responses (bulk-load robustness)
2026-05-31 15:35:33 +02:00
Gerhard Scheikl
d317e8c758
feat(admin): live redis kill-switch on tunnel actions, sortable columns + CSV export + bulk actions, Node 24 LTS
...
WS1: pin all Docker stages to node:24.16.0-alpine; add engines node>=20.
WS2: lib/redis.ts gains TTL-backed redisSet, redisDel, setTunnelActive (writes tunnel:active:<sub>=1/0 EX 30, TUNNEL_ACTIVE_TTL override, no-op without REDIS_URL); wired into tunnel active/delete/reassign routes.
WS3: sortable columns, CSV export routes (token excluded), and bulk actions (self-account guard) across users/tunnels/audit admin tables.
2026-05-31 14:46:22 +02:00
Gerhard Scheikl
dd0ff39890
fix(admin): return 404 (not 500) when deleting an already-removed user
...
GoTrue returns an empty body for a missing-user delete, surfacing as an
opaque JSON-parse error; pre-check existence via getUserById for a clean 404.
2026-05-31 13:23:43 +02:00
Gerhard Scheikl
535b2ef202
fix(admin): fresh SSR reads, atomic user delete + sanitized errors, cookie-rotation in middleware, no-store on admin APIs
2026-05-31 13:15:56 +02:00
Gerhard Scheikl
b6c4d94990
fix(admin): key tunnels by user_id, server-side initial list load, full-scan user search
2026-05-31 11:46:14 +02:00
Gerhard Scheikl
fb4880a1d9
feat(admin): comprehensive admin interface (users, tunnels, metrics, audit, reserved subdomains)
...
Adds an authenticated admin surface gated by auth.users.app_metadata.role==='admin'.
- lib/auth/admin-guard.ts: requireAdmin() (pages) + requireAdminApi() (routes)
- middleware.ts: defense-in-depth /admin and /api/admin guarding
- API: users (list/detail/role/ban/delete), tunnels (list + active/quota/reset/reassign/regenerate-token/delete), metrics, audit log, reserved subdomains
- Self-lockout prevention (no self demote/ban/delete)
- Best-effort Redis kill-switch via dependency-free net-socket client (REDIS_URL)
- admin_audit_log + reserved_subdomains migration (RLS on, service-role only)
- Admin UI (overview, users, tunnels, reserved, audit) + conditional nav link
2026-05-31 10:58:23 +02:00
root
c935e39fa1
initial commit
2026-05-29 17:07:00 +02:00