nixos/palace: Run slop-broker for agents
`slop-cannon`'s agents reach the broker on `palace` through a vsock device, under an `agent` policy: box queries run without asking, `slop ssh` asks (offering 5 min and 1 h leases), and so do deploys. The deploy key moves to `palace` as an age secret for the broker, so the VM never holds it, and `AGENTS.md` points agents there at `slop`. `palace` runs the builder itself, as `slop-broker-build`, reached over SSH like a separate box and fetching `dev/nixfiles` with a read-only deploy key, so `slop-cannon` shrinks to 24 GiB. `slop build` pushes into Harmonia's store on `object` with a key of the broker's own, which can only speak the store protocol and add GC roots there. Agents' use of the builder asks, unless the commit is already on `master`. Builds run agent-written Nix, so they only reach the Internet, like `lan-untrusted`, and `nix-daemon` is limited so they can't starve the VMs. The approvals web app listens on `palace` for `middleman` only, the one client the firewall lets in, which publishes it at `approve.slop.nul.ie`. Approvers sign in with Pocket ID, and deploys to the routers need a fresh passkey. The broker's SSH targets are the deploy-rs nodes on `master`, which the builder reads there, so agents can't add or redirect one. With the broker gating what needs credentials, `slop-cannon`'s agents are permissive by default: Claude bypasses permission prompts and Codex runs without approvals or its sandbox, with matching Paseo profiles. The deny rules for raw `deploy` and `ssh-machine` stay as steers towards `slop`; the ones for `.keys/` go, since the VM's checkout only has the committed public keys there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
71ed076f12
commit
2519c3c86c
17 files changed
+416
-35
No files matched your search
+59
-1
@@ -10,6 +10,20 @@ repository, which this flake takes as the `slop-broker` input. This page covers
|
||||
it; for how it works, read the repository's
|
||||
[design](https://git.nul.ie/dev/slop-broker/src/branch/main/docs/design.md).
|
||||
|
||||
## Boxes
|
||||
|
||||
| Box | Role |
|
||||
|---|---|
|
||||
| [`palace`](sites/home/palace.md) | Runs the broker, its builder and the approvals web app's listener; holds the deploy key |
|
||||
| [`slop-cannon`](sites/home/slop-cannon.md) | The agents' VM; reaches the broker over vsock |
|
||||
| [`object`](sites/colony/shill/containers/object.md) | The binary cache that `slop build` pushes to |
|
||||
| [`middleman`](sites/colony/shill/containers/middleman.md) | Publishes the approvals web app at `approve.slop.nul.ie`, Pocket ID at `id.nul.ie` and Paseo's web app at `slop.nul.ie` |
|
||||
|
||||
`palace`'s configuration is [`palace/slop-broker.nix`](../nixos/boxes/home/palace/slop-broker.nix):
|
||||
the requesters, the `agent` policy they share, the secrets, and the web app settings. Its SSH
|
||||
targets are the deploy-rs nodes on `master`, which the builder reads there, so a new box is a
|
||||
target once it's merged.
|
||||
|
||||
## In this flake
|
||||
|
||||
- **Input:** `slop-broker` in [`flake.nix`](../flake.nix). Its overlay provides `pkgs.slop-broker`,
|
||||
@@ -17,9 +31,53 @@ it; for how it works, read the repository's
|
||||
`services.slop-broker-cache` and `programs.slop`. Update it with `nix flake update slop-broker`.
|
||||
- **Persistence:** [`tmproot.nix`](../nixos/modules/tmproot.nix) keeps `/var/lib/slop-broker` and
|
||||
the builder's home when those services are enabled.
|
||||
- **Firewall:** the web app's port is open only to `middleman`, in `palace`'s configuration.
|
||||
- **Agents:** `my.agents.slop` (in the shared `agents` home-manager module) installs `slop` and adds
|
||||
the guide (`share/slop-broker/slop-tools.md`) as a Claude rule (`~/.claude/rules/slop.md`) and
|
||||
as Codex's `AGENTS.md`.
|
||||
as Codex's `AGENTS.md`. `slop-cannon` enables it, allows `Bash(slop:*)` in Claude and keeps the
|
||||
`deny` rules for raw `deploy` and `ssh-machine`.
|
||||
- **`AGENTS.md`:** "Working from `slop-cannon`" points agents at `slop` instead of `deploy` and
|
||||
`ssh-machine`. Extend it as operations land.
|
||||
- **Devshell:** `slop` and `slop-approve`, built from the locked input. `slop` uses
|
||||
`.keys/slop-request.key` over SSH when that file exists; an approver key never goes in `.keys/`,
|
||||
because agents can read the checkout.
|
||||
|
||||
## Binary cache
|
||||
|
||||
`slop build` pushes into Harmonia's store on `object` as `harmonia`, whose broker key is limited to
|
||||
the store protocol and GC roots (`services.slop-broker-cache` in `object`'s configuration). CI
|
||||
collects garbage in that store on every run, which the roots survive until they expire (see the
|
||||
[design](https://git.nul.ie/dev/slop-broker/src/branch/main/docs/design.md#binary-cache)).
|
||||
|
||||
## Approvals web app
|
||||
|
||||
`middleman` proxies `approve.slop.nul.ie` to port 8095 on `palace`. Approvers sign in through
|
||||
Pocket ID at `id.nul.ie` (client `slop-approve`, restricted to the group `slop-approvers`; its
|
||||
secret is `palace/slop-broker-oidc-secret`). Deploys to the routers (`river`, `stream` and
|
||||
`estuary`) need a fresh passkey. See the
|
||||
[design](https://git.nul.ie/dev/slop-broker/src/branch/main/docs/design.md#approvals-web-app).
|
||||
|
||||
## `slop.nul.ie`
|
||||
|
||||
`slop.nul.ie` replaces `paseo.nul.ie` for the Paseo web app on `middleman` (`paseoWebUi` in
|
||||
`vhosts.nix`, `app.baseUrl` in `slop-cannon.nix`), and `*.slop.nul.ie` is reserved for previews.
|
||||
The relay stays on `paseo-relay.nul.ie` for now, because existing pairings use that hostname.
|
||||
|
||||
Previews on `*.slop.nul.ie` will be same-site with every other `nul.ie` service, so a preview page
|
||||
can set cookies on `.nul.ie` and browsers send `SameSite=Lax` cookies (including the SSO session)
|
||||
with its requests to other `nul.ie` services. A separate domain would avoid this; `nul.ie` is kept
|
||||
for simplicity.
|
||||
|
||||
## Rollout
|
||||
|
||||
Each step updates this page, the box pages and `AGENTS.md` as it lands.
|
||||
|
||||
1. **Done:** `slop.nul.ie`; the broker core, box queries, SSH transport, deploys and builds on
|
||||
`palace`; Pocket ID at `id.nul.ie`.
|
||||
2. **Approvals web app:** remove the temporary `http://localhost:8095/auth/callback` from the
|
||||
`slop-approve` client, deploy `palace` and `middleman`.
|
||||
3. **Secrets:** the broker's age identity joins `.keys/dev.pub` in the recipients that
|
||||
`secrets.nix` generates (one full rekey), so the dev key never goes to `palace`.
|
||||
4. **DNS**, with a Cloudflare token of the broker's own for the public zones.
|
||||
5. **Previews** on `*.slop.nul.ie`, through `middleman`.
|
||||
6. **TCP forwards and a cache for VM builds**, if needed.
|
||||
Reference in new issue
Block a user