Skip to content

Commit b67cf5b

Browse files
committed
feat: refresh admin UI and local deployment
1 parent 06a7c30 commit b67cf5b

58 files changed

Lines changed: 2466 additions & 901 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
875 KB
Loading

Cargo.lock

Lines changed: 22 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ codegen-units = 1
3232
ahash = "0.8"
3333
argon2 = "0.5"
3434
async-trait = "0.1"
35-
base64 = "0.22.1"
35+
base64 = "0.23.0"
3636
brotli = "8"
3737
bytes = "1.12"
3838
chrono = { version = "0.4", features = ["serde"] }
@@ -50,7 +50,7 @@ hyper = { version = "1", features = ["full"] }
5050
hyper-tungstenite = "0.30"
5151
hyper-util = { version = "0.1", features = ["server", "tokio"] }
5252
http-body-util = "0.1"
53-
jsonwebtoken = { version = "10", features = ["rust_crypto"] }
53+
jsonwebtoken = { version = "11", features = ["rust_crypto"] }
5454
lz4_flex = "0.14.0"
5555
num_cpus = "1.17"
5656
num-traits = "0.2"

compose.cloud.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ services:
5050
environment:
5151
<<: *broker-common-env
5252
FITZ_AUTH_REQUIRED: "true"
53+
FITZ_ASSUME_LOCAL_LOOPBACK_EDGE: "true"
5354
FITZ_ADMIN_AUTH_MODE: "open"
5455
FITZ_HTTP_PORT: "${FITZ_AUTH_HTTP_PORT:-4090}"
5556
FITZ_TCP_PORT: "${FITZ_AUTH_TCP_PORT:-4091}"

compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ services:
3939
environment:
4040
<<: *broker-common-env
4141
FITZ_AUTH_REQUIRED: "true"
42+
FITZ_ASSUME_LOCAL_LOOPBACK_EDGE: "true"
4243
FITZ_ADMIN_AUTH_MODE: "open"
4344
FITZ_HTTP_PORT: "${FITZ_AUTH_HTTP_PORT:-4090}"
4445
FITZ_TCP_PORT: "${FITZ_AUTH_TCP_PORT:-4091}"

docs/development/architecture.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ Brokers deployed with runtime auth or protected admin on non-loopback binds must
699699
- Set `FITZ_ASSUME_EXTERNAL_TLS=true` in TLS-terminated deployments. Fitz fails startup when runtime auth or protected admin is enabled on a non-loopback bind without this explicit assertion
700700
- Configure exact public `FITZ_WS_ALLOWED_ORIGINS` for browser WebSocket clients; Fitz defaults only to loopback local-development origins
701701
- HTTP headers, request bodies, WebSocket frames, and total HTTP connection lifetimes are bounded at ingress so unauthenticated clients cannot retain unlimited parser or connection resources
702+
- Repo-owned local Compose examples set `FITZ_ASSUME_LOCAL_LOOPBACK_EDGE=true` because Fitz binds inside a container while Docker publishes only to host loopback. The assertion requires loopback browser origins, does not enable HSTS, and is not valid for production
702703
2. **TCP traffic:**
703704
- Use a TLS-capable load balancer, sidecar, or private trusted network for raw TCP
704705
- Disable raw TCP with `FITZ_TCP_ENABLED=false` when only browser traffic is needed

docs/operations/production-auth.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@ Do not carry these local-dev conveniences into production:
7777
- `FITZ_ADMIN_AUTH_MODE=open`
7878
- `FITZ_JWT_HMAC_SECRET`
7979
- `FITZ_JWT_ALLOW_INSECURE_HTTP=true`
80+
- `FITZ_ASSUME_LOCAL_LOOPBACK_EDGE=true`
8081
- loopback-only or placeholder origins
8182
- repo compose files as deployment manifests

docs/user-guides/vars.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This page is the central reference for environment variables supported by Fitz r
1212
| FITZ_TCP_PORT | u16 port | 4091 | Raw TCP listener port. |
1313
| FITZ_BIND_ADDR | IP or hostname | 0.0.0.0 | Bind address for listeners. |
1414
| FITZ_ASSUME_EXTERNAL_TLS | true or false | false | Confirms that a trusted external edge terminates TLS and enables TLS-dependent browser behavior such as HSTS. Fitz refuses to start with runtime auth or protected admin on a non-loopback bind unless this is true. Loopback development can leave it unset. |
15+
| FITZ_ASSUME_LOCAL_LOOPBACK_EDGE | true or false | false | Confirms that a trusted local container edge publishes Fitz listeners only on host loopback. This allows authenticated local Compose without asserting TLS or enabling HSTS, and requires loopback WebSocket and admin origins. Never enable it outside local development. |
1516
| FITZ_WS_ALLOWED_ORIGINS | Comma-separated exact browser origins, e.g. https://app.example.com | Local loopback origins for ports 3000 and 4090 | Browser WebSocket Origin allowlist. Values are HTTP origins, not wss URLs, and must not include a path, query, fragment, or trailing slash. Public browser deployments should set this to their exact SPA origins. |
1617
| FITZ_DRAIN_GRACE_SECONDS | Positive integer seconds | 25 | Planned redeploy drain grace. During drain, `/healthz` and `/readyz` fail and new TCP/WebSocket sessions are rejected before active sessions are closed on shutdown. Set lower than the external termination grace. |
1718
| FITZ_DRAIN_CLOSE_REASON | Non-empty string | broker draining for redeploy | Server close reason recorded when planned drain shutdown closes active sessions. |
@@ -71,6 +72,7 @@ The repo compose files are local-development examples only:
7172
- `compose.yml`, `compose.cloud.yml`, and `compose.sqrzl.yml` publish only to loopback and are not production deployment manifests.
7273
- `compose.yml` and `compose.cloud.yml` keep `fitz-auth` on `FITZ_JWT_HMAC_SECRET` by default so `docker compose up` stays the shortest successful path.
7374
- Those same compose files keep `FITZ_ADMIN_AUTH_MODE=open` because the admin surface is loopback-only and meant for local inspection.
75+
- Those same compose files set `FITZ_ASSUME_LOCAL_LOOPBACK_EDGE=true` because Fitz binds inside its container while Docker publishes the listeners only on host loopback. This does not assert TLS or enable HSTS.
7476
- The built-in loopback defaults for `FITZ_WS_ALLOWED_ORIGINS` are only for local development.
7577

7678
To exercise issuer/JWKS plumbing locally instead of the default HMAC flow:
@@ -88,6 +90,7 @@ For authenticated browser or API deployments outside local development:
8890
- Set `FITZ_AUTH_REQUIRED=true`.
8991
- Configure runtime JWT verification with `FITZ_JWT_JWKS_MAP`. Do not rely on `FITZ_JWT_HMAC_SECRET` in production.
9092
- Set `FITZ_ASSUME_EXTERNAL_TLS=true` when TLS terminates outside Fitz.
93+
- Do not set `FITZ_ASSUME_LOCAL_LOOPBACK_EDGE`; it is only for host-loopback local container publishing.
9194
- Set `FITZ_WS_ALLOWED_ORIGINS` to the exact public SPA origins allowed to open browser WebSockets.
9295
- Set `FITZ_ADMIN_AUTH_MODE=protected`, `FITZ_ADMIN_PUBLIC_ORIGIN=https://admin.example.com`, and keep `FITZ_ADMIN_COOKIE_SECURE=true`.
9396
- Expect protected-admin session cookies to expire on broker restart because the signing key is generated in memory per process.

public/openapi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3332,7 +3332,7 @@ components:
33323332
type: array
33333333
items:
33343334
type: string
3335-
description: Public bootstrap Route Family grants. Empty in protected mode; use the authenticated session endpoint for admin grants after login.
3335+
description: Provisioned Route Families available to public bootstrap in open mode. Empty in protected mode; use the authenticated session endpoint for admin grants after login.
33363336
route_families_wildcard:
33373337
type: boolean
33383338
description: True only when public bootstrap runs with wildcard Route Family access, such as open admin mode.

src/api/admin/assets/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use once_cell::sync::Lazy;
1717
use std::path::Path;
1818

1919
const CACHE_CONTROL: &str = "public, max-age=3600";
20+
const HTML_CACHE_CONTROL: &str = "no-cache";
2021
const INDEX_PATH: &str = "index.html";
2122
const PUBLIC_ASSET_ROOT: &str = "/app/public";
2223
const VARY_ACCEPT_ENCODING: &str = "Accept-Encoding";

0 commit comments

Comments
 (0)