Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Self-host

Summary: run your own server: build it, configure it, publish it, and create the first account.

  1. Build the server and the web bundle (Rust version in rust-toolchain.toml; the web bundle needs wasm-bindgen-cli with the version in Cargo.lock):

    cargo build --release -p secrets-server
    cargo xtask web --issuer https://secrets-api.example.com --web https://secrets.example.com   # writes target/web
    
  2. Install target/release/secrets-server and write /etc/secrets/server.toml (see Operation for the keys). Run it under systemd as its own user with the hardening of spec §14.6. It listens on 127.0.0.1:8470.

  3. Publish the public listener at the API origin through a reverse proxy or an outbound tunnel. Set client_ip_header to the header your proxy sets.

  4. Serve target/web from the web origin on a static host, with the headers of its _headers file. Both origins must serve /.well-known/secrets-server.

  5. Create the first account:

    sudo -u secrets secrets-server --config /etc/secrets/server.toml admin invite --admin
    

    Open the printed link, register a passkey, and store the recovery key.

  6. Back up the database: Litestream or another WAL-aware tool for SQLite, pg_dump or WAL archiving for PostgreSQL.

Check it from a client: secrets-chad login --host secrets.example.com, then secrets-chad doctor.

Spec: §4.3, §13.2, §14.