feat(dev-new): cut lab over to the central OneCLI, retire the sidecar #352
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!352
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/338"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR 2 of 2 for the OneCLI centralisation (follows #337 / ADR-0026, which named this "the follow-up PR's concern").
lab on
dev-newnow consumes the central OneCLI onweb-arminstead of its own local sidecar, and the sidecar plus every trace of its dashboard path is deleted.Repointed (
hosts/dev-new/modules/coding-lab/default.nix)urlgoes through web-arm'sonecli.cloonar.comnginx vhost; the gateway is a CONNECT forward proxy that cannot be reverse-proxied, so runs dial10.42.98.10:10255(web-arm'swg_cloonaraddress) directly.apiKeyFileis thecoding-lab-onecli-api-keysops secret already present on dev-new (commitfc57bd7), declared withowner = config.services.lab.user; mode = "0400"— lab refuses any key file with group/other bits set. The local-mode auto-key-fetch oneshot is gone; it only ever worked because local mode minted keys unauthenticated.caFileis the gateway's interception CA, fetched once fromhttps://onecli.cloonar.com/v1/gateway/caand committed as a plain PEM (CN=OneCLI Local Gateway CA, valid to 2036-08-11). Referenced as a store path, so it is deterministic with no boot-time fetch. A note beside it records that a OneCLI reinstall mints a new CA and this file must then be refetched.dashboard = "off"anddashboardAddrdropped entirely — the central dashboard has its own vhost, and lab refuses to start ifdashboardAddris set outside port mode.Demolished
hosts/dev-new/modules/coding-lab/onecli.nixdeleted: both podman containers, theinit-onecli-networkunit, thecoding-lab-onecli-keyfetch oneshot, and dev-new's:8081firewall opening. It was dev-new's only consumer ofvirtualisation.oci-containers.onecli-dashboardvhost removed fromhosts/fw/vms/web/lab.nix.hosts/fw/modules/firewall.nix.allowedTCPPorts, restoring the[ 22 80 443 ]that commit073f15fhad extended for exactly this vhost.hosts/fw/vms/web/matrix.nix, which explainedmasPort = 8083by pointing at the now-deleted vhost.Incidentally this also clears a latent bind conflict: the deleted vhost bound
0.0.0.0:8081while piped publishes127.0.0.1:8081on the same VM.Accepted consequences
wg_cloonartunnel is down. The tunnel — and web-arm's availability — is now production-critical for lab. This is ADR-0026's stated consequence, fail-closed by design; the alternative is a public credential gateway.Operator follow-ups
onecli-pgdataandonecli-appdataare left behind and can be pruned — dev-new is cattle, nothing to preserve.coding-lab-onecli-api-keysits inhosts/web-arm/secrets.sops.yamland can be removed. No sops file was touched by this PR.Verification
scripts/test-configuration dev-newandscripts/test-configuration fwboth evaluate green (run by the pre-commit hook on this commit).47f57bbd4011:dashboardisenum [ "off" "port" "subdomain" ];apiKeyFileis refused unless0600-or-stricter;caFileis read at spawn and concatenated after the system roots into a per-run0644bundle exported asSSL_CERT_FILE/NODE_EXTRA_CA_CERTS/REQUESTS_CA_BUNDLE/GIT_SSL_CAINFO;gatewayUrlbecomesHTTPS_PROXYin each spawned run.onecli.cloonar.comto10.42.98.10, fw forwardsserver→wg_cloonar, and web-arm admits 443 globally plus 10255/10256 on the tunnel interface. Note that fw masquerades tunnel egress, so web-arm sees these requests from10.42.98.1, which is inside its allow-list.HTTPS_PROXY=http://…@10.42.98.10:10255and a granted service call succeeds;GET /api/v1/onecli/healthon lab reports ok; the dashboard answers athttps://onecli.cloonar.comand nothing answers on 8081.Closes #338
[autoland] verdict: pass
PASS — validated locally; no CI signal existed to rely on.
Signal relied on:
labctl pr checksreportedstate: none, so nothing vouched and the repo's own gate was run against the PR head (f8a0617):scripts/test-configuration dev-new→completed successfully(exit 0)scripts/test-configuration fw→completed successfully(exit 0)Both hosts evaluate clean, warnings limited to the usual
--add-rootnotice.Conventions: Conventional Commits title,
Closes #338present and resolving. Head sits directly on currentmain(fc57bd7) — no conflict.Checks beyond the build:
onecli-gateway-ca.pemis byte-identical to whathttps://onecli.cloonar.com/v1/gateway/caserves right now, so the pinned trust material matches the live gateway.writeTrustBundle(coding-labinternal/instance/gateway.go:421-424) writes the system roots trimmed, then a newline, then the gateway PEM last — nothing is concatenated after it.dashboardisenum [ "off" "port" "subdomain" ],caFile/gatewayUrlarenullOr str, and--onecli-dashboardis only emitted when non-off.apiKeyFileis wiredowner = services.lab.user; mode = "0400", satisfying the 0600-or-stricter contract.coding-lab-onecli-api-keyexists inhosts/dev-new/secrets.sops.yaml; no sops file was modified.oci-containers/podman references remain underhosts/dev-new/, and no 8081 reference remains on the web VM (piped.nixbinds 127.0.0.1:8081, which the removed 0.0.0.0 vhost had been shadowing).onecli.cloonar.com→10.42.98.10, and web-arm publishes the gateway on10.42.98.10:10255withnetworking.firewall.interfaces."wg_cloonar".allowedTCPPorts = [ 10255 10256 ].Diff scope matches issue #338 exactly; the two additions beyond its file list (the web VM's
allowedTCPPortsand thematrix.nixcomment) are direct consequences of the removals, not drive-by changes.No CONCERNS. The fail-closed tunnel dependency and the non-migrating grants are ADR-0026's stated, accepted consequences, already recorded in the PR body.