Skip to content

feat: add OIDC-authenticated Admin UI, SQLite storage, and access/audit/IP history logs - #5

Merged
tracyhatemice merged 17 commits into
masterfrom
feat/admin-ui-oidc
Nov 29, 2026
Merged

tracyhatemice merged 17 commits into
masterfrom
feat/admin-ui-oidc

Conversation

@tracyhatemice

Copy link
Copy Markdown
Owner

Summary

Refactors who into a self-hosted DDNS and IP reflection control plane with an embedded Svelte 5 Admin Web UI, OIDC PKCE authentication, pure-Go SQLite runtime storage, public HTTP access logs, per-record IP/delivery history, and admin audit logs — while preserving 100% backwards compatibility with existing public endpoints and CGO_ENABLED=0 FROM scratch builds.

Highlights

  • Backwards-compatible public endpoints & sub-path support:
    • Preserves GET /whoami, GET /whoami/headers, GET /iam/{name}, GET /iam/{name}/{ip}, and GET /whois/{name} at /.
    • Adds GET /healthz readiness/liveness endpoint and --base-path / WHO_BASE_PATH mounting for /auth/*, /api/v1/*, and the embedded SPA.
    • Optional per-record SHA-256 /iam bearer token protection (Authorization: Bearer, X-Who-Token, or query-sanitized ?token=).
  • Pure-Go SQLite storage (internal/storage):
    • Stores who, ddns, webhooks, and touch configuration, ip_history, delivery_logs, access_logs, audit_logs, settings, and sessions in who.db (WAL mode) with one-time first-boot config.json import (--config / WHO_CONFIG).
    • Atomic runtime snapshot reloads and non-blocking batched public request logging (AccessLogger).
  • OIDC Authentication (internal/auth):
    • Authorization Code Flow with S256 PKCE, encrypted who_oidc_tx transaction cookie, HttpOnly/SameSite=Lax SQLite-backed who_session cookies, verified email & sub allowlists, and X-Who-CSRF: 1 protection on mutating /api/v1/* routes.
  • Embedded Svelte 5 + Tailwind CSS v4 Admin UI (ui/):
    • Overview: 24h KPIs, stacked traffic histogram, recent IP changes, and delivery error feed.
    • Records & Aliases: CRUD for persisted records and aliases, one-click ephemeral record promotion, token rotation/clearing, manual sync, and per-record DNS/IP & outbound delivery history drawer.
    • Integrations & Touch Files: Route53 DDNS (ip_version filtering + live test), HTTP webhooks (secret header masking + live test), and touch-file rules (live JSON preview + manual write).
    • Access Log, Audit Log & Settings: Time-range histogram & cursor-paginated filters, admin security/config audit trail, configurable hourly retention & manual prune, active session revocation, and JSON backup export/import (merge / replace).
  • Build, Docker & CI:
    • Multi-stage Dockerfile (node:24-alpine UI build -> golang:1-alpine static CGO_ENABLED=0 + UPX -> FROM scratch).
    • Adds go test -race -v ./... CI job gating image builds in .github/workflows/docker-build.yml.

Verification

  • pnpm --dir ui run check & pnpm --dir ui run build
  • golangci-lint run (0 issues)
  • go test -count=1 -race -cover ./... (all packages pass)
  • CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o who .
  • docker build -t ghcr.io/tracyhatemice/who:local .

@tracyhatemice
tracyhatemice merged commit 934e565 into master Nov 29, 2026
2 checks passed
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