rehearsal-3: get.idss.nz infra — vhost + unit + staged artifacts on the mail droplet (Ben) #516

Closed
opened 2026-08-14 06:20:32 +00:00 by ben · 2 comments
Owner

Part of rehearsal phase 3 — gateway from home (spec docs/superpowers/specs/2026-08-14-183-phase-3-home-gateway-rehearsal-design.md, plan docs/superpowers/plans/2026-08-14-183-phase-3-home-gateway-rehearsal.md).
The plan section below is the work, verbatim; its Interfaces block names what neighbouring tasks consume — keep those names exact.

Global constraints (apply to every step)

  • Use the domain glossary's vocabulary (CONTEXT.md) in ALL copy, comments,
    commit messages: founding, gateway, agent, install command,
    enrollment code — never installer/daemon/token/join-key.
  • Fail loud, never fabricate (ADR 0100): a missing artifact/secret/seam is an
    error with the real reason, never a silent skip or a made-up value.
  • x86_64 only at v1; full install is the consented mode (ADR 0024); the
    install command is a doorway, not a kept tool (ADR 0028).
  • Never write closes #NNN (or any close keyword) in commits or issue bodies
    for the standing drive issue family — say "advances #NNN". Even DESCRIBING a
    close can auto-close (2026-08-10 lesson, twice).
  • Commits that change project state update STATUS.md in the same commit
    (CLAUDE.md rule); the drive-issue minting commit (Task 9) carries the
    STATUS + runbook update for the whole arc.
  • TDD: each step's test is written and seen red before its implementation.
  • Secrets never enter .sandcastle/.env (it forwards into worker containers);
    host-only secrets live in the executor's rehearsal-env.sh (2026-07-11
    lesson).

Task 2: Bootstrap infra — DNS, vhost, deploy (READY-FOR-HUMAN)

Files: none in this repo (mail-droplet Caddyfile + systemd unit, operated
by hand); docs/operator-app/rehearsal-drive.md gains the bootstrap section in
Task 9.

Interfaces:

  • Consumes: Task 1's binary (go build ./bootstrap/cmd/bootstrap) and its
    --dir layout (agent-x86_64, RELEASE).
  • Produces: https://get.idss.nz/ live with a real certificate — the URL
    internal/founding/manualpath.go's installHost already names.

Steps for Ben (the door is ssh dev@100.98.48.68, the broker playbook):

  • DNS: get.idss.nz already resolves via the *.idss.nz wildcard to the
    mail droplet — verify with dig +short get.idss.nz (expect
    143.198.134.168); add an explicit A record only if the wildcard is ever
    narrowed.
  • Build + stage: GOOS=linux GOARCH=amd64 go build -o /tmp/bootstrap ./bootstrap/cmd/bootstrap on the workstation; build the agent the same way
    (go build -o /tmp/agent-x86_64 ./agent/cmd/agent); scp both to the droplet
    (/opt/ourcloud-bootstrap/{bootstrap,artifacts/agent-x86_64}, write
    artifacts/RELEASE with the git SHA).
  • Unit: a ourcloud-bootstrap.service running bootstrap serve --dir /opt/ourcloud-bootstrap/artifacts --addr 127.0.0.1:8091 (User=dev,
    Restart=always — copy the broker unit's shape).
  • Caddy vhost: get.idss.nz { reverse_proxy 127.0.0.1:8091 } beside the
    broker's vhost; reload; verify curl -sSf https://get.idss.nz | head -1
    prints #!/bin/sh and curl -sI "https://get.idss.nz/get?arch=x86_64" | grep X-OurCloud-Release.
  • Record on the ticket: RELEASE value staged, and that re-staging =
    rebuilding both binaries + restarting the unit (no pipeline yet — a
    follow-up if churn hurts).
Part of rehearsal **phase 3 — gateway from home** (spec `docs/superpowers/specs/2026-08-14-183-phase-3-home-gateway-rehearsal-design.md`, plan `docs/superpowers/plans/2026-08-14-183-phase-3-home-gateway-rehearsal.md`). The plan section below is the work, verbatim; its **Interfaces** block names what neighbouring tasks consume — keep those names exact. ## Global constraints (apply to every step) - Use the domain glossary's vocabulary (`CONTEXT.md`) in ALL copy, comments, commit messages: *founding*, *gateway*, *agent*, *install command*, *enrollment code* — never installer/daemon/token/join-key. - Fail loud, never fabricate (ADR 0100): a missing artifact/secret/seam is an error with the real reason, never a silent skip or a made-up value. - x86_64 only at v1; full install is the consented mode (ADR 0024); the install command is a doorway, not a kept tool (ADR 0028). - Never write `closes #NNN` (or any close keyword) in commits or issue bodies for the standing drive issue family — say "advances #NNN". Even DESCRIBING a close can auto-close (2026-08-10 lesson, twice). - Commits that change project state update `STATUS.md` in the same commit (CLAUDE.md rule); the drive-issue minting commit (Task 9) carries the STATUS + runbook update for the whole arc. - TDD: each step's test is written and seen red before its implementation. - Secrets never enter `.sandcastle/.env` (it forwards into worker containers); host-only secrets live in the executor's `rehearsal-env.sh` (2026-07-11 lesson). --- ### Task 2: Bootstrap infra — DNS, vhost, deploy (READY-FOR-HUMAN) **Files:** none in this repo (mail-droplet Caddyfile + systemd unit, operated by hand); `docs/operator-app/rehearsal-drive.md` gains the bootstrap section in Task 9. **Interfaces:** - Consumes: Task 1's binary (`go build ./bootstrap/cmd/bootstrap`) and its `--dir` layout (`agent-x86_64`, `RELEASE`). - Produces: `https://get.idss.nz/` live with a real certificate — the URL `internal/founding/manualpath.go`'s `installHost` already names. Steps for Ben (the door is `ssh dev@100.98.48.68`, the broker playbook): - [ ] DNS: `get.idss.nz` already resolves via the `*.idss.nz` wildcard to the mail droplet — verify with `dig +short get.idss.nz` (expect `143.198.134.168`); add an explicit A record only if the wildcard is ever narrowed. - [ ] Build + stage: `GOOS=linux GOARCH=amd64 go build -o /tmp/bootstrap ./bootstrap/cmd/bootstrap` on the workstation; build the agent the same way (`go build -o /tmp/agent-x86_64 ./agent/cmd/agent`); scp both to the droplet (`/opt/ourcloud-bootstrap/{bootstrap,artifacts/agent-x86_64}`, write `artifacts/RELEASE` with the git SHA). - [ ] Unit: a `ourcloud-bootstrap.service` running `bootstrap serve --dir /opt/ourcloud-bootstrap/artifacts --addr 127.0.0.1:8091` (User=dev, Restart=always — copy the broker unit's shape). - [ ] Caddy vhost: `get.idss.nz { reverse_proxy 127.0.0.1:8091 }` beside the broker's vhost; reload; verify `curl -sSf https://get.idss.nz | head -1` prints `#!/bin/sh` and `curl -sI "https://get.idss.nz/get?arch=x86_64" | grep X-OurCloud-Release`. - [ ] Record on the ticket: RELEASE value staged, and that re-staging = rebuilding both binaries + restarting the unit (no pipeline yet — a follow-up if churn hurts).
Author
Owner

Relabelled ready-for-session under ADR 0174: every step runs through the established droplet door (dev@100.98.48.68) with the broker deploy's rollback pattern, and is reversible by removing the vhost/unit. Nothing here needs Ben's hands.

Relabelled `ready-for-session` under ADR 0174: every step runs through the established droplet door (`dev@100.98.48.68`) with the broker deploy's rollback pattern, and is reversible by removing the vhost/unit. Nothing here needs Ben's hands.
Author
Owner

Landed by session (ADR 0174) — https://get.idss.nz/ is live with a real certificate.

  • DNS: dig +short get.idss.nz → 143.198.134.168 via the *.idss.nz wildcard, as predicted — no explicit record added.
  • Staged: /opt/ourcloud-bootstrap/bootstrap + artifacts/agent-x86_64 (both GOOS=linux GOARCH=amd64, built from 6bff1f9), artifacts/RELEASE = 6bff1f95b60d0b0e99a70ea4916a7141326caba7.
  • Unit: ourcloud-bootstrap.service — bootstrap serve --dir /opt/ourcloud-bootstrap/artifacts --addr 127.0.0.1:8091, User=dev, Restart=always + the broker unit's hardening (NoNewPrivileges, ProtectSystem=strict, ProtectHome); enabled + active.
  • Caddy: /etc/caddy/conf.d/get.caddy beside the broker's vhost; cert obtained via TLS-ALPN-01 at 17:15:49Z.
  • Proof: curl -sSf https://get.idss.nz | head -1 → #!/bin/sh; curl -sI …/get?arch=x86_64 → HTTP/2 200, x-ourcloud-release: 6bff1f9…; unknown arch → honest 503 (fail-loud, ADR 0100).

Re-staging procedure (no pipeline yet — a follow-up if churn hurts): rebuild both binaries at the new SHA, scp to /tmp, sudo mv into /opt/ourcloud-bootstrap/{bootstrap,artifacts/agent-x86_64}, update artifacts/RELEASE, sudo systemctl restart ourcloud-bootstrap.

Note: caddy validate on this droplet false-fails (the acmedns TLS module parses env the CLI doesn't carry) — validate is not a usable pre-check here; the reload itself is atomic and loud.

**Landed by session (ADR 0174) — `https://get.idss.nz/` is live with a real certificate.** - DNS: `dig +short get.idss.nz` → `143.198.134.168` via the `*.idss.nz` wildcard, as predicted — no explicit record added. - Staged: `/opt/ourcloud-bootstrap/bootstrap` + `artifacts/agent-x86_64` (both `GOOS=linux GOARCH=amd64`, built from `6bff1f9`), `artifacts/RELEASE` = `6bff1f95b60d0b0e99a70ea4916a7141326caba7`. - Unit: `ourcloud-bootstrap.service` — `bootstrap serve --dir /opt/ourcloud-bootstrap/artifacts --addr 127.0.0.1:8091`, `User=dev`, `Restart=always` + the broker unit's hardening (`NoNewPrivileges`, `ProtectSystem=strict`, `ProtectHome`); enabled + active. - Caddy: `/etc/caddy/conf.d/get.caddy` beside the broker's vhost; cert obtained via TLS-ALPN-01 at 17:15:49Z. - Proof: `curl -sSf https://get.idss.nz | head -1` → `#!/bin/sh`; `curl -sI …/get?arch=x86_64` → `HTTP/2 200`, `x-ourcloud-release: 6bff1f9…`; unknown arch → honest 503 (fail-loud, ADR 0100). **Re-staging procedure** (no pipeline yet — a follow-up if churn hurts): rebuild both binaries at the new SHA, `scp` to `/tmp`, `sudo mv` into `/opt/ourcloud-bootstrap/{bootstrap,artifacts/agent-x86_64}`, update `artifacts/RELEASE`, `sudo systemctl restart ourcloud-bootstrap`. Note: `caddy validate` on this droplet false-fails (the acmedns TLS module parses env the CLI doesn't carry) — validate is not a usable pre-check here; the reload itself is atomic and loud.
ben closed this issue 2026-08-14 17:17:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#516
No description provided.