Portable, public templates for running Hopae in production. Operator copies
(hopae.env, hopae.local.json, state/) stay local and are git-ignored. The
hostnames (auth.example.test, app.example.test) are placeholders.
| File | Purpose |
|---|---|
compose.yaml |
Hardened Docker Compose service: user 1000, read-only root, all capabilities dropped, no-new-privileges, memory and process limits, rotated JSON logs, host network namespace with loopback listeners |
hopae.example.json |
Configuration with one application and the Google provider; copy to hopae.local.json. The management console is off; add the admin block below to enable it |
env.example |
Environment variable names (values are change-me placeholders); copy to hopae.env |
hangang-routes.example.json |
The portal route, a protected application route and the hopae-admin console route, as Hangang route objects (the protected routes need gateway changes HC-3 for static_request_headers and HC-12 for the route-level strip_request_cookies, which also belongs on any public route of the same host; without HC-12 the session handle reaches the application in the cookie header. The console route deliberately has no strip_request_cookies: the console reads its own handle cookie) |
The image is built from the repository Dockerfile (static musl binary, empty
scratch base). Tag convention: hopae:<version>-<shortsha>.
- Build:
docker build --network=host -t hopae:0.1.0-abc1234 .from the repository root (or letdocker compose builddo it), and setHOPAE_TAGto the tag. - Create the private files:
cp env.example hopae.envandcp hopae.example.json hopae.local.json; edit both. Generate the caller key with a CSPRNG (for exampleopenssl rand -base64 32); give the gateway the same value asHANGANG_HOPAE_KEY. - Create the state directory:
install -d -m 700 -o 1000 -g 1000 state. - Validate:
docker compose run --rm hopae --check --config /etc/hopae/hopae.json. It prints the routeauthfragment and the provider redirect URI (https://auth.example.test/callback/google) to register at the provider. - Back up
state/if it holds data, thendocker compose up -d. - Register the two routes (portal and application; the console route only if you enable the console, below) of
hangang-routes.example.jsonon the gateway (admin API for a live gateway), with your real hosts and backend for the application. - Smoke test: open the protected host in a browser, sign in, confirm the upstream sees the identity headers and a client-supplied
x-forwarded-userdoes not reach it, sign out, and confirm the next request redirects to login.
The console is an extra listener and an extra route. Everything below uses the
placeholder host hopae-admin.example.test; use your own.
- Give the console host DNS and TLS on the gateway.
- Add to
hopae.local.json(a fragment;listen.admindefaults to127.0.0.1:8702, and the listener is bound only whenadmin.public_urlis set):
{
"listen": {"portal": "127.0.0.1:8700", "gateway": "127.0.0.1:8701", "admin": "127.0.0.1:8702"},
"admin": {
"public_url": "https://hopae-admin.example.test",
"max_auth_age": "12h"
}
}- Register the
hopae-adminroute ofhangang-routes.example.jsonwith your host. It must have theauthblock and must not strip Hopae's cookies. The gateway's address must be intrusted_proxies(the default127.0.0.1/32fits a gateway on the same host). - Validate and restart:
docker compose run --rm hopae --check --config /etc/hopae/hopae.jsonlists the console as the implicit applicationadmin, prints the route fragment and the freshness capability of each provider (for the Google preset:reauth unsupported: console freshness is Hopae login age). The start printsadmin listening on 127.0.0.1:8702. - Sign in once at the console host (the page answers
403 not_adminand shows your user id), thendocker compose run --rm hopae admin grant <user_id> --config /etc/hopae/hopae.json, and reload the page. If you grant by email and the provider is not authoritative for that address, the command prints the resolved user and asks for--confirm <user_id>.
The first start after the upgrade applies migration 0003 and writes
state/hopae.db.bak-v2 first; see the operations guide.
The administration guide is ../docs/ADMIN.md.
Operation, upgrades, backups and key rotation: see the operations guide. Every key: see the configuration reference.