Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
d999ff7
feat(ddns): add provider credential registry and generic Config.Crede…
tracyhatemice Nov 29, 2026
fbb5603
feat(storage): add ddns_secrets v2 schema, usage guards, and secret-l…
tracyhatemice Nov 29, 2026
eb2c32f
feat(api): add /api/v1/secrets CRUD, live secret rotation, and secret…
tracyhatemice Nov 29, 2026
9a14f73
feat(ui): add SecretModal and Provider Secrets management in Settings
tracyhatemice Nov 29, 2026
55934fa
feat(ui): generalize DDNS views and wire reusable provider secrets
tracyhatemice Nov 29, 2026
2b00f3c
fix(storage,api): purge v1 ddns delivery logs on upgrade and tighten …
tracyhatemice Nov 29, 2026
5155113
feat(auth): gate SPA behind OIDC, enforce live allowlists, and harden…
tracyhatemice Nov 29, 2026
da261ec
feat(logs,api): add structured filters, numbered pagination, Top view…
tracyhatemice Nov 29, 2026
631932e
fix(api): accept user-agent query param on access logs filter
tracyhatemice Nov 29, 2026
4d1e476
feat(ui): fix top-layer drawer animations and add Cap pagination, men…
tracyhatemice Nov 29, 2026
27ca64d
fix(ui): harden top-layer close races and popover anchor/light-dismis…
tracyhatemice Nov 29, 2026
6ddfb20
feat(ui): add tokenized FilterBar, nav route updates, and CSRF backup…
tracyhatemice Nov 29, 2026
cf40906
feat(ui): polish Records, alias history, standalone DDNS/Webhooks, To…
tracyhatemice Nov 29, 2026
790893a
fix(ui): clamp mutable page state and clear cross-request drawer load…
tracyhatemice Nov 29, 2026
2e50dcf
feat(ui): add TimeRangePicker, FilterBar, Pagination, and List/Top vi…
tracyhatemice Nov 29, 2026
67c6bfd
fix(ui): preserve session_revoked redirect, TimeRangePicker defaultRa…
tracyhatemice Nov 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 32 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,28 +141,33 @@ Returns `ok` (`200 OK`, `text/plain`) for container health/readiness checks with

### OIDC Setup

The Admin UI and `/api/v1/*` management API are protected by OpenID Connect (Authorization Code Flow with `S256` PKCE, `nonce` validation, `HttpOnly`/`SameSite=Lax` SQLite-backed session cookies, and `X-Who-CSRF: 1` protection on mutating requests).
The Admin UI and `/api/v1/*` management API are protected by OpenID Connect (Authorization Code Flow with `S256` PKCE, `nonce` validation, `HttpOnly`/`SameSite=Lax` SQLite-backed session cookies, per-request allowlist re-verification, `Sec-Fetch-Site: cross-site` rejection, and `X-Who-CSRF: 1` protection on mutating requests and `GET /api/v1/backup/export`).

Unauthenticated requests to the Admin UI root serve a minimal, self-contained HTML sign-in (or setup) page without loading the compiled Admin SPA bundle or exposing `/api/v1/*` routes, while unauthenticated requests to SPA assets return `401 Unauthorized`.

1. Create an OIDC client in your identity provider (Pocket ID, Authelia, Authentik, Keycloak, Google, etc.) with redirect URI:
- `https://<your-domain>/auth/oidc/callback` (default root mount), or
- `https://<your-domain><base-path>/auth/oidc/callback` when using `--base-path` (e.g. `https://example.org/admin/auth/oidc/callback`).
2. Set `WHO_OIDC_ISSUER` and `WHO_OIDC_CLIENT_ID` (plus `WHO_OIDC_CLIENT_SECRET` for confidential clients).
3. Restrict admin access via `WHO_OIDC_ALLOWED_EMAILS` (requires `email_verified: true` from the provider) and/or `WHO_OIDC_ALLOWED_SUBS`.

When OIDC is **not** configured, `who` runs normally for all public `/whoami`, `/iam`, and `/whois` traffic while keeping the Admin UI and `/api/v1/*` locked (`503 Service Unavailable`).
When OIDC is **not** configured, `who` runs normally for all public `/whoami`, `/iam`, and `/whois` traffic while serving the locked setup guide at the Admin UI root and returning `503 Service Unavailable` on `/api/v1/*`.

### Dashboard Views

- **Overview**: 24-hour KPI summary (persisted/ephemeral/alias counts, IP changes, `/iam`, `/whois`, and `/whoami` request totals, delivery errors), stacked 24h traffic histogram, recent IP changes with delivery badges, and recent delivery failures.
- **Records & Aliases**: Search and manage persisted records, dynamic aliases, and in-memory ephemeral records; promote ephemeral records to SQLite in one click; generate/rotate/clear `/iam` bearer tokens; trigger manual syncs; and inspect per-record **DNS / IP History** (`old_ip → new_ip`) alongside child DDNS, webhook, and touch delivery outcomes in a slide-over drawer.
- **Integrations (DDNS & Webhooks)**: Create, edit, enable/disable, and test AWS Route53 DDNS rules and HTTP webhook notifications. Secrets (`secret_key` and webhook header values) are masked (`••••••••`) in API responses and preserved on edit unless explicitly replaced.
- **Touch Files**: Manage JSON mirror file rules, preview the live flattened JSON payload (`{"iam", "ip", "last_update"}`), toggle rules on/off, and trigger immediate disk writes.
- **Access Log**: Time-bucketed public traffic histogram (`1h` / `24h` / `7d` / `30d`), cursor-paginated request log across `/whoami`, `/iam`, and `/whois` with rich filters (endpoint kind, IAM name, client IP, IP-changed only, errors only, free-text search), and a request inspection drawer.
- **Audit Log**: Cursor-paginated security and configuration trail covering OIDC logins, logouts, denied attempts, record/integration edits, token rotations, retention updates, and backup imports.
- **Settings & Backup**:
- **Log Retention**: Configure automatic hourly pruning windows (`access_logs` default `30` days, `audit_logs` default `90` days, `ip_history` default `0` / keep forever), view live `who.db` disk usage, or run manual pruning.
- **Active Sessions**: Inspect and revoke active OIDC admin sessions.
- **Backup & Restore**: Export the current configuration as a `config.json`-compatible JSON snapshot, or import a JSON backup in **Merge** (non-destructive upsert) or **Replace** mode.
- **Records**: Tokenized `key:value` filtering (`state:`, `type:`, `auth:`, `iam:`, `ip:`, `member:` plus free-text search) and numbered pagination across persisted records, dynamic aliases, and in-memory ephemeral records; explicit `Persisted` / `Ephemeral` badges; aligned `Sync`, `Edit`, `⋯`, and `Delete` actions (one-click persist to SQLite, `/iam` bearer token generation/rotation/clearing, manual syncs); and a paginated per-record **DNS / IP History** (`old_ip → new_ip`) drawer with child DDNS, webhook, and touch delivery outcomes.
- **DDNS**: Standalone view to create, edit, enable/disable, filter (`iam:`, `provider:`, `secret:`, `domain:`, `zone:`, `ip-version:`, `status:`), paginate, and manually trigger (`Sync`) dynamic DNS rules. Rules reference reusable provider credential bundles managed under **Settings → Provider Secrets**, with sensitive values masked (`••••••••`) in API responses and preserved on edit unless explicitly replaced.
- **Webhooks**: Standalone view to create, edit, enable/disable, filter (`iam:`, `method:`, `url:`, `status:`), paginate, and test outbound HTTP webhook notifications, with header values masked (`••••••••`) in API responses.
- **Touch Files**: Filter (`iam:`, `path:`, `ip:`, `status:`), paginate, and manage JSON mirror file rules, preview the live flattened JSON payload (`{"iam", "ip", "last_update"}`), toggle rules on/off, and trigger immediate disk writes.
- **Access Log**: Compact time-range picker (`1h` / `24h` / `7d` / `30d` / `All time` / custom range + `Refresh`), interactive stacked traffic histogram with range brushing, tokenized autocomplete filter bar (`endpoint:`, `iam:`, `method:`, `status:`, `ip:`, `changed:`, `user-agent:` plus free-text search), and a **`List | Top`** toggle switching between a server-paginated request log (with slide-over inspection drawer) and SQL-aggregated ranked breakdown cards (`Top Endpoints`, `Top IAMs`, `Top Client IPs`, `Top Status Codes`, `Top User-Agents`) with click-to-filter drill-down.
- **Audit Log**: Time-range picker (`All time` default plus `1h` / `24h` / `7d` / `30d` / custom range + `Refresh`), tokenized autocomplete filter bar (`category:`, `action:`, `actor:`, `target:`, `ip:` plus free-text search), and a **`List | Top`** toggle switching between a server-paginated security/audit trail and SQL-aggregated breakdown cards (`Top Categories`, `Top Actions`, `Top Actors`, `Top Targets`, `Top IPs`) with click-to-filter drill-down.
- **Settings**:
- **Appearance**: Switch between Light, Dark, and System color themes.
- **Provider Secrets**: Manage and paginate reusable DDNS provider credential bundles.
- **Data & Retention**: Configure automatic hourly pruning windows (`access_logs` default `30` days, `audit_logs` default `90` days, `ip_history` default `0` / keep forever), view live `who.db` disk usage, or run manual pruning.
- **Sign-In Sessions**: Inspect and revoke active OIDC admin sessions.
- **Backup**: Export the current configuration as a `config.json`-compatible JSON snapshot (via CSRF-protected fetch, optionally including secrets), or import a JSON backup in **Merge** (non-destructive upsert) or **Replace** mode.

## Core Features

Expand All @@ -171,7 +176,7 @@ When OIDC is **not** configured, `who` runs normally for all public `/whoami`, `
Configuration, IP transition history, delivery outcomes, access logs, audit logs, and admin sessions are stored in a single pure-Go SQLite database (`<data-dir>/who.db` in WAL mode, `/data/who.db` inside the container).

- **Persisted vs. Ephemeral names**: Names defined in SQLite (via the Admin UI or imported from `config.json`) persist their latest IP and `last_update` timestamp across restarts. Unconfigured names updated via `/iam/{name}` still work in memory as ephemeral records and can be persisted later from the UI.
- **First-boot `config.json` seeding**: Passing `--config=/path/to/config.json` (or `WHO_CONFIG`) imports `who`, `ddns`, `webhooks`, and `touch` into `who.db` **only when all four configuration tables are empty**. On subsequent restarts, `who.db` is authoritative and `config.json` is left untouched (so it can safely be mounted `:ro`).
- **First-boot `config.json` seeding**: Passing `--config=/path/to/config.json` (or `WHO_CONFIG`) imports `who`, `secrets`, `ddns`, `webhooks`, and `touch` into `who.db` **only when all five configuration tables are empty**. On subsequent restarts, `who.db` is authoritative and `config.json` is left untouched (so it can safely be mounted `:ro`).
- **Last-change semantics**: Re-registering the same IP address is a fast no-op — `last_update` is only bumped and side effects only fire when the IP actually changes (or when manually synced from the UI).

### 2. Optional `/iam` Bearer Tokens
Expand All @@ -187,19 +192,28 @@ Individual `who` records can optionally require a bearer token before `/iam/{nam

Records without a token remain open, preserving drop-in compatibility with existing scripts (such as `scripts/openwrt/70-ddns-update`).

### 3. DDNS (AWS Route53)
### 3. DDNS & Reusable Provider Secrets

Automatic asynchronous DNS `UPSERT` updates when a name's IP changes via `/iam/{name}` (or on manual sync/test from the Admin UI).
Automatic asynchronous DNS `A`/`AAAA` updates when a name's IP changes via `/iam/{name}` (or on manual sync/test from the Admin UI). Provider credentials live in a reusable `secrets` store so multiple DDNS rules can share and rotate keys in one place (`route53` supported today; structured for additional providers such as Cloudflare):

```json
{
"secrets": [
{
"name": "aws-main",
"provider": "route53",
"credentials": {
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
}
],
"ddns": [
{
"provider": "route53",
"secret": "aws-main",
"domain": "julia.ddns.example.com",
"ip_version": "ipv4",
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"zone_id": "Z3M3LMPEXAMPLE",
"ttl": 300,
"iam": "juliav4",
Expand All @@ -212,11 +226,10 @@ Automatic asynchronous DNS `UPSERT` updates when a name's IP changes via `/iam/{
| Field | Description |
|-------|-------------|
| `provider` | DNS provider (`route53`) |
| `secret` | Name of the saved `secrets` entry supplying provider credentials |
| `domain` | Record FQDN to update (e.g. `sub.example.com`, `example.com`, `*.example.com`) |
| `ip_version` | `ipv4` (`A` records), `ipv6` (`AAAA` records), or empty to accept either |
| `access_key` | AWS Access Key ID |
| `secret_key` | AWS Secret Access Key |
| `zone_id` | Route53 Hosted Zone ID |
| `zone_id` | Hosted Zone ID (e.g. Route53 Hosted Zone ID) |
| `ttl` | DNS record TTL in seconds (default: `300`) |
| `iam` | Record name that triggers this rule |
| `enabled` | Optional boolean (`true` by default) |
Expand Down
Loading
Loading