rig home · Documentation · Ecosystem
rig-hq and rig-relay¶
This page describes rig-hq v0.2.0. rig itself does not need either program; see the ecosystem overview.
What they are¶
rig-hq is the server side of rig. It ingests batches of rig events, stores them
in Postgres, authenticates every /v1/ request and serves read endpoints for
tasks, the org feed, a summary and the org model, plus a live server-sent event
stream that works across several rig-hq nodes sharing one Postgres. The API
makes no human writes: the only writer is rig, through the relay.
rig-relay is the per-developer forwarder. It runs one rig events scan at a
time, posts the batches to rig-hq, and moves its cursor forward only after the
server has acknowledged every batch.
When you want them¶
Use them when a team needs one place to see what each developer and their agents are working on, whether beside an issue tracker or instead of one. If you work alone, or only want rig's local task state, you do not need them.
Install¶
From the release binaries: each release at
rig-hq releases carries
rig-hq-<os>-<arch> and rig-relay-<os>-<arch> for linux and darwin
(amd64 and arm64) and windows (amd64), plus a SHA256SUMS file. Check them
with sha256sum -c SHA256SUMS.
From the container image, for linux/amd64 and linux/arm64:
docker pull ghcr.io/aindriub/rig-hq:0.2.0
The tags :0.2 and :latest also exist.
rig-hq needs a Postgres database. Set RIGHQ_DATABASE_URL, then:
rig-hq migrate
rig-hq serve
By default rig-hq listens on :8080 and checks personal access tokens stored
in Postgres. Create one with
rig-hq admin token create --subject S --scope rig.read. It is shown once.
The token you give rig-relay must instead carry --scope rig.events:write,
because the relay posts events. Run it behind TLS.
Point rig-relay at rig-hq¶
Store a credential for your server, giving the token on standard input, then run the relay for a clone:
rig-relay login --server https://hq.example.com --token
rig-relay run --repo /path/to/clone --server https://hq.example.com
Add --once for a single pass. On Linux, rig-relay install --repo DIR keeps
the relay running as a systemd user unit. The token lives in rig's secret
store or the OS keychain, never in a repository file, and the server URL is
not read from a file tracked in the repository.