Skip to content

A container stack runs Freebird locally for evaluation.

Use the Docker Compose stack in deploy/container/ to try the Issuer, Origin, nginx, and browser demo on your workstation with one command. The stack is for evaluation only. It is not a supported deployment, and no image is published. Use the single-host deployment for anything longer-lived.

The stack builds one image from this checkout and runs four services:

Service Role
init Runs once. It creates a throwaway local CA and certificate, then runs setup with deploy/container/freebird.conf unless both roles already have state.
proxy Runs render-nginx with the same file and serves TLS on 127.0.0.1:8443 only.
issuer Runs serve-issuer --config as freebird-issuer with only the Issuer's volume.
origin Runs serve-origin --config as freebird-origin with only the Origin's volume.

The Issuer and Origin share the proxy's network namespace so that they can listen on loopback, as they do on a host. The names are issuer.localhost:8443 and origin.localhost:8443. The configuration enables the puzzle, app admission, and browser access for the demo page.

Start the stack and redeem one token.

Run these commands from the repository root. The first build compiles the Rust service and the demo and takes several minutes:

compose="docker compose -f deploy/container/compose.yaml"
$compose up --build -d
$compose logs init

The init log shows the genesis key ID and the next steps. Fetch the CA and check the Issuer directory through TLS:

$compose exec -T proxy cat /etc/letsencrypt/freebird-eval-ca.pem > freebird-eval-ca.pem
curl --cacert freebird-eval-ca.pem \
  https://issuer.localhost:8443/.well-known/private-token-issuer-directory

Most systems resolve *.localhost to the loopback address. If yours does not, add --resolve issuer.localhost:8443:127.0.0.1 to curl, or add both names to /etc/hosts. The stack accepts only hybrid post-quantum TLS, so use a curl built with OpenSSL 3.5 or later. The curl that ships with macOS cannot connect; Homebrew's curl can.

Create one invitation and spend it with the client inside the stack. The invitation file is a bearer secret, and the client consumes it:

(umask 077; $compose exec -T issuer freebird-privacy-pass-service \
  provision-live /var/lib/freebird-issuer/state) > invitation.txt
$compose exec -T proxy freebird-loopback-client \
  --tls-ca /etc/letsencrypt/freebird-eval-ca.pem --connect 127.0.0.1 \
  https://issuer.localhost:8443/ https://origin.localhost:8443/ < invitation.txt
rm invitation.txt

Check for issuance: 200; redemption: 200; replay: 401; invitation retry: 403.

Open the browser demo.

Import freebird-eval-ca.pem as a trusted authority in a separate browser profile, then open https://origin.localhost:8443/. The page solves a proof-of-work puzzle, obtains one token from the Issuer, and redeems it. Remove the CA from that profile when you finish because anyone with the stack's certificate key could impersonate the two names in that profile.

To try app admission, register an application inside the Issuer container. The command prints the application's key once:

$compose exec -T issuer freebird-privacy-pass-service \
  app-add /var/lib/freebird-issuer/state my-app 100

Rotate the Issuer's key and watch the Origin follow.

The Origin reads the Issuer's directory and installs each announced key by itself. To try a rotation, stop the Issuer, schedule a new key two hours ahead, and start the Issuer again:

run="$compose run --rm --no-deps --entrypoint freebird-privacy-pass-service issuer"
state=/var/lib/freebird-issuer/state
$compose stop issuer
$run stage-issuer-key "$state"
new="$($run issuer-key-status "$state" | awk '$1=="staged"{print $2}')"
$run activate-issuer-key "$state" "$new" $(( ($(date +%s) / 3600 + 2) * 3600 ))
$compose start issuer
$compose restart origin
$compose logs origin | grep 'key follower'

The log shows key follower: installed key <new> announced by the Issuer to start at <time>. The directory now lists the new key first with its not-before time, and tokens keep working with the current key until then. Restarting the Origin only makes it check at once; otherwise it checks every five minutes, and after a failed check it retries after 15 seconds, then less often. Without stopping the Issuer, $compose exec -T issuer freebird-privacy-pass-service rotate-live /etc/freebird/freebird.conf schedules the new key over the Issuer's control socket. The Origin installs it at its next check, within five minutes, or at once after $compose restart origin. Starting the Issuer also reruns init, which keeps the existing state and exits.

Stop or reset the stack.

$compose down stops the services and keeps both state volumes and the CA. The next up skips setup and serves the same keys. $compose down -v deletes the state and the CA so that the next up starts fresh. If only one role's state exists, init refuses to continue rather than resetting it.

The stack differs from the single-host deployment in ways that matter for security:

  • It uses a self-signed CA and a certificate for .localhost names.
  • It has no systemd sandboxing, serving permission, external key catalog, or cold backup.
  • It publishes only on 127.0.0.1 and should not be exposed to a network.