- POST /refresh-runs accepts undo_of: restores the safety copy of a completed restore back onto the same target through the normal run engine (checks, countdown, progress, and a new safety copy so the undo can be undone); refused when something was restored after it or the copy is gone - a safety copy is accepted as a source only for the target it was taken from (hub and agent both check) - run views carry undo and undo_available; audited as refresh.undo_started - the modal offers Undo last restore and, after a restore, Undo this restore - proven with a real agent and PostgreSQL: restore, undo back to the original contents, undo of the undo Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Tessera
Self-hosted backup vault with a space-themed canvas: orbits, snapshots, decay, and wormhole outposts.
Quick start
For a native install, put Restic 0.19.1 or newer on the hub and CLI's PATH. The Docker image includes Restic.
# Build UI then hub
cd web && npm ci && npm run build && cd ..
cargo build --release -p tessera-hub
export TESSERA_DATA_DIR=./data
export TESSERA_VAULT_PASSPHRASE='choose a long private passphrase'
./target/release/tessera-hub
The hub listens on 127.0.0.1:8787 unless TESSERA_LISTEN is set. Open http://127.0.0.1:8787. The OpenAPI document is at /api-doc/openapi.json. There is no default passphrase, and new vaults refuse the old published value dev-vault-key. Leave TESSERA_SEED_DEMO unset; TESSERA_SEED_DEMO=1 writes demo backup history into the data directory.
Authentication is required by default, including on loopback. Configure at least one of: the emergency operator
(TESSERA_OPERATOR_PASSWORD_HASH), a shared API token (TESSERA_ADMIN_TOKEN, optionally with
TESSERA_ADMIN_TOKEN_EXPIRES), or OIDC single sign-on. The hub refuses to start with none of them. For synthetic local
development only, TESSERA_LOCAL_DEVELOPMENT=true allows anonymous loopback access. See
docs/DATABASE-CAPTURE.md for operator sign-in, OIDC, per-orbit access grants, downloads,
production-to-staging relations and refresh runs.
Docker Compose
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.
CLI
cargo build --release -p tessera-cli # the binary is named `tessera`
export TESSERA_VAULT_PASSPHRASE='choose a long private passphrase'
./target/release/tessera init
./target/release/tessera orbit nightly --path ./docs
./target/release/tessera snap
./target/release/tessera list
Deduplicated backups
New captures use Restic. Orbits select Filesystem / Folder or Database, then Via Hub or Via Outpost. Filesystem orbits executed by the hub back up files directly and share encrypted chunks in vault/restic. Each successful run creates a complete restore point. The API reports size_bytes for the logical backup, stored_bytes for new packed data and metadata, and new_data_chunks for newly stored payload chunks. An identical backup can add metadata while reporting zero new data chunks.
Restore a new filesystem or Restic outpost snapshot to a file such as restore.tar. PostgreSQL and legacy upload restores still produce the original payload bytes. Existing snapshots use their original storage and restore format. Keep the entire vault directory and its passphrase together when moving a Tessera installation.
Decay removes expired snapshots from Tessera's list. Run tessera gc periodically from the host or container with the same data directory and vault passphrase to let Restic reclaim their unreferenced chunks. Run it during a quiet period so Restic can acquire its repository locks. Legacy packs and Restic snapshots created outside Tessera's catalog require separate maintenance.
Custom retention
Choose Custom (GFS) in an orbit's retention settings. Each count selects the newest snapshot in each of the most recent occupied UTC days, ISO weeks (Monday to Sunday), months, or years. Empty periods do not use up a count. A snapshot can satisfy more than one tier. Set a tier to zero to skip it and keep at least one tier above zero. Existing presets keep their original behavior.
To set 7 daily, 2 weekly, 6 monthly, and 3 yearly snapshots from the CLI:
tessera orbit archive --path /srv/archive --keep-daily 7 --keep-weekly 2 --keep-monthly 6 --keep-yearly 3
tessera retention <orbit-id> --keep-daily 7 --keep-weekly 2 --keep-monthly 6 --keep-yearly 3
The API accepts {"retention":{"keep_daily":7,"keep_weekly":2,"keep_monthly":6,"keep_yearly":3}} as part of POST /api/v1/orbits or as the body of PUT /api/v1/orbits/{id}/retention. Omitted tiers default to zero. To switch back to a preset, send {"decay_preset":"week-of-dailies"} to the same PUT endpoint or use tessera retention <orbit-id> --preset week-of-dailies. Saving applies the policy after the next successful capture. The separate tessera decay --preset command applies its selected preset to legacy snapshots. Managed captures use their profile policy.
Managed database backups
Pair an agent and register a capture profile for PostgreSQL or MySQL. Profiles support direct connections and pinned SSH, scheduled capture, job history, downloads, and optional S3 copies. The managed path stores dumps in the hub's existing Restic repository.
Incremental Wormhole transfers for filesystem archives
The same repository setup is used by new Outpost backup profiles.
Rest Server's .htpasswd must use bcrypt entries (htpasswd -B); Apache apr1 hashes from openssl passwd -apr1 are rejected with "Invalid htpasswd entry". Restart Rest Server after changing the file (a reload signal was not enough in testing).
Run Rest Server with TLS, authentication, --append-only, and --private-repos. Point its storage at the hub's vault/outposts directory. Both processes need filesystem access to that directory. Give Rest Server access only to outposts, with a separate location for its TLS and authentication files.
- Pair the agent as usual. Save the outpost UUID and upload token from the pairing response. Create an orbit with
tessera orbit <name> --provider wormhole. The agent'sruncommand handles scheduling. - Initialize a Restic repository at
vault/outposts/<orbit-id>with a unique repository password. Create a Rest Server login named<orbit-id>with a separate HTTP password. Put a mode0600file namedvault/keys/outpost-<orbit-id>.jsonon the hub with the fieldsoutpost_id(the paired UUID) andpassword(that repository's password). Back up this configuration with the vault. - On the agent, set
TESSERA_HUB_URL,TESSERA_UPLOAD_TOKEN,TESSERA_ORBIT_ID, andTESSERA_RESTIC_REPOSITORY(for example,rest:https://backup.example.org/<orbit-id>/). Supply the repository password viaRESTIC_PASSWORD_FILEorRESTIC_PASSWORD, and Rest Server credentials viaRESTIC_REST_USERNAMEandRESTIC_REST_PASSWORD. Runtessera-agent beamfrom the directory to back up. For a private Rest Server CA, setRESTIC_CACERTon the agent.
The agent reads files to detect changes, sends missing chunks and metadata through Restic, and then registers the successful snapshot with Tessera. Agents using the original Wormhole upload mode still send their full archive. The hub deduplicates that archive on disk.
If the Restic backup succeeds and registration fails, retry POST /api/v1/wormhole/restic/commit with the paired X-Tessera-Upload-Token and a JSON body containing orbit_id and the Restic snapshot_id from the error. Repeating registration for the same snapshot returns the same Tessera snapshot ID.
Access model
Browser users sign in with OIDC (or the emergency operator) and receive only the permissions an administrator granted:
orbit.read, snapshot.read, capture.run, snapshot.download, globally or per orbit. Everything else is
administrator-only. A person may also be allowed to refresh one staging database from its production source through a
relation grant; they see no other data. Outposts authenticate with their own digest-stored tokens. Production and
staging are separated by explicit, versioned relations, and an overwrite is re-authorised right before it is applied.
Architecture
See docs/SPEC.md. Rust workspace crates: tessera-core, tessera-store, tessera-providers, tessera-hub, tessera-agent, tessera-cli.
Limitations (v1)
- New vaults derive the key with Argon2id (19 MiB, 2 iterations, parallelism 1) and record
keys/kdf.json. A vault that already has a salt and nokdf.jsonstill opens with PBKDF2-HMAC-SHA256, 100,000 iterations. New snapshot metadata is written as{id}.json.enc. Existing{id}.jsonfiles still list and restore. - Wormhole pairing codes and upload tokens are stored in SQLite and survive a hub restart. Chunks are written at the given offset. When the bytes cover
total_bytes, the hub seals them into the vault and deletes the.partfile.total_bytesis required. - Set
TESSERA_WORMHOLE_MTLSto1ortrueto open a client-certificate listener. It also needsTESSERA_WORMHOLE_CERT,TESSERA_WORMHOLE_KEY, andTESSERA_WORMHOLE_CLIENT_CA.TESSERA_WORMHOLE_LISTENdefaults to127.0.0.1:8788. While that listener is up, plain HTTP upload routes answer 403. An agent needsTESSERA_WORMHOLE_CLIENT_CERTandTESSERA_WORMHOLE_CLIENT_KEYfor that listener. ConfigureTESSERA_WORMHOLE_CAwhen the hub certificate uses a private CA. - PostgreSQL captures still run a full
pg_dumpinto 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): buildtessera-agentand thetesseraCLI 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-syscrashes the compiler there).
The release image includes pg_dump; a native hub needs it on PATH.
- 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.
License
AGPL-3.0-or-later — see LICENSE.