chadtmiller.com/group-host
atmosphere group host
Main deploys itself to next.opensocial.fyi once its checks pass
MergedThis adds deploy.yml, which builds a candidate image on the grain box while the checks run and brings it up once they pass. It also pins every other workflow to runner.knotless.dev, and adds docs and an AGENTS.md note. The structure is sound. The heredocs, the superseded and moved handling, and dropping the candidate on failure all read correctly.
Must change: the final step doesn't verify the deploy. The pull body and docs/deploying.md both say "the host must then name the commit in /xrpc/_health", but the step only runs curl -fsS. That passes on any 200 response, including the old host still answering. So a deploy that failed to switch the host over would show as green, which defeats the point of the check. Compare the response with $KNOTLESS_RUN_SHA, and retry for a short while, since the host is restarting. Then fail, and say that the box is on the new image but unhealthy, so someone can roll back to before-<commit>. Alternatively, change the docs so they don't claim it. I'd rather the workflow do it.
Worth a look, not blocking:
StrictHostKeyChecking accept-newin a fresh container trusts whatever host answers on each run. A man-in-the-middle can't take the key this way, but it could receive the source archive and report success. Pin the box's host key in aknown_hostsfile, in the repository or in an env var.- The deploy has never run.
moveddepends on the output format ofknotless refs(tab-separated, ref in column 2). If that format is different,movedexits 2 and every deploy fails safely at "cannot tell". Run it once by hand before relying on it.
.knotless/workflows/deploy.ymlline 95Outdated
2) echo "cannot tell where $KNOTLESS_RUN_REF is: not deploying"; box drop; exit 1 ;; | |
esac | |
box up | |
curl -fsS "$GROUP_HOST_URL/xrpc/_health" |
This only fetches /xrpc/_health. It never checks that the response names $KNOTLESS_RUN_SHA, so the old host answering would pass. Compare the response with the commit (retrying briefly) and fail otherwise.
.knotless/workflows/deploy.ymlline 47Outdated
curl -fsSL https://knotless.dev/install.sh | KNOTLESS_INSTALL_DIR=/usr/local/bin sh | |
mkdir -p ~/.ssh && chmod 700 ~/.ssh | |
printf '%s\n' "$GROUP_HOST_DEPLOY_KEY" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519 | |
printf 'Host *\n StrictHostKeyChecking accept-new\n ServerAliveInterval 30\n' > ~/.ssh/config |
accept-new trusts the box's host key on first sight in every fresh container. Pin the key in known_hosts instead.
Host-key pinning is done: known_hosts is now pinned with StrictHostKeyChecking yes. The knotless refs format check is still unverified, but it fails safe, as I said before.
The one blocking item from round 1 is still open. The last step of deploy.yml is still curl -fsS "$GROUP_HOST_URL/xrpc/_health". That passes on any 200, including the old host still answering after a failed switch. The pull body and docs/deploying.md both say the host must name the commit. Compare the response with $KNOTLESS_RUN_SHA and retry for a short while, since the host is restarting. If it never matches, fail and say that the box is on the new image but unhealthy, so someone can roll back to before-<commit>. Or drop the claim from the docs and the body.
.knotless/workflows/deploy.ymlline 98Outdated
2) echo "cannot tell where $KNOTLESS_RUN_REF is: not deploying"; box drop; exit 1 ;; | |
esac | |
box up | |
curl -fsS "$GROUP_HOST_URL/xrpc/_health" |
Only checks for HTTP 200. Poll for ~60s until the body contains $KNOTLESS_RUN_SHA; otherwise fail and mention group-host:before-<commit> for rollback.
The blocking item from rounds 1 and 2 is fixed. The last step of deploy.yml now polls /xrpc/_health for up to about a minute and passes only when the response contains "$KNOTLESS_RUN_SHA". If it never does, it prints the last answer and the rollback hint, then fails. That matches what the pull body and docs/deploying.md claim. Host-key pinning from round 2 is still in place.
The one remaining risk is the one I raised before and it fails safe. The knotless refs output format that moved parses is unverified, since the deploy has never run. If the format differs, the deploy exits at "cannot tell" and drops its candidate. Check it by hand once the runner is set up, following the order in the pull's shortcomings.
What changes
A deploy workflow.
.knotless/workflows/deploy.ymldeploys each push tomainto next.opensocial.fyi. While the commit's checks run, it sends agit archiveof it to the grain box over SSH, where it is built as a candidate,group-host:build-<commit>, changing nothing that runs. Oncecheck,test,web,lexicons,e2eanddocsall pass for the commit, the candidate goes up asgroup-host:current, with the image it replaces kept asgroup-host:before-<commit>, and the host must then name the commit in/xrpc/_health. A failed check drops the candidate. As knotless's deploy does, a newer commit's deploy waits for this one (superseded: finish), and a deploy whose commit is no longer main's tip, before building or going up, drops its candidate and passes.Runners. The deploy runs only on
ci.knotless.dev, the runner beside knotless.dev that runs its owner's repositories alone. Every other workflow now namesrunner.knotless.dev, so addingci.knotless.devto the repository doesn't run them twice, or run them on knotless.dev's own host.Docs.
docs/deploying.mdsays how the deploy works, and AGENTS.md lists it besidemirror.Why
So a merge to main is deployed without anyone running hetzner-infra's
build-group-host.shandpush-group-host.shby hand.The key reaches the grain box, which also runs production grain.social, so it isn't root SSH. The box accepts the key only for a forced command,
group-host-deploy, which can build, bring up or drop a group-host image and nothing else, so a leaked key can't give anyone a shell there. The command and its installer are in hetzner-infra: at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/hetzner-infra/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3mzlsxrjzuh7e. knotless.dev's runner watching this repository is knotless's: at://did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3mzlsxqd5zt33.How it was checked
just docspasses.Shortcomings
Before merging, in this order:
GROUP_HOST_DEPLOY_KEYandKNOTLESS_PASSWORD(an app password of chadtmiller.com) toci.knotless.devforrefs/heads/main, thenknotless runner add knotless://chadtmiller.com/group-host ci.knotless.dev.Merged before that, the first push's deploy fails at the SSH step or never runs; nothing on the box changes.
🤖 Generated with Claude Code