Deploying RookOne Server
Run a self-hosted RookOne Server: evaluate it end to end, then deploy the container with its locked-down defaults.
RookOne Server is the self-hosted, private half of RookOne. It lets authenticated agents send opaque bytes, catch up from an inbox, and acknowledge delivery. It carries no billing, no quota system and no hosted control plane — those belong to the hosted service and are simply not present here. It supports optional email and company OIDC person sign-in, and can also verify operator tokens issued by an external authority.
Message storage is file-backed NATS JetStream. PostgreSQL stores enrollment, people, sessions and directory state; a separate SQLite database stores admin state. Each tenant gets an isolated NATS account with its own message and acknowledgement streams.
The supported first-launch deployment is the immutable release bundle running
with Docker Compose on one VM or EC2 host. The rc.61 bundle was exercised from
fresh AWS provisioning through teardown. Use client 0.4.29 or newer. The server's
advisory compatibility check returns HTTP 426 before authentication for reported
versions below that minimum. It is not an enforced floor or a security boundary:
clients can bypass it by omitting the version header. Newer prereleases such as
0.4.30rc1 and 0.4.30.dev0 pass; 0.4.29rc1 is below the stable 0.4.29 minimum.
Invalid version values, including source builds reporting unknown, receive 426.
Release acceptance also drives two stock
0.4.29 CLIs
through enrollment, messaging and wipe-on-delivery. Kubernetes and
managed Kubernetes qualification are post-launch. The source-checkout
evaluation below rehearses behavior; it is not the release-bundle install path.
Install the release bundle with Compose
Use a Linux amd64 or arm64 host with Docker Engine, Compose v2 and Python 3.12
or newer with the cryptography package installed (the host-side operator script
imports it). Run as a non-root operator who can use Docker and owns
/srv/rookone-server. Budget disk for the streams described below, PostgreSQL,
logs and separate backups. Have your DNS name resolve to this host and allow
clients to reach its TLS port. No public PostgreSQL or NATS port is needed.
Download the chosen release's rookone-server-<version>.tar.gz and matching
.sha256 from the repository's Releases page (server releases are tagged server-v*) (repository access is currently
required). Keep the release manifest and signature artifacts for your provenance
checks. The checksum below checks archive integrity; it is not independent proof
of publisher identity. In these commands replace <version> with the asset's
version, and use the same version throughout:
Copy the tarball and its .sha256 into /srv/rookone-server/bundle/ after
creating these directories as your operator user.
sudo install -d -o "$(id -un)" -g "$(id -gn)" /srv/rookone-server /srv/rookone-server/bundle /srv/rookone-server/release
cd /srv/rookone-server/bundle
sha256sum --check rookone-server-<version>.tar.gz.sha256
tar -xzf rookone-server-<version>.tar.gz -C /srv/rookone-server/release
cd /srv/rookone-server/release/rookone-server-<version>
python3 rookone-server-operator.py load-images \
--bundle . --env-out /srv/rookone-server/images.env
cp release.env.example /srv/rookone-server/release.env
grep -vE '^ROOKONE_SERVER_(NATS_|NGINX_|POSTGRES_|CERBOS_)?(RUNTIME_)?IMAGE=' \
/srv/rookone-server/release.env > /srv/rookone-server/release.env.new
cat /srv/rookone-server/images.env >> /srv/rookone-server/release.env.new
mv /srv/rookone-server/release.env.new /srv/rookone-server/release.env
chmod 0600 /srv/rookone-server/release.envCreate the bundle download directory before downloading. The loader verifies
image architecture and supplies all five components' image lines, including
Cerbos. Edit release.env: set ROOKONE_SERVER_UID and ROOKONE_SERVER_GID to
id -u and id -g. Keep its state paths under /srv/rookone-server/state for
these examples. That state directory must not exist yet. The optional broker
placeholders are unused unless you add the broker layer.
TLS and initialization
Obtain a certificate valid for your server DNS name, its matching private key,
and the CA chain clients should trust. Put regular files (not symlinks) at
/srv/rookone-server/tls-in/tls.crt, tls.key, and ca.pem, owned by the operator;
use mode 0600 for the private key. Copy certificate-manager symlink targets
into these files. No certificate or DNS record is provisioned by the operator.
Get the two PEM files right before initialize, even with a public certificate:
tls.crtis the full chain: your certificate followed by its intermediates (certbot'sfullchain.pem, notcert.pem). With the certificate alone, clients fail withunable to verify the first certificate.ca.pemmust end in a self-signed root. Clients trust only this bundle for the server, not their system store, so for Let's Encrypt it is the intermediate chain plus the root:cat chain.pem isrgrootx1.pem > ca.pem(ISRG Root X1, fromletsencrypt.org/certificates). Intermediates alone fail withunable to get issuer certificate.
initialize pins the certificates in ca.pem into the deployment identity's
trust roots. rotate-tls replaces the served certificate but not those pinned
roots, so a renewal must chain to the same root. If the wrong bundle was pinned,
there is no in-place fix: a client refuses any other bundle
(deployment_ca_bundle_digest_mismatch). Re-run initialize with the correct
files into a fresh state directory, then distribute the new trust bundle and
fingerprint; agents enroll again.
Set ROOKONE_SERVER_TLS_HOST_PORT=443 in release.env for the URLs below. If you
use another port, include it in all three URLs, in client trust setup and in
ROOKONE_SERVER_PUBLIC_ORIGIN. The WSS path is exactly /nats.
case "$(uname -m)" in
aarch64|arm64) arch=arm64 ;;
x86_64|amd64) arch=amd64 ;;
*) echo "unsupported architecture" >&2; exit 1 ;;
esac
install -m 0700 "assets/nsc-$arch" /srv/rookone-server/nsc
python3 rookone-server-operator.py --env-file /srv/rookone-server/release.env \
initialize --state-dir /srv/rookone-server/state \
--nsc-path /srv/rookone-server/nsc --deployment-id acme-production \
--api-url https://server.acme.example --wss-url wss://server.acme.example/nats \
--enrollment-url https://server.acme.example/api/v1/enrollment \
--tls-cert /srv/rookone-server/tls-in/tls.crt \
--tls-key /srv/rookone-server/tls-in/tls.key \
--ca-bundle /srv/rookone-server/tls-in/ca.pem --tenant engineering
python3 rookone-server-operator.py --env-file /srv/rookone-server/release.env preflight
python3 rookone-server-operator.py --env-file /srv/rookone-server/release.env upRepeat --tenant during initialization for each tenant you need. Admission
rules must name those tenants. Do not re-run initialization on existing state.
Distribute the trust bundle and fingerprint using
deployment identity before enrolling clients.
To renew TLS, provide the new regular PEM files to the same operator's
rotate-tls --tls-cert ... --tls-key ... --ca-bundle ... command, with the same
--env-file before the subcommand. This replaces TLS files and recreates ingress containers;
changing the deployment's trust anchor also requires client trust updates.
When the optional broker is configured, the helper also recreates
identity-ingress. Pass the same Compose overrides to rotate-tls that you use
for startup; both ingresses share the certificate directory. Recreating the
containers mounts the replaced directory. On failure the helper restores the old
files and attempts to recreate both ingresses with them. Verify all endpoints:
curl --fail --cacert /srv/rookone-server/state/tls/ca.pem https://server.acme.example/healthz
curl --fail --cacert /srv/rookone-server/state/tls/ca.pem https://identity.acme.example:8444/healthz
curl --fail --cacert /srv/rookone-server/state/tls/ca.pem https://identity.acme.example:8445/healthzVerify the server and both broker endpoints with your actual hostnames and ports. Successful TLS alone does not prove the new certificate is loaded if the old one is still valid. Compare each served SHA-256 fingerprint with the new certificate; all three must match for this shared-certificate setup:
openssl x509 -in /srv/rookone-server/state/tls/tls.crt -noout -fingerprint -sha256
for endpoint in server.acme.example:443 identity.acme.example:8444 identity.acme.example:8445; do
openssl s_client -connect "$endpoint" -servername "${endpoint%:*}" \
-CAfile /srv/rookone-server/state/tls/ca.pem -verify_return_error </dev/null \
| openssl x509 -noout -fingerprint -sha256
doneWithout the broker, verify only the server endpoint.
Database and persistent state
Initialization creates state/secrets/postgres-password and postgres-dsn;
the bundled PostgreSQL uses database/user rookone on the internal network.
up waits for PostgreSQL, runs the migration service, then starts the server.
Migrations run forward; an older image is not a database rollback.
Keep the whole state directory: postgres for the ledger and directory, nats
for retained messages, admin/admin.sqlite for administrator state and audit,
media for attachments, and identity, operator, runtime, secrets, tls
for keys and configuration.
Attachments
The server keeps file attachments in ROOKONE_SERVER_MEDIA_DATA_DIR (default <state>/media,
mounted at /var/lib/rookone/media). Clients encrypt files before upload, so the
volume holds ciphertext only. Without the setting (ROOKONE_SERVER_MEDIA_DIR in the
container) the media routes answer 501 media_unavailable.
| Limit | Default | Setting (ROOKONE_SERVER_…) | Source |
|---|---|---|---|
| File size | 50 MiB of ciphertext, also the maximum (the shipped nginx allows 51m); a larger value stops the server at start-up | MEDIA_MAX_BYTES | shared media rules |
| Uploads | 30 per agent per minute | MEDIA_UPLOADS_PER_AGENT_PER_MINUTE | unmeasured |
| Storage per organization | 20 GiB, unconfirmed uploads counted at their declared size (507) | MEDIA_TENANT_STORAGE_BYTES | unmeasured |
| Free-space floor | 1 GiB; uploads refused (507) below it, checked again before an upload is kept | MEDIA_MIN_FREE_BYTES | unmeasured |
| Transfer pace | 32 KiB/s after the first minute, measured on bytes moved; slower transfers are cut | MEDIA_MIN_TRANSFER_BYTES_PER_SECOND | unmeasured |
| Concurrent transfers | 8 uploads and 8 downloads, 2 per source address and 2 per agent, outside the 32 request slots | none | unmeasured |
| Upload / download URL lifetime | 15 minutes / 5 minutes | none | hosted's values |
| Retention | 90 days, also enforced when a link is issued or used; an upload never confirmed is removed after 1 day | none | shared media rules |
Transfer URLs are bearer grants: the server's access log shows them as
/api/v1/media/objects/<redacted>. The shipped nginx writes no access log for them, and
logs only crit errors there, because nginx error lines quote the request and upstream URL.
Transfer URLs are signed with a key derived from the agent-token signing key, so
rotating that key ends every outstanding transfer URL (clients ask for new ones).
The volume shares the state disk with PostgreSQL and JetStream unless you mount it
elsewhere; the floor and the per-organization limit keep files from filling it. Run
one server process per media volume: a shared volume across replicas is not supported
yet (the upload-confirm check is per process). An environment file written
before attachments needs no edit: an unset ROOKONE_SERVER_MEDIA_DATA_DIR means
<state>/media, which the operator helper creates. The Helm chart does not mount a
media volume yet.
The Compose installer supplies PostgreSQL; replacing it with a managed database
requires a separate configuration and is not covered by this procedure.
Health checks
From a device that trusts the CA, verify the public ingress, not just Docker:
curl --fail --cacert /srv/rookone-server/state/tls/ca.pem https://server.acme.example/healthz
curl --fail --cacert /srv/rookone-server/state/tls/ca.pem https://server.acme.example/readyz
curl --fail --cacert /srv/rookone-server/state/tls/ca.pem https://server.acme.example/version
docker compose --env-file /srv/rookone-server/release.env -f compose.yaml ps
docker compose --env-file /srv/rookone-server/release.env -f compose.yaml logs --tail 100 relay migrate/healthz is process liveness only. /readyz returns 200 when all required
services are ready and 503 otherwise; inspect each service's detail. Optional
capacity checks do not make a full tenant unready. /readyz needs no credential and names no tenant: storage and capacity
failures report fixed codes, and the per-tenant detail goes only to the server log.
Each readiness probe has a five-second deadline (unmeasured: no load test chose
it). Persistence runs first because transport reuses its answer; the others run
together, so a full answer takes at most ten seconds. A probe that raises reports
probe_failed and one that runs out of time reports probe_timeout, never the
error text and never a 500. The PostgreSQL ledger check has a separate four-second
driver deadline covering reconnect and query I/O for the readiness probe only.
A timed-out probe closes its connection and releases its worker; concurrent ledger
probes report not ready while that probe runs. This does not bound ordinary
requests: a hung ordinary request can still retain a worker and leave /readyz
reporting ready. The shipped health checks (compose and Helm) give up
after two to three seconds, before the deadline, so they see a timeout rather than
the 503 body; both mean not ready.
GET /api/v1/admin/diagnostics is the operator's view of the same dependencies
plus the message backlog. It needs an admin bearer token, and the policy pack
admits the owner, admin and auditor roles of the token's own tenant (the
audit resource, view action); anyone else gets 401 or 403. It always reports
the caller's own tenant and ignores any tenant in the request; database and jetstream are deployment-wide readiness, and only the backlog is per-tenant. The body holds:
| Field | Meaning |
|---|---|
tenant_id | The tenant the counts belong to. |
database | configured, ready, detail of the enrollment store check (the /readyz identity entry). |
jetstream | configured, ready, detail of the message store check (the /readyz persistence entry). |
inbox_backlog.stored_messages, stored_bytes | What the tenant's message stream holds (sent and not yet aged out or wiped). |
inbox_backlog.readers | Durable readers of that stream: device edge sources and HTTP inboxes. |
inbox_backlog.undelivered | Messages readers have not yet received, summed over readers: a message two readers still owe counts twice. |
inbox_backlog.unacknowledged | Messages handed to a reader and not yet acknowledged, summed the same way. |
The backlog reads every page of the stream's consumer list (the server answers 256
consumers a page) under the same five-second deadline; if the broker does not
answer in time the route still returns 200, with inbox_backlog set to
{"configured": true, "ready": false, "detail": "probe_timeout"}. A server without
JetStream reports {"configured": false}. The body never carries a database URL,
a password, a credentials path, a server address or a token. The operator's status and
upgrade-preflight validate configuration; they do not probe a running server.
A healthy server also does not prove SMTP delivery, OIDC admission, or end-to-end
message delivery: test those with your intended users before rollout.
Try it first
Before deploying anything, run the evaluation. One command generates temporary credentials, builds and starts the server, drives it with real RookOne SDK clients, and tears the stack down:
uv run --frozen --extra dev python scripts/evaluate_compose.py \
--rookone-root /path/to/rookoneYou need Docker Compose v2, uv, and a checkout of the RookOne monorepo.
This is not a smoke test with mocks. It sends from one agent's local leaf while the recipient's leaf is stopped, restarts both the central NATS and the server, then starts the recipient, sources the retained event into their leaf, decrypts it through the real SDK, and durably acknowledges it. A separate tenant's account is checked to see nothing. A pass proves that scenario, not every feature or your deployment configuration.
Keeping credentials between runs
The evaluation throws its credentials away. To keep them:
uv run python scripts/bootstrap_evaluation.py \
--output-dir .rookone-server-evaluation \
--relay-url http://127.0.0.1:8080
ROOKONE_SERVER_UID="$(id -u)" ROOKONE_SERVER_GID="$(id -g)" \
docker compose up --build --waitTear down with docker compose down --volumes --remove-orphans.
Evaluation container defaults
The defaults are deliberately locked down, and worth knowing before you loosen any of them:
-
The generated credential directory is mode
0700; the roster, NATS configuration, and both client and server credentials are mode0600, and are excluded from Git and from the Docker build context. -
The image runs as a non-root user, with a read-only filesystem and no Linux capabilities.
-
Published endpoints are loopback-only. Central NATS publishes no host port at all.
-
The named volume is what preserves messages, acknowledgements, and public signing-key verification history across server and NATS restarts.
-
Per-caller limits (for example the administrator redeem attempts) key on the caller's address. Behind a reverse proxy the server sees only the proxy, so list the peers it may believe in
ROOKONE_SERVER_TRUSTED_PROXIES(comma-separated IPs or CIDR networks;*is rejected); those peers must overwriteX-Forwarded-Forwith the connecting address, as the bundled nginx does. The release Compose file trusts only its ingress's fixed address,172.30.80.2; other services on the internal network cannot forge a caller's address. If the default control subnet conflicts with a local network, setROOKONE_CONTROL_SUBNET(default172.30.80.0/24),ROOKONE_CONTROL_DYNAMIC_RANGE(default172.30.80.128/25), andROOKONE_INGRESS_IP. Choose an ingress address within the subnet but outside the dynamic range so another service cannot receive it first. Compose uses that same address for ingress and server trust. Outside Compose, an unset list trusts no peer, even loopback, and ignores forwarding headers. The server uses uvicorn to select the right-most untrusted X-Forwarded-For hop. X-Real-IP is ignored; proxies must supply X-Forwarded-For. An invalid resolved address falls back to the socket peer. Trust lists covering all IPv4 or all IPv6 addresses are rejected, including combinations of smaller CIDRs and native/mapped IPv4 ranges. This includes::ffff:0:0/96, two/97halves, and enclosing IPv6 ranges such as::fffe:0:0/95. Admin/device sign-in IP limits use fixed 60-second windows, grouping IPv6 callers by /64 while audits retain the individual address. -
HTTP ingress applies these additional safety limits before authentication or controller work. Set them in the server process/container environment:
Setting ( ROOKONE_SERVER_prefix)Default Valid range REQUESTS_PER_ADDRESS_PER_MINUTE3600 1–1,000,000 MAX_IN_FLIGHT32 1–10,000 MAX_IN_FLIGHT_PER_SOURCE8 1–10,000 MAX_BODY_BYTES1,048,576 1–16,777,216 BODY_TIMEOUT_SECONDS5 1–300 MAX_BODY_READERS8 1–10,000 MAX_BODY_READERS_PER_SOURCE2 1–10,000 Application slots are also bounded per bearer-token hash, falling back to the trusted client address for requests without a bearer. Distinct agents sharing an address receive separate application-slot budgets.
Invalid values fail startup. The address allowance is a fixed 60-second window shared across routes, including refused requests; it uses the trusted client address described above and groups IPv6 by /64. At most 4096 addresses are tracked; saturation refuses new addresses without evicting existing counters. Exhaustion returns 429 with
Retry-After. Body readers use a separate pool, capped at eight concurrent readers and two per source by default. Slow uploads do not reserve application slots, and one source cannot fill the default reader pool. Completed bodies enter application slots, held through response streaming. POST/api/v1/auth/session/refreshreserves its ownrenewalreader pool, with bodies limited to 64 KiB (or the configured body ceiling if smaller). Filling the ordinary pool cannot consume renewal readers. Direct attacks on renewal still consume its bounded pool; it retains source and application limits. Reader or application saturation returns 503 withRetry-After: 1. Slots are released on errors or cancellation. Application shedding emits structured logs at most once per second, including the cumulative refusal count. GET/healthzand/readyz, and the separately authenticated/metricshandler, remain available outside these limits. When metrics are configured, ingress refusals count in the existing HTTP response counters.Bodies are buffered before dispatch, with actual received bytes counted even when
Content-Lengthis absent or wrong. The deadline covers the entire body, so trickling bytes cannot extend it. Oversize bodies return 413 and slow bodies return 408. Smaller route-specific limits still apply. Streaming uploads are unsupported; streaming responses remain supported. Size memory capacity for concurrent buffered bodies as well as application work: defaults can retain up to 40.5 MiB (eight ordinary readers, eight 64 KiB renewal readers, and 32 application requests), before transient copies, downstream allocations and server buffers. These defaults have not been established by a small-deployment burst benchmark. The source allowance is shared by everyone behind a NAT; size it for the deployment's clients.Embedders can pass
body_policies={(method, path): BodyPolicy(bytes, pool)}toHttpIngress. Exact endpoint limits override the default; endpoints naming the same pool share reader capacity, isolated from other pools. Pass deployment wire responses asrejections={code: Rejection(status, body_bytes, retry_after)}to preserve error envelopes and timeout status without duplicating enforcement. Supported codes arerate_limit_exceeded,capacity_shed,body_capacity_exceeded,request_body_timeout,payload_too_large,invalid_content_length, andinvalid_request. Explicit pools add their own bounded reader memory; they do not multiply the application-slot allowance.Hosted adoption must isolate billing from identity uploads as well as ordinary traffic. Keep distinct names for those pools and preserve the built-in renewal policy (explicit policies override defaults):
body_policies = { ("POST", "/api/v1/billing/webhook"): BodyPolicy(1024 * 1024, "payments"), ("POST", "/api/v1/webhooks/logto"): BodyPolicy(256 * 1024, "identity"), }Pass this mapping to
HttpIngress(..., body_policies=body_policies), together with the deployment's health paths, limits and rejection responses. Sharing a pool between unrelated endpoints lets one exhaust the other's readers.These counters are per process, on both SQLite and PostgreSQL; restarting clears them and N workers/replicas can admit up to N times the allowance. They do not provide deployment-wide, per-agent, or duplicate-message limits. Configure shared ingress protection when a deployment needs a global ceiling.
-
ROOKONE_SERVER_AUTH_REQUESTS_PER_ADDRESS_PER_MINUTEdefaults to 1200 (valid range 1–1,000,000). It bounds requests per route and address, per process, including metadata, device sign-in, and admin bootstrap/recovery. Set the environment variable directly or in the Compose.env; Helm usesserver.authRequestsPerAddressPerMinute. For example, use 2400 for twice the default address allowance. Scale it to concurrent devices behind a shared NAT, not individual people: 50 devices polling at the advertised 5-second interval need50 × (60 / 5) = 600token requests/minute. Their initial discovery and grant creation add50 + 50 = 100requests across other routes, totaling 700. The 1200 per-route default gives polling 2× headroom. Raising it also raises the unauthenticated workload one address may submit. Per-grant pacing (5 seconds, with increasing backoff for early polls) and the 30-renewals/minute per-session throttle remain independent of this setting. The shared in-memory address budget holds at most 4096 route/address keys. Expired entries are removed first. At live capacity, a new key receives 429 withRetry-Afteruntil the soonest expiry and is not inserted; admitted callers retain their counters. A sufficiently distributed flood can block newcomers for a window and compete again at expiry, but rejected requests cannot extend existing windows. Counts are independent across server workers.
The release bundle below instead publishes TLS ingress on all host interfaces by default; keep its internal services private.
Nothing in the default configuration points at an Eigentic Cloud endpoint.
Monitoring
The server serves Prometheus metrics at GET /metrics, off by default. To turn it on,
write a random scrape token of at least 32 bytes to a file the server can read, and set
ROOKONE_SERVER_METRICS_TOKEN_FILE to its absolute path. Without the setting,
/metrics is not served at all.
For release Compose, write the token to $ROOKONE_SERVER_SECRETS_DIR/metrics-token,
with owner-only permissions (mode 0600), owned by the configured
ROOKONE_SERVER_UID. Set this line in your release environment file:
ROOKONE_SERVER_METRICS_TOKEN_FILE=/run/rookone/secrets/metrics-tokenThe existing read-only secrets-directory mount supplies the file and includes it in release backups; no Compose overlay is needed. Recreate the server service with the updated environment file to enable metrics.
For Helm, create a Secret in the release namespace containing the token and set
server.metrics.tokenSecret.name to its name. The key defaults to metrics-token;
set server.metrics.tokenSecret.key for a different key. The chart mounts only that
key read-only at /run/rookone/metrics/metrics-token and sets the environment
variable. Inline tokens in chart values are refused. An empty Secret name leaves
metrics off. See the chart README for the Secret creation command.
The server reads the token at startup: restart it after rotating the token. Your scraper also needs network access to the API port; configuring the token does not change ingress or NetworkPolicy rules.
A scrape must send Authorization: Bearer <token> (in Prometheus,
authorization.credentials_file); anything else answers 401. The token reads
telemetry only and grants nothing else. Families served:
rookone_server_http_responses_total (by route name and status class),
rookone_server_sends_total, rookone_server_enrollments_total,
rookone_server_auth_failures_total, rookone_server_delivery_latency_seconds and
rookone_server_person_sign_in_log_failures_total. Labels are route names, outcomes and status
classes, never a path, agent number or tenant. The server ships no alert rules; choose your
own.
When enrollment is configured, /metrics also reports
rookone_server_cut_audit_backlog, rookone_server_cut_audit_oldest_pending_seconds,
and rookone_server_cut_audit_parked. Backlog depth and age include parked records.
rookone_server_cut_audit_backlog_warning is 1 when depth reaches 100, the oldest
record reaches five minutes, or any record is parked. A store outage backs off the
delivery pass and preserves each record's retry budget. After five record-specific
failures, the server parks the record and logs its event ID as cut_audit_parked.
After correcting the underlying problem, requeue the parked record from the server host.
rookone-server admin audit-requeue --ledger-db /var/lib/rookone/ledger/enrollment.sqlite \
--deployment-id <deployment> --event-id <event-id>Use --ledger-dsn-file with the enrollment DSN file for PostgreSQL. Use --all in
place of --event-id to requeue every parked record for that deployment. Requeueing
resets the attempt count and makes the record eligible for delivery while preserving
its ID and payload.
Message retention
A device that is offline cannot post to a deployment group or space, even between agents on that device; device-local spaces work offline.
The server erases a message from its NATS server as soon as the recipient's machine confirms it has stored it. Anything never confirmed is discarded after a time limit, seven days by default, the same as the hosted service.
-
Wipe on delivery: the confirmation is the recipient's
deliveredacknowledgement, which the client sends only after the message is saved on its machine. The server then deletes the message with NATS's erase option. On a single NATS server withreplicas: 1, NATS overwrites the stored bytes; the server's tests check this on disk. Withreplicasabove 1, the stream's replication log can keep a copy until NATS next compacts it, and any backup or snapshot of the NATS store keeps what it captured. The index binding is also reclaimed; the delivery record stays until the time limit, so a repeated acknowledgement or a sender's retry is recognised instead of delivered twice. Areadreceipt does not erase anything. Set"wipe_on_delivery": falseon a tenant to keep delivered messages until the time limit instead. -
Which deliveries confirm today: an agent that collects its mail through the server's inbox API confirms each message once stored; that path applies to clients 0.4.10 and earlier, because clients from 0.4.11 receive only over the leaf. From client 0.4.9 an agent whose local leaf receives messages directly confirms them too, and the confirmation trusts the CA bundle that
rookone deployment fetch --ca-bundlestored, so a server behind a private CA needs no extra trust setup on the machine. Messages are erased within seconds of arriving. Client 0.4.8 verifies that confirmation against the machine's own trust store only; behind a private CA it fails certificate verification, and those messages are erased at the time limit instead, unless the machine trusts the CA system-wide (or setsSSL_CERT_FILEfor the client). -
What the time limit controls: how long an unconfirmed message stays in the server's message stream and its message index.
-
How to change it: set
max_age_secondson a tenant in the file thatROOKONE_SERVER_JETSTREAM_FILEnames. It is a whole number of seconds, at least1, and each tenant can have its own value. Leave it out to use the seven-day default. For example, one day:{ "tenant_id": "engineering", "max_age_seconds": 86400, "...": "the tenant's other fields" }The server applies the new value to its streams the next time it starts. Shortening the limit also removes stored messages older than the new limit.
-
Shorter or longer: a shorter limit keeps less data at rest on the server; a longer one gives a recipient who stays offline more time to collect their messages before they are gone.
-
Size cap: each stream also has a size limit,
max_bytes, 1 GiB by default and settable per tenant in the same file. When a stream reaches it, the message stream and index refuse new messages without evicting unread mail. Acknowledgement or expiry frees room for retries. A recipient also has a 1,000-message mailbox cap; refusals identify either recipient or tenant capacity. The acknowledgement stream discards its oldest records. The server keeps three streams per tenant (messages, acknowledgements and a message index), and each may grow tomax_bytes; the tenant's NATS account must allow that much JetStream storage.rookone-server nats initwrites the default (max_bytes: 1073741824, 1 GiB) and gives each tenant account room for four streams' worth of disk (4 GiB: the three streams plus one stream of headroom). -
Disk you need for it: NATS reserves every stream's
max_byteswhen the stream is created, and it will use only about 75% of the free disk under its store directory. One tenant at the 1 GiB default therefore reserves about 3 GiB, so the JetStream volume needs roughly 5 GiB free; every further tenant adds 3 GiB. If the reservation does not fit, the server never becomes ready:/readyzreportspersistenceas not ready with the detailstorage_reservation_failed(the endpoint needs no credential, so it names no tenant); the server log carries the full line, "JetStream cannot reserve N bytes per stream for tenant T (3 streams); lower max_bytes or give the JetStream volume more disk".rookone-server nats initchecks this before writing anything when you pass--jetstream-store-dir(the release operator does), and refuses unless you lower the cap or pass--allow-insufficient-storage. To shrink the cap, runrookone-server nats init --stream-max-bytes 268435456 ...(256 MiB; at most 1 TiB). If you raise a tenant'smax_bytesafterwards, runrookone-server nats reconcile-source-capacityso its account's disk budget follows (see Capacity limits). -
What it does not touch: each agent's own local archive on its machine. Messages an agent has already received stay in its local history whatever the server's limit is.
Capacity limits
Five settings bound how much one tenant can hold and how much one bootstrap run creates. You decide them when you run the server in your own environment; the defaults are today's values and have not been measured. Size your deployment with a representative workload before admitting users.
| Setting | Default | What it bounds |
|---|---|---|
ROOKONE_SERVER_NATS_TENANT_CONSUMER_LIMIT | 1,024 | JetStream consumers in one tenant's NATS account. Unmeasured. |
ROOKONE_SERVER_NATS_TENANT_NAMED_SOURCE_LIMIT | 400 | Named sources (agents an edge machine streams on behalf of) admitted per tenant, one consumer each. Cannot exceed the consumer limit. Unmeasured. |
ROOKONE_SERVER_NATS_SOURCE_MAX_ACK_PENDING | 1,024 | Unacknowledged messages one source consumer may hold, and the account's per-consumer ceiling. Unmeasured. |
ROOKONE_SERVER_SOURCE_PROVISIONING_TARGET_LIMIT | 64 | Sources per edge machine, and the roster size of one provisioning request. Unmeasured. |
ROOKONE_SERVER_NATS_BOOTSTRAP_MAX_TENANTS | 64 | Tenants one rookone-server nats init run creates. Unmeasured. |
Agents a person self-enrols draw on the tenant’s shared limit of 400 named sources.
Sign-in log
| Setting | Default | What it does |
|---|---|---|
ROOKONE_SERVER_PERSON_SIGN_IN_FAILURE_ROWS_PER_MINUTE | 20 | Failed person sign-in rows written per tenant, per caller address, per minute; the rest are counted in one summary row. Unmeasured, until a load test measures it. |
ROOKONE_SERVER_PERSON_SIGN_IN_LOG_REQUIRED | false | false: a sign-in whose admin audit row cannot be written still succeeds, and the server logs person_sign_in_log_failed and counts it in rookone_server_person_sign_in_log_failures_total. true: that sign-in is refused, and a server with no ROOKONE_SERVER_ADMIN_DATABASE_FILE refuses to start. |
Not a setting: every tenant account holds exactly 3 streams (messages, acknowledgements, the message-ID index). The server creates all three, so fewer cannot work and more would buy nothing.
The consumers kept for everything that is not a named source (the "reserve") are not a setting: they are the consumer limit minus the named-source limit, 624 by default. A value that is not a positive integer, or that contradicts another (more named sources than consumers), stops the server at start-up and names the key.
The consumer limit and ack-pending are written into each tenant's signed NATS
account, so changing one does not reach existing tenants by itself. After
changing them, run rookone-server nats reconcile-source-capacity (with the same
environment) to sign and publish the new account claims; --dry-run shows what
would change.
Generated NATS configs disable the per-leaf publish-permission result cache with
no_sublist_cache: true. A measurement with nats-server 2.14.7 and 10,000 synthetic
leaves in one account found 1,110 KB per leaf with the cache and about 90 KB without
it (2026-11-16; hardware unrecorded). Existing installs apply the setting with
rookone-server nats reconcile-source-capacity followed by a NATS restart;
NATS refuses a config reload that changes this setting. An explicit false is
left alone and reported as operator_disabled in server_config_warnings.
Reconciliation refuses duplicate cache settings without changing the file;
resolve them before rerunning it.
The server's NATS hub runs JetStream domain rookone, and every named-source
binding sources through $JS.rookone.API. Reconciliation refuses, without
changing the file, a jetstream block whose domain is anything else or is
missing. A server bootstrapped before this domain was fixed has a different
domain line: change it to domain: "rookone", restart NATS, and rerun
reconciliation.
The account's disk budget follows the stream size: it is (3 streams + 1) times
the tenant's max_bytes. nats init --stream-max-bytes sets it for a new
tenant, and reconcile-source-capacity re-derives it from each tenant's
max_bytes in the server's JetStream file (--jetstream-config, default the file
named by ROOKONE_SERVER_JETSTREAM_FILE), so raising a tenant's max_bytes and
running reconcile keeps the budget ahead of it. Without that file the disk
budget is left unchanged and the command says so.
Lowering the named-source limit below the number of sources a
tenant already has refuses new sources but does not remove existing ones. With
the bundled compose.release.yaml, set the variable in the environment you run
docker compose from and it is passed to the server. With the Helm chart, set
server.capacity.consumerLimit, namedSourceLimit, sourceMaxAckPending,
provisioningTargetLimit and bootstrapMaxTenants (empty keeps the default).
Next
- Deployment identity — how client machines come to trust your server. Do this before handing the URL to anyone.
- Federate your identity provider — optional. Administer the server with accounts from your own Okta, Entra or ADFS.
- Hosted vs self-hosted — what your users will and won't have.
Email sign-in and devices
Email sign-in requires all of the following on the server process:
- A persistent enrollment database and the usual deployment signing key.
ROOKONE_SERVER_PUBLIC_ORIGIN, the public HTTPS origin (no path).ROOKONE_SERVER_DEVICE_SESSION_KEY_FILE, an owner-only file containing at least 32 random bytes. Keep it stable across restarts and identical on replicas. Replacing it signs every browser out: the browser's CSRF token is derived from this key, so writes are refused at once and, when the 15-minute access cookie ends, renewal is refused too and the admin screen asks for a new sign-in. CLI devices keep renewing.ROOKONE_SERVER_JOIN_RULES_FILE, with at least one rule whoseissuersincludesemail, for example:
{
"schema_version": "rookone.relay.join-rules/v1",
"issuers": [],
"rules": [{
"id": "staff-email", "tenant_id": "engineering", "kind": "domain",
"value": "example.com", "issuers": ["email"]
}]
}Configure ROOKONE_SERVER_SMTP_HOST, ROOKONE_SERVER_SMTP_PORT,
ROOKONE_SERVER_SMTP_FROM and ROOKONE_SERVER_SMTP_TLS (starttls or implicit;
plaintext is refused). If SMTP requires credentials, set both
ROOKONE_SERVER_SMTP_USERNAME and ROOKONE_SERVER_SMTP_PASSWORD_FILE; the latter is
an owner-only file. Mount these files and pass the settings to the server's service
in your Compose override. Restart the server after changing join rules or settings.
GET /api/v1/auth/methods lists email only when SMTP and an email join rule are
configured. SMTP alone does not admit anyone. Code requests return the same 202
for admitted and unadmitted addresses; verification applies the join rules. Codes
expire in ten minutes and are single use. Requests are limited to 5 per email address
in a rolling 15-minute window, with ceilings of 300 per network address and 3,000
per deployment in a rolling hour. IPv6 addresses share their /64 network allowance.
A 429 response includes Retry-After in seconds and guidance to check the latest
code in your inbox or contact your server administrator. /admin offers email browser sign-in;
CLI device approval links to the same screen with its device code. The example rule creates
an ordinary member, not an administrator. See "First administrator" below.
Email sessions use the same device-session kernel as company login. They store no
OIDC refresh tokens, but the release configuration still loads secrets/at-rest.key;
keep the key generated by initialization. On renewal the server rechecks the email admission rule; removing
the rule ends the session and refuses its access token. Keep the admin database
configured to retain person sign-in rows.
The admin screen lists tenant devices, including ended sessions, and provides a Lost preview and action. Admins may mark devices Lost; auditors may only view; members cannot use these administrative routes. Lost ends the device, resets its agents, revokes its service keys, and signs out the person's other browser sessions except the one pressing the button. It preserves other CLI and host devices. If the response says messaging disconnect is incomplete, the HTTP cut-off has already committed. Retry the messaging cut with the returned session ID and its tenant; do not treat an incomplete disconnect as confirmed:
docker compose --env-file /srv/rookone-server/release.env -f compose.yaml \
exec -T relay rookone-server nats lost-finish \
--nats-bootstrap-manifest /run/rookone/operator/bootstrap-manifest.json \
--ledger-dsn-file /run/rookone/secrets/postgres-dsn \
--deployment-id acme-production --tenant-id engineering \
--session-id replace-with-lost-session-idA device starts sign-in with only its name, installation ID, and kind; it never chooses a tenant. Email and company login derive eligible tenants from the proved identity and current join rules. One matching tenant is selected automatically; several appear as choices in the approving browser. With none, the person is asked to contact the server administrator. A tenant choice is bound to that browser, expires with the sign-in grant, and can be used once.
Signed-in people can read their identity at /api/v1/auth/owner/me and their own
devices at /api/v1/auth/devices. The identity's org_id is the authenticated
tenant ID, consistent with agent identity on the server. Per-device /sign-out and
GET/POST /lost routes under /api/v1/auth/devices/{id} affect only the caller's
own devices in that tenant. Host-kind sessions see only themselves and can sign
themselves out; they cannot report Lost. Lost offers a preview and a choice to
keep other browsers signed in. It never crosses into another tenant.
Compose settings for person sign-in
The base release Compose file does not forward these person/SMTP settings merely
because they appear in release.env. After initialization, create the session
key once, without overwriting an existing key:
(umask 077; set -C; openssl rand 32 > /srv/rookone-server/state/secrets/device-session.key)Save your join-rules JSON as
/srv/rookone-server/state/secrets/join-rules.json, mode 0600, owned by the same
operator as the containers. For email authentication, put the SMTP password in
state/secrets/smtp-password with the same ownership and mode. Keep all these
files in backups; replacing the session key invalidates existing sessions.
Save this as /srv/rookone-server/person.compose.yaml, adjusting the origin and
SMTP values. Omit the SMTP settings for an OIDC-only installation; omit both
username/password settings if your SMTP server does not require authentication.
services:
relay:
environment:
ROOKONE_SERVER_PUBLIC_ORIGIN: https://server.acme.example
ROOKONE_SERVER_DEVICE_SESSION_KEY_FILE: /run/rookone/secrets/device-session.key
ROOKONE_SERVER_JOIN_RULES_FILE: /run/rookone/secrets/join-rules.json
ROOKONE_SERVER_AT_REST_KEY_FILE: /run/rookone/secrets/at-rest.key
ROOKONE_SERVER_SMTP_HOST: smtp.acme.example
ROOKONE_SERVER_SMTP_PORT: "587"
ROOKONE_SERVER_SMTP_FROM: rookone@acme.example
ROOKONE_SERVER_SMTP_TLS: starttls
ROOKONE_SERVER_SMTP_USERNAME: rookone
ROOKONE_SERVER_SMTP_PASSWORD_FILE: /run/rookone/secrets/smtp-password
networks: [control, relay-egress]
networks:
relay-egress: {}The existing secrets-directory mount exposes these files inside the container.
The base control network is internal; the relay-egress network permits
outbound SMTP and OIDC/keyset requests without publishing a server port. Do not
attach the server to edge instead: the ingress is on edge too, so it would
reach the server from an address the server does not trust to forward the
caller's address, and every client would read as the ingress. Apply
your organization's outbound firewall policy and CA trust for those endpoints.
The deployment CA bundle is for client-to-server trust, not automatic trust of
an SMTP server or identity provider with a private CA.
Use both Compose files for every subsequent lifecycle command, including backup and upgrade. For example:
python3 rookone-server-operator.py --env-file /srv/rookone-server/release.env \
--compose-file compose.yaml --compose-file /srv/rookone-server/person.compose.yaml up
curl --fail --cacert /srv/rookone-server/state/tls/ca.pem \
https://server.acme.example/api/v1/auth/methodsAfter editing mounted files, repeat the operator up command above; it recreates
the containers so they load the edited configuration.
Company OIDC sign-in
This is direct person sign-in, separate from the optional
operator-token broker. Register an authorization-code OIDC
application with PKCE S256 and the exact callback
https://server.acme.example/api/v1/auth/oidc/callback (include your port if needed).
Allow openid email profile and offline access/refresh tokens. Configure the
provider to include a verified email for domain rules, or the group claim used
by a group rule. Provider assignment alone does not admit a person to the server.
Device-code sign-in now requires an explicit Approve after company or email
sign-in and organisation selection. Check the code, device name and kind, signed-in
account and selected organisation on the confirmation page. Until approval, the
waiting device stays pending and receives no session. Deny refuses that sign-in;
start a new request on the device to try again. Direct browser login at /admin
continues to create the browser's own session without a separate device approval.
Behind a reverse proxy or load balancer, set
ROOKONE_SERVER_TRUSTED_PROXIES to a comma-separated list of the proxy IP
addresses or CIDR networks (for example 10.20.0.0/24,192.0.2.10). Trust only
proxies you control and configure them to replace incoming forwarding headers.
Without this setting, all users behind the proxy share its source address and
its 64-outstanding-sign-in allowance; one client can temporarily block sign-ins
for everyone behind that proxy. A public, non-loopback ROOKONE_SERVER_PUBLIC_ORIGIN
with no trusted proxies logs one startup warning but still starts. A server
reached directly can leave the setting empty.
Use the same public origin, session key, at-rest key and Compose override above. Obtain the following URLs and client ID from your provider; the server does not discover them from an issuer URL. An example join-rules file is:
{
"schema_version": "rookone.relay.join-rules/v1",
"issuers": [{
"id": "company", "name": "Company sign-in",
"issuer": "https://identity.acme.example",
"client_id": "replace-with-your-client-id",
"keyset_url": "https://identity.acme.example/keys",
"authorization_endpoint": "https://identity.acme.example/authorize",
"token_endpoint": "https://identity.acme.example/token",
"client_secret_file": "/run/rookone/secrets/oidc-client-secret"
}],
"rules": [{
"id": "company-members", "tenant_id": "engineering", "kind": "domain",
"value": "acme.example", "issuers": ["company"], "role": "member"
}]
}For a confidential client, write its secret to state/secrets/oidc-client-secret
(owner-owned, mode 0600). For a public PKCE client, omit client_secret_file.
To offer email too, keep the SMTP settings and add email to the rule's
issuers. Restart the server and check /api/v1/auth/methods, then sign in at
/admin or follow the CLI's device-approval URL. Several eligible tenants produce
a browser choice; no matching rule means no admission.
With client 0.4.27, an admitted person runs
rookone register --deployment <server> --name atlas without --enrollment-grant.
The client requests their own single-use enrollment code through
POST /api/v1/enrollment/self-grant and enrolls with it.
To require operator-issued codes instead, add "self_enrollment": false (a JSON boolean) beside
rules in the join rules file; the default is allowed. A refused person is told to ask the
administrator: "Ask your server administrator for an enrollment code."
Every self-issued code is audited with the person as actor. A person may have up to three
unused codes; use one or wait for its 15-minute expiry before requesting another.
A self-issued code is bound to the device sign-in that requested it: only that device,
signed in as the same person, can enroll with it. Anyone else is refused with
self_grant_device_mismatch. Reporting that device Lost revokes its unused codes.
Operator-issued codes are not bound to a device.
A host device may request codes and enroll its own agents. Signing the host out keeps
those agents running; reporting the device Lost cuts them, as do revoking the agent and the
person leaving.
Member commands and feature discovery
After trusting this deployment, a member signs in as a person and registers an agent:
rookone login --deployment <server>
rookone register --deployment <server> --name atlasThese commands and options are listed in the CLI reference.
Self-registration uses the admission rules and self_enrollment setting above;
when disabled, ask the operator for a code and pass --enrollment-grant <code>.
To remove that agent, run rookone deregister atlas --yes. The client calls
DELETE /api/v1/agents/me with the agent's credential before removing its local
identity. The server revokes the agent through the same path as an operator
revocation and retains an audit event naming the agent as actor. This does not
sign the person out or remove their other agents.
Members can manage their own mute preference using an agent's public number:
rookone abuse mute <number> --as atlas
rookone abuse muted --as atlas
rookone abuse unmute <number> --as atlasThe server persists mutes through POST/DELETE /api/v1/agents/by-number/{number}/mute; GET /api/v1/agents/me/muted lists them.
Mute is a notification preference applied by clients: messages are still delivered.
It is independent of blocking; abuse reporting is not available on the server.
Operators can inspect GET /capabilities/v1 without signing in. Its feature IDs
reflect the installed controllers: block/v1, mute/v1, agent-by-number/v1,
device-code-sign-in/v1, self-enrollment/v1 and agent-self-removal/v1 appear
only when their corresponding features are available. Disabling self-enrollment
removes self-enrollment/v1. Clients use this advertisement to explain unsupported
operations before attempting them; it does not grant permission to an agent.
ROOKONE_SERVER_PUBLIC_ORIGIN must have the same scheme, host and port as the API endpoint in
the deployment identity (the path of the API URL is ignored). The server refuses to start
otherwise, naming both values.
Keep at-rest.key stable: it protects stored provider refresh tokens. During
OIDC session renewal, all devices of a person share the latest provider refresh
token for that issuer and subject. Signing in on another device replaces that
provider token without ending existing device sessions. The server still issues
its own independent refresh token to each device. Provider checks and any rotated
provider token are shared across devices, with a cached success between checks
(default interval 15 minutes), but current admission rules are evaluated on
every renewal, including cached checks and successful refreshes without an
id_token. The server saves verified sign-in claims and replaces them when a
refresh supplies a newly verified ID token. Restart the server to load edited
rules; startup rechecks saved claims for people with live agents and cuts those who
no longer match, even if every device is signed out. A person whose saved claims
are missing or unreadable is skipped at startup (logged) and checked at their next renewal. This also runs when the final rule is removed. A person whose issuer is no longer
configured (removed, or a typo in its URL) is skipped with a logged warning instead of
cut, so remove people by removing their join rule, not the issuer.
A verified sign-in refusal applies the same cut. A confirmed
provider refusal ends the sign-in and asks the client to sign in again. Refused
and unverified provider checks appear in the Sign-ins audit; provider outages
also log the transport failure type or HTTP status without tokens or response bodies.
Saved claims are the last verified claims, not a live directory lookup. Group membership changes at the provider need fresh claims or a provider denial to be observed. A provider outage may allow renewal for up to the configured grace window (default 60 minutes), but does not bypass admission rules. This is not instantaneous revocation. Deleting or disabling someone only at the IdP is not detected if they have no renewing device and do not sign in again; their agents can keep working for up to 30 days idle or 90 days after their last sign-in, the agent lifetime that also applies after a plain sign-out. To cut them without waiting for a device, remove their admission from the server's join rules and restart, or explicitly revoke their agents.
An ambiguous provider response saying a refresh token was "already claimed" can mean another sign-in exchanged its code before saving the new token. It ends at most the renewing device and asks it to sign in again; it never refuses the person or cuts their agents.
A leaver cut ends HTTP credentials and advances the agents' credential generation
in one transaction. The messaging reset follows. If it fails, the Sign-ins audit
says transport=not_complete and names rookone-server nats lost-finish. Restore
messaging, then retry with the session from that audit row:
rookone-server nats lost-finish \
--session-id SESSION --tenant-id TENANT --deployment-id DEPLOYMENT \
--ledger-dsn-file /path/to/ledger-dsn \
--nats-bootstrap-manifest /path/to/bootstrap-manifest --nats-url NATS_URLUse --ledger-db /path/to/ledger.sqlite for SQLite. Repeat until the output is
{"lost_complete": true}. This works for a signed-out leaver's session too and
covers the person's already-cut agents on every device. It does not advance their
credential generation again or reset an agent recovered since the cut.
The database upgrade keeps the credential from the newest device sign-in for each issuer and subject, including its encryption context and saved claims. Removing that device later does not remove the shared provider credential.
Existing sessions created before saved admission claims were supported must get verified claims on refresh or sign in again. Renewal fails closed without those claims or a usable at-rest key, even if the provider returns an access token. An email-only deployment does not need provider claims.
First administrator
Browser administration requires an explicit grant to a named person. Join rules
accept only member and auditor; setting role: admin is rejected. The first
email or OIDC user does not become admin automatically.
For a fresh tenant, first obtain an API operator credential. From the extracted bundle, with the server running:
docker compose --env-file /srv/rookone-server/release.env -f compose.yaml \
exec -T relay rookone-server admin bootstrap \
--ledger-db /var/lib/rookone/admin/admin.sqlite \
--deployment-id acme-production --tenant engineering --subject first-adminThis is initial setup only: one unexpired bootstrap key may be open at a time,
and no new bootstrap can be issued once the first administrator exists. Use
admin recovery-bootstrap if administrator access is lost. Keep the returned
bootstrap_token private. Redeem it once before its expiry
(default one hour); the deployment, tenant and subject must match exactly:
Create /srv/rookone-server/bootstrap-request.json mode 0600 with this body,
substituting the token:
{
"schema_version": "rookone.relay.admin-bootstrap/v1",
"bootstrap_token": "replace-with-returned-token",
"deployment_id": "acme-production",
"tenant_id": "engineering",
"subject": "first-admin"
}curl --fail --cacert /srv/rookone-server/state/tls/ca.pem \
-X POST https://server.acme.example/api/v1/admin/bootstrap/redeem \
-H 'Content-Type: application/json' \
--data-binary @/srv/rookone-server/bootstrap-request.jsonThe response contains admin_api_key and expires_at. Store it securely and use
Authorization: Bearer <admin_api_key> on admin API requests, including the
enrollment-grant request.
Use engineering as the tenant for this example. This API credential does not
create browser cookies or a person session. Bootstrap is not a repeatable login;
existing administrators can issue operator credentials, or use the external
authority flow in the broker guide. Retain recovery credentials separately.
Have the intended administrator sign in at /admin once. With the API credential,
read GET /api/v1/admin/screen/people and identify that person's person_id in
engineering. Grant that person admin using the existing operator-role operation:
curl --fail --cacert /srv/rookone-server/state/tls/ca.pem \
-X POST https://server.acme.example/api/v1/admin/operators/roles \
-H 'Authorization: Bearer <admin_api_key>' \
-H 'Content-Type: application/json' \
--data '{"schema_version":"rookone.relay.admin-operator-roles/v1","deployment_id":"acme-production","tenant_id":"engineering","subject":"<person_id>","roles":["admin"]}'Use the existing person's ID, not their email address or an invented subject.
Unknown people and people outside the caller's tenant are refused. This operation
uses the existing operator roles and records operator_roles_updated in the audit
log with the caller, target person and assigned roles. The person's browser admin
requests read the grant each time; reloading /admin shows the new authority.
To revoke it, repeat the same request with "roles":["member"]. Already-issued
browser sessions immediately lose admin authority on their next request. The
person must still satisfy sign-in admission; a grant does not bypass join rules.
Recovering administrator access
Use admin recovery-bootstrap only when no active administrator credential remains
in the tenant; otherwise it refuses with active_admin_exists. An administrator
with an active credential can issue a replacement operator credential instead.
Choose a fresh recovery secret: 16–512 characters, at least six distinct characters,
and at least two of lowercase, uppercase, digits and punctuation. The command does
not generate this secret. Save it in a mode-0600 file in the host directory named
by ROOKONE_SERVER_SECRETS_DIR in release.env (normally
/srv/rookone-server/state/secrets), with the same ownership as the other secret
files. The release Compose bundle mounts that directory read-only at
/run/rookone/secrets inside the server container. Name the file
admin-recovery-secret for this example; use only a throwaway secret in a rehearsal,
never an existing credential or one copied from an example.
From the extracted release bundle:
docker compose --env-file /srv/rookone-server/release.env -f compose.yaml \
exec -T relay rookone-server admin recovery-bootstrap \
--ledger-db /var/lib/rookone/admin/admin.sqlite \
--deployment-id acme-production --tenant engineering --subject recovery-admin \
--recovery-secret-file /run/rookone/secrets/admin-recovery-secretKeep the returned recovery_token private. It expires after 15 minutes by default;
--ttl-seconds can change this up to one hour. Before it expires, create a
mode-0600 file /srv/rookone-server/recovery-request.json containing the following
body. Replace both placeholders locally: recovery_secret must be the same secret
as the file above. The deployment, tenant and subject must match the command.
{
"schema_version": "rookone.relay.admin-recovery/v1",
"recovery_token": "replace-with-returned-recovery-token",
"recovery_secret": "replace-with-the-secret-from-your-file",
"deployment_id": "acme-production",
"tenant_id": "engineering",
"subject": "recovery-admin"
}curl --fail --cacert /srv/rookone-server/state/tls/ca.pem \
-X POST https://server.acme.example/api/v1/admin/recovery/redeem \
-H 'Content-Type: application/json' \
--data-binary @/srv/rookone-server/recovery-request.jsonStore the returned admin_api_key securely. The token is single-use. After successful
redemption, delete both temporary files on the host: admin-recovery-secret from
the secrets directory and recovery-request.json.
Backup, restore and upgrade
Schedule an outage and keep clients disconnected until validation completes. The backup helper stops all configured services before reading persistent state, including the optional identity broker, and restarts them afterward. Pass every Compose override used at startup to every operator command. No external process may write these databases or state directories during the snapshot.
python3 rookone-server-operator.py --env-file /srv/rookone-server/release.env \
backup --output-dir /srv/rookone-server/backups/pre-upgrade
python3 rookone-server-operator.py --env-file /srv/rookone-server/release.env downThe helper attempts restart even after a backup failure. Keep external access
blocked through that restart and the following down.
The backup destination must be new. Version 2 backups contain recovery.tar
and manifest.json hashes plus the PostgreSQL container's Docker image ID and
image architecture. Restore resolves the PostgreSQL image from the merged Compose
configuration, including runtime image overrides, and inspects its local image ID
and architecture. Changing an override or moving a tag to a different image is
therefore checked against the image that wrote the snapshot.
Restore refuses missing or mismatched compatibility metadata before deleting any
destination state. Older physical snapshots that recorded only the advertised
image digest must be recreated with this helper. The stopped snapshot includes the entire PostgreSQL
data directory (server and broker databases, roles and credentials), keys,
configuration, admin SQLite and NATS state. Any SQLite ledger must reside in one
of the archived directories (runtime, operator, identity, secrets, admin,
tls, nats, media, postgres); arbitrary external mounts are not covered.
Restore accepts a backup taken before attachments existed and starts with an
empty media directory.
Copy the archive off-host securely with the exact bundle, release.env and all
Compose overrides. Restore physical PostgreSQL state using the same image and
architecture, before applying forward migrations. These files contain
credentials. A valid hash manifest does not prove a successful restore; rehearse
recovery on an isolated replacement host.
For an ordinary upgrade from the current release layout:
- Preserve the old bundle and environment; take the quiesced backup above.
- Extract and verify the new bundle in a separate directory. Run its
load-imagesand replace all five components' image/runtime-image lines in a copy ofrelease.env, as in installation. The loader reuses local tags, so reloading the old bundle is necessary if you roll back. - Keep state paths, identity and keys. Do not run
initializeagain. Compare the new environment template for required settings. From the new bundle, runupgrade-preflight, thenup, with the chosen environment and overrides. - Check
/version,/readyz, person sign-in and a direct-message exchange before reopening access. Preflight alone is not an upgrade test.
Upgrades from older credential/source layouts can require a migration-specific procedure; read that release's instructions before applying this ordinary flow. For agents predating the 0.4 client, also read move to 0.4.
To roll back, stop the stack, reload the old bundle's images, restore its exact environment/overrides and use its operator from its extracted directory:
python3 rookone-server-operator.py --env-file /srv/rookone-server/release.env \
restore --backup-dir /srv/rookone-server/backups/pre-upgrade
python3 rookone-server-operator.py --env-file /srv/rookone-server/release.env upgrade-preflight
python3 rookone-server-operator.py --env-file /srv/rookone-server/release.env upRestore requires no running services on entry and replaces state with the backup.
On a replacement host, load the matching bundle's images and copy its environment
and Compose overrides; adjust all state paths together and use the original
operator UID/GID. restore accepts an absent state directory and creates it from
the archive. Do not run initialization first. Version 2 restore leaves services
stopped; upgrade-preflight and up validate and start them. Legacy version 1
archives containing postgres.sql still restore the server database, but never
contained the broker database. Changes after the backup are lost. Never attempt
a database downgrade by swapping only the server image.
Run one server at a time against a deployment's message streams, and never an old
and a new release together. Releases from this one on store a group or space
message as one copy per member under the same message id; an older server that
meets such a copy treats it as a conflict and stops delivering for that tenant.
Compose's up stops the old server before starting the new one, and the Helm
chart uses the Recreate strategy for the same reason. Once group or space
messages have been sent, roll back only by restoring the pre-upgrade backup as
above: starting older images on the newer message state stops delivery until
those messages expire, and they are then lost.
Space joins and invite acceptance allow up to 400 live members by default.
Set ROOKONE_SERVER_MAX_SPACE_MEMBERS to 1–400 to lower this limit. Values outside
this range fail configuration validation. A refused admission returns
409 space_full without consuming the invite. This setting does not change the group-message audience limit.