From 4804ac1f6181caf51593bc6af9aca6844ce871e6 Mon Sep 17 00:00:00 2001 From: Adnan Zahir Date: Mon, 16 Nov 2026 21:05:27 +0700 Subject: [PATCH] docs: Docker deployment notes, admin token length, session lifetime, reverse proxy example Co-Authored-By: Claude Sonnet 5.5 --- README.md | 22 ++++++++++++++++++++-- docs/DATABASE-CAPTURE.md | 7 ++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8fac459..49f2fc8 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,25 @@ export TESSERA_VAULT_PASSPHRASE='choose a long private passphrase' docker compose up --build ``` -Compose publishes **127.0.0.1:8787** only. The process inside the container listens on `0.0.0.0:8787` so that published port can reach it. The image includes `pg_dump` via `postgresql-client`. +Compose publishes **127.0.0.1:8787** only. The process inside the container listens on `0.0.0.0:8787` so that published port can reach it. Compose also needs operator, token or OIDC credentials (see above); pass them through the environment. `compose.yaml` forwards the `TESSERA_*` settings documented here. + +The image runs as the non-root user `tessera` (uid 10001) with a read-only root filesystem, no capabilities and a health check on `/health`. All state lives in the `/data` volume, and database dumps are staged there too (`TMPDIR=/data`), so size that volume for one full dump per concurrent capture. It ships `tessera-hub`, the `tessera` CLI, Restic, `mysqldump` and `pg_dump` 17. Base images are pinned by digest. + +Requirements and limits to know before exposing it: + +- `TESSERA_ADMIN_TOKEN` must be at least 32 characters (`openssl rand -base64 32`). +- Audit records are kept for `TESSERA_AUDIT_RETENTION_DAYS` days (default 90). +- `TESSERA_TRUSTED_PROXIES` takes a comma-separated list of exact proxy IP addresses, not CIDR ranges. Set it when a reverse proxy terminates TLS in front of the hub, along with `TESSERA_PUBLIC_URL`; otherwise the hub sees the proxy as every client. +- Run decay's space reclamation with `docker compose exec tessera-hub tessera gc`. +- Create the operator hash with `printf '%s\n' "$pw" | docker run --rm -i --entrypoint tessera-hub --hash-operator-password`. + +Example reverse proxy (Caddy on the same host, TLS handled by Caddy; set `TESSERA_PUBLIC_URL=https://tessera.example.org` and `TESSERA_TRUSTED_PROXIES=127.0.0.1`): + +``` +tessera.example.org { + reverse_proxy 127.0.0.1:8787 +} +``` ### CLI @@ -105,7 +123,7 @@ See [docs/SPEC.md](docs/SPEC.md). Rust workspace crates: `tessera-core`, `tesser - Set `TESSERA_WORMHOLE_MTLS` to `1` or `true` to open a client-certificate listener. It also needs `TESSERA_WORMHOLE_CERT`, `TESSERA_WORMHOLE_KEY`, and `TESSERA_WORMHOLE_CLIENT_CA`. `TESSERA_WORMHOLE_LISTEN` defaults to `127.0.0.1:8788`. While that listener is up, plain HTTP upload routes answer 403. An agent needs `TESSERA_WORMHOLE_CLIENT_CERT` and `TESSERA_WORMHOLE_CLIENT_KEY` for that listener. Configure `TESSERA_WORMHOLE_CA` when the hub certificate uses a private CA. - PostgreSQL captures still run a full `pg_dump` into a private temporary file. Restic can deduplicate matching bytes in the resulting dump. Allow temporary disk space for one full dump per concurrent capture. The Docker image contains only the hub (plus Restic and the database clients): build `tessera-agent` and the `tessera` CLI separately and install them on the hosts that need them. On non-x86 hosts build x86_64 binaries natively or in CI, not under QEMU emulation (`aws-lc-sys` crashes the compiler there). -The release image includes `pg_dump`; a native hub needs it on `PATH`. +A native hub needs `pg_dump` and `mysqldump` on `PATH`; the Docker image includes them. - The command provider is outside this release. Creating a command orbit and running it returns `command provider is outside this release; use filesystem or postgres`. - OIDC supports a single issuer (authorization code with PKCE). Administrators come only from configuration (`TESSERA_OIDC_ADMIN_SUBJECTS` / `TESSERA_OIDC_ADMIN_GROUPS`); there is no first-user-becomes-admin and no self-registration. Group grants are not re-checked against the IdP during a session. diff --git a/docs/DATABASE-CAPTURE.md b/docs/DATABASE-CAPTURE.md index 0c5a790..3dc2bf1 100644 --- a/docs/DATABASE-CAPTURE.md +++ b/docs/DATABASE-CAPTURE.md @@ -107,7 +107,7 @@ Forwarded requests are rejected in this mode, but that is not a proxy trust boundary: never reverse-proxy a development listener. Compose keeps the mode off and needs operator/API credentials even with a localhost published port. -Generate an Argon2id hash and set `TESSERA_OPERATOR_PASSWORD_HASH` to the result. The hub reads the password from stdin in hash mode. For example, from an interactive Bash shell: +In the container, run the hash mode through the image: `printf '%s\n' "$pw" | docker run --rm -i --entrypoint tessera-hub --hash-operator-password`. Generate an Argon2id hash and set `TESSERA_OPERATOR_PASSWORD_HASH` to the result. The hub reads the password from stdin in hash mode. For example, from an interactive Bash shell: ```bash read -rs -p 'Operator password: ' tessera_operator_password; printf '\n' @@ -115,7 +115,7 @@ export TESSERA_OPERATOR_PASSWORD_HASH="$(printf '%s\n' "$tessera_operator_passwo unset tessera_operator_password ``` -Set `TESSERA_OPERATOR_NAME` for the audited identity, or use the default `operator`. Serve the browser over HTTPS outside loopback. Sessions expire after eight hours or a hub restart. Browser mutations require the session's CSRF token. API and CLI callers use the separate `TESSERA_ADMIN_TOKEN`. Use the bundled HTTP CLI on the hub's loopback listener when sending the token. +Set `TESSERA_OPERATOR_NAME` for the audited identity, or use the default `operator`. Serve the browser over HTTPS outside loopback. Sessions expire after eight hours. They survive a hub restart as long as the operator credential is unchanged; rotating or removing `TESSERA_OPERATOR_PASSWORD_HASH` invalidates them. Browser mutations require the session's CSRF token. API and CLI callers use the separate `TESSERA_ADMIN_TOKEN`. Use the bundled HTTP CLI on the hub's loopback listener when sending the token. Legacy full-upload agents now need an explicit orbit assignment. With operator CSRF or an admin API token, call `PUT /api/v1/orbits/{orbit-id}/outpost` with @@ -270,7 +270,8 @@ immediately. A denial is written to the audit log at most once a minute per sour - Limiter state is in memory: it resets when the hub restarts and is not shared between hub processes. -**Shared admin token.** `TESSERA_ADMIN_TOKEN` is a transition aid. Set +**Shared admin token.** `TESSERA_ADMIN_TOKEN` is a transition aid. It must be at least +32 characters; generate one with `openssl rand -base64 32`. Set `TESSERA_ADMIN_TOKEN_EXPIRES` (`YYYY-MM-DD`, end of that day UTC, or an RFC 3339 timestamp) and the hub refuses the token after that time. Without it the hub logs a warning at start. Every use is audited as the `legacy-admin-token` service principal.