web-arm: central OneCLI credential gateway (container + host PG14, WireGuard-only exposure, borg-backed) #337
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#337
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Stand up a central OneCLI instance on web-arm, to be shared by multiple consumers (coding-lab first, a nanoclaw instance later — nanoclaw itself out of scope). This is PR 1 of 2; the lab cutover and dev-new sidecar retirement is a separate follow-up issue. Design was settled in a grill session on 2026-08-14.
Deployment shape
hosts/web-arm/modules/onecli/imported from web-arm's configuration.oci-containerscontainer, imageghcr.io/onecli/oneclipinned by tag + sha256 digest (powersync pattern, see hosts/web-arm/modules/powersync/default.nix) — no bundled postgres container.hosts/dev-new/modules/coding-lab/onecli.nixand upstreamdocker/docker-compose.yml.Database: web-arm's host PG14
services.postgresql:ensureDatabases = [ "onecli" ],ensureUserswithensureDBOwnership; container reaches PG over TCP via the container bridge gateway (powersync precedent).DATABASE_URLvia the container'senvironmentFiles(sops template).pg_hbascram-sha-256 line scoped to db+role+bridge-subnet as second layer, plus the matching firewall allowance for 5432 from that subnet only.Auth: login mode
NEXTAUTH_SECRETset from web-arm sops (secret injected via environmentFiles — never plainenvironment). No local mode: the central instance must not be admin-to-whoever-connects.APP_URL = https://onecli.cloonar.com(OAuth redirect_uris derive from it).INTERNAL_API_URL = http://localhost:10254(gateway→API stays in-container).Exposure: WireGuard tunnel only, nothing public
onecli.cloonar.com(forceSSL, cert via the existing lego DNS-01 defaults) proxying to it, withallow 10.42.96.0/24; allow 10.42.97.0/24; allow 10.42.98.0/24; deny all;.10.42.98.10ONLY. It is a CONNECT forward proxy and cannot ride nginx; consumers dial it directly over the tunnel. No public bind, no new WAN firewall opening on web-arm.onecli.cloonar.com → 10.42.98.10to fw's dnsmasq so internal clients and the browser resolve it over the tunnel.Backups (all riding existing machinery)
services.postgresqlBackup.databases = [ "onecli" ]— nightly dump lands under /var/backup/postgresql, inside the borg job./app/databind-mounted to host dir/var/lib/onecli(mode 0700) — deliberately NOT a named volume: web-arm's borg job excludes /var/lib/containers/, so a named volume would silently never be backed up, and upstream is silent on where the at-rest AES-256-GCM encryption key lives (most likely /app/data).Secrets for the operator to add (agent must NOT edit sops files)
In
hosts/web-arm/secrets.sops.yamlvianix-shell -p sops --run 'sops hosts/web-arm/secrets.sops.yaml':onecli-nextauth-secret— random 32+ byte valueonecli-db-password— random password for theonecliPG role(The module should consume both via sops templates/environmentFiles; exact key names may follow the module's naming, but the PR must state them.)
Out of scope here