chadtmiller.com/group-host
atmosphere group host
The host and its console build as one image, run by a compose file
MergedThis adds a Dockerfile, a deploy cargo profile, a two-service compose file, a commit field in _health and the serving log line, and docs/deploying.md. I found one small bug and nothing that blocks the merge.
An unset build arg is not null. ARG GROUP_HOST_COMMIT followed by ENV GROUP_HOST_COMMIT=${GROUP_HOST_COMMIT} sets the variable to an empty string when no --build-arg is given. option_env! then returns Some(""), so _health shows "commit": "" and not null. The docs and the Rust doc comment both say null. Either treat an empty value as none in COMMIT, or have the Dockerfile avoid exporting an empty value. The test would pass either way, because it compares against the same option_env!.
I couldn't build the image here, so I read the Dockerfile, compose file and docs for coherence only. I found no other problem in them.
Dockerfileline 18Outdated
# rest. GROUP_HOST_COMMIT is the commit the host names in its health and | |
# as it starts: only group-host reads it, so it rebuilds nothing else. | |
ARG GROUP_HOST_COMMIT | |
ENV GROUP_HOST_COMMIT=${GROUP_HOST_COMMIT} |
With no build arg this exports GROUP_HOST_COMMIT="", so option_env! is Some("") and _health reports "", not the documented null. Map empty to None in COMMIT, or only set the variable when the arg is non-empty.
This is the same head commit as my last review, so the title or body changed and the code did not. The empty-commit bug I raised is still there. ARG GROUP_HOST_COMMIT followed by ENV GROUP_HOST_COMMIT=${GROUP_HOST_COMMIT} exports an empty string when no --build-arg is given. option_env! then returns Some(""), so _health shows "commit": "" and not null. The docs, the doc comment and the API reference all promise null. The test can't catch this because it compares against the same option_env!.
The fix is small. Either filter empty values when you read it (match option_env!(..) { Some("") => None, c => c }), or set the env only when the arg is non-empty. It is a cosmetic mismatch with the docs, so I'm not blocking the merge on it. The rest, which I read in full, reads as coherent: the Dockerfile, the deploy profile, the compose file, the docs and the test.
Dockerfileline 18
# rest. GROUP_HOST_COMMIT is the commit the host names in its health and | |
# as it starts: only group-host reads it, so it rebuilds nothing else. | |
ARG GROUP_HOST_COMMIT | |
ENV GROUP_HOST_COMMIT=${GROUP_HOST_COMMIT} |
With no --build-arg, this sets GROUP_HOST_COMMIT to an empty string. option_env! then gives Some("") and _health reports "commit": "", not null as the docs say. Treat an empty value as none in COMMIT, or don't export it when it's empty.
Carried forward: the change this pull makes at bf9486f80443bb65e7a82fec5d56844ef6265647 is the one reviewed at adab605eb0879266841ecf163d16d2666219be86, so that review stands. What is new comes from its base.
What changes
One image. A
Dockerfilebuildsgroup-host:current: the host and theopensocialcommand in a newdeployprofile (release's, without LTO and in 16 codegen units, with cache mounts for the registry andtarget/), and the built console beside them, onnode:24.22.1-bookworm-slimundertini, as uid 1000, withDATA_DIR=/data.A compose file.
deploy/docker-compose.ymlruns it twice:hoston 2600 andconsoleon 2601, each with a healthcheck, a stop grace period, limits and journald logs, on an external network a TLS proxy shares. A.envsets the domain and handle domain (both required: the host's.testdefault never reaches a deployed host) and passes the rest through.The host names its build.
GROUP_HOST_COMMIT, set as the image is built, is in/xrpc/_health(commit,nullfrom a checkout) and in theservingline it logs at start, with its version.A page.
docs/deploying.md: the image, compose and its.env, how a proxy must split the host's paths from the console's (the console'sfetchcarries no websocket, sosubscribeReposmust reach the host directly), the wildcard DNS and TLS group handles need, upgrading by stopping the host before starting the new one, backups with the keys kept apart, and runningopensocialandmove-hostfrom the image.Why
The first of the deploy pieces in the Open questions issue's Deploying section, at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjilmwvs2bn, laid out as knotless's
Dockerfileanddeploy/docker-compose.ymlare. Unlike knotless's index, this host's database is the groups' own and its writes take turns within one process, so the compose file never lets two hosts share a data directory: only the console could be rolled with no gap.How it was checked
answers_health_and_refuses_unknown_methodschecks_health'scommitagainst the build's..envand a local network: both healthy within seconds,_healthnaming the commit straight and through the console, theservingline with it, the data directory filled, anddocker compose stop hostexiting 0 in under half a second with the host'sstoppedline.just docs: 18 pages, every link landing.Shortcomings
🤖 Generated with Claude Code