broker auto-deploy: droplet one-time setup (deploy user + sudoers + install script + BROKER_DEPLOY_SSH_KEY) — hands step of #688 #690

Closed
opened 2026-08-23 04:23:00 +00:00 by matou-build-agent · 1 comment

Why (droplet hands step — filed from #688)

The broker's auto-deploy rail (#688, ADR 0185) needs a one-time setup on the mail
droplet (100.98.48.68) that no swarm substrate can reach (#445). A worker
cannot touch the droplet, so #688 ships the recipe and files this hands step, as
its deliverable 4 directs.

The runbook is already in the repo: broker/README.md → "Droplet one-time
setup — Ben's !"
. This issue tracks running it.

What a human does (once, as root on the mail droplet)

  1. Create a locked-down deploy user (no interactive shell).
  2. Install scripts/broker/idss-broker-install.sh to
    /usr/local/sbin/idss-broker-install (root:755).
  3. One sudoers line: deploy ALL=(root) NOPASSWD: /usr/local/sbin/idss-broker-install *
    (validate with visudo -cf).
  4. Generate an ed25519 keypair idss-broker-deploy; authorize the PUBLIC key in
    ~deploy/.ssh/authorized_keys (force-command to the installer, no pty/forwarding).
  5. Store the PRIVATE key as the repo secret BROKER_DEPLOY_SSH_KEY (NOT the dev
    user's key).

Exact commands: broker/README.md.

Acceptance

  • A workflow_dispatch of broker-deploy (the ready-for-session sibling, once
    its workflows are merged) with a published sha ends with
    journalctl -u ourcloud-broker | grep 'broker booted' naming that version and
    curl -fsS http://127.0.0.1:8090/v1/gateways/offer returning 200 — proven by
    one real run.
  • The deploy user can run ONLY /usr/local/sbin/idss-broker-install via sudo
    (nothing else), and its ssh key is force-commanded to the installer.

Notes

This is a security-posture step (a new user + sudoers + an inbound ssh key on a
Matou-infra droplet), so it is ready-for-human, not a two-way-door agent
ruling. The installer itself rolls back and fails red on a bad binary
(offline-proven in scripts/tests/broker-install-test.sh), so the worst a bad
deploy does is keep the OLD broker serving.

## Why (droplet hands step — filed from #688) The broker's auto-deploy rail (#688, ADR 0185) needs a one-time setup on the mail droplet (`100.98.48.68`) that no swarm substrate can reach (#445). A worker cannot touch the droplet, so #688 ships the recipe and files this hands step, as its deliverable 4 directs. The runbook is already in the repo: **`broker/README.md` → "Droplet one-time setup — Ben's `!`"**. This issue tracks running it. ## What a human does (once, as root on the mail droplet) 1. Create a locked-down `deploy` user (no interactive shell). 2. Install `scripts/broker/idss-broker-install.sh` to `/usr/local/sbin/idss-broker-install` (root:755). 3. One sudoers line: `deploy ALL=(root) NOPASSWD: /usr/local/sbin/idss-broker-install *` (validate with `visudo -cf`). 4. Generate an ed25519 keypair `idss-broker-deploy`; authorize the PUBLIC key in `~deploy/.ssh/authorized_keys` (force-command to the installer, no pty/forwarding). 5. Store the PRIVATE key as the repo secret `BROKER_DEPLOY_SSH_KEY` (NOT the `dev` user's key). Exact commands: `broker/README.md`. ## Acceptance - A `workflow_dispatch` of `broker-deploy` (the `ready-for-session` sibling, once its workflows are merged) with a published sha ends with `journalctl -u ourcloud-broker | grep 'broker booted'` naming that version and `curl -fsS http://127.0.0.1:8090/v1/gateways/offer` returning 200 — proven by one real run. - The `deploy` user can run ONLY `/usr/local/sbin/idss-broker-install` via sudo (nothing else), and its ssh key is force-commanded to the installer. ## Notes This is a security-posture step (a new user + sudoers + an inbound ssh key on a Matou-infra droplet), so it is `ready-for-human`, not a two-way-door agent ruling. The installer itself rolls back and fails red on a bad binary (offline-proven in `scripts/tests/broker-install-test.sh`), so the worst a bad deploy does is keep the OLD broker serving.
Owner

Done, 2026-08-25 (interactive session — Ben's hands on the droplet, agent prep around them).

All five runbook steps are in place on the mail droplet:

  1. deploy system user created (uid=995, /usr/sbin/nologin, no interactive shell).
  2. The repo's current scripts/broker/idss-broker-install.sh installed at /usr/local/sbin/idss-broker-install (root:root 0755 — refreshed from today's working tree, superseding the copy that was already present).
  3. Sudoers line landed at /etc/sudoers.d/idss-broker-deploy (0440), visudo -cf parsed OK.
  4. Fresh idss-broker-deploy ed25519 keypair; the PUBLIC key authorized in ~deploy/.ssh/authorized_keys with the forced command (sudo /usr/local/sbin/idss-broker-install $SSH_ORIGINAL_COMMAND), no-port-forwarding,no-agent-forwarding,no-pty — exactly one key line.
  5. The PRIVATE key stored as repo Actions secret BROKER_DEPLOY_SSH_KEY (HTTP 201) — not the dev user's key. The local key file was shredded after upload; the secret is its only home.

The acceptance's workflow_dispatch of broker-deploy proving the rail end-to-end belongs to the auto-deploy sibling's proof run — this ticket's one-time hands step is complete.

**Done, 2026-08-25 (interactive session — Ben's hands on the droplet, agent prep around them).** All five runbook steps are in place on the mail droplet: 1. `deploy` system user created (`uid=995`, `/usr/sbin/nologin`, no interactive shell). 2. The repo's current `scripts/broker/idss-broker-install.sh` installed at `/usr/local/sbin/idss-broker-install` (root:root 0755 — refreshed from today's working tree, superseding the copy that was already present). 3. Sudoers line landed at `/etc/sudoers.d/idss-broker-deploy` (0440), `visudo -cf` parsed OK. 4. Fresh `idss-broker-deploy` ed25519 keypair; the PUBLIC key authorized in `~deploy/.ssh/authorized_keys` with the forced command (`sudo /usr/local/sbin/idss-broker-install $SSH_ORIGINAL_COMMAND`), `no-port-forwarding,no-agent-forwarding,no-pty` — exactly one key line. 5. The PRIVATE key stored as repo Actions secret `BROKER_DEPLOY_SSH_KEY` (HTTP 201) — not the `dev` user's key. The local key file was shredded after upload; the secret is its only home. The acceptance's `workflow_dispatch` of `broker-deploy` proving the rail end-to-end belongs to the auto-deploy sibling's proof run — this ticket's one-time hands step is complete.
ben closed this issue 2026-08-25 20:57:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#690
No description provided.