IDSS storage module: an S3-compatible store that runs on an ordinary Linux box (no nix, no clan, no VM) #1754

Closed
opened 2026-09-23 04:57:14 +00:00 by ben · 2 comments
Owner

What

Design and build the IDSS storage module: a self-contained, S3-compatible object store that runs on an ordinary Linux box — no nix, no clan, no VM required.

This is the thing that holds every community's "IDSS offsite storage" copies (DDR 0268 decision 4). Nothing holds those bytes today: the backup engine's offsite resolver is never armed (#310, deferred) and the Broker has no bucket to hand out.

Why it cannot be a clan/NixOS module

ADR 0269 ruled the first host: bens-mac-04, which is Ubuntu 24.04 on Mac hardware, not NixOS — a swarm host and local-guest drive host brought up by hand. Every other piece of IDSS server software is a NixOS module rendered by clan onto a clan-managed machine. None of that machinery exists on this host, and Ben ruled it must not be required.

A clan/NixOS module may exist later, in addition (e.g. a community hosting storage for a partner community). It must never be the only way to run this.

Scope

Design

  • Pick the store (Garage / MinIO / other) and record why, in the ADR 0269 line of reasoning: no foreign repository format between a community and its data — the engine writes plain sealed files beside inventory.json (ADR 0082 §2, ADR 0104).
  • Install/upgrade/supervise story on a host IDSS does not manage — this is a new class of IDSS software and it gets none of clan's lifecycle for free.
  • Per-bucket credentials + quota model the Broker can drive (bucket create, scoped key issue, read-only re-issue, quota enforcement).
  • Disk accounting: its own directory with a hard ceiling. Measured on bens-mac-04 2026-09-22: 60 GB free of 229 GB (73% used), 15 GB RAM / ~12 GB available — shared with swarm workers and drive images that churn tens of GB. Backups must not starve the drives; drives must not eat a community's only offsite copy.

Build

  • The module, installable on a plain Ubuntu box by a documented, repeatable procedure.
  • Reachability per ADR 0269 decision 2: public name storage.idss.nz → Mātou infrastructure (Broker droplet) → bens-mac-04 over NetBird (100.98.33.81). No router port-forward at Ben's house; no home address published. The *.idss.nz wildcard resolves everything, so the route must be explicit, never inherited from the wildcard.

Acceptance criteria

  1. The module installs and runs on bens-mac-04 (Ubuntu 24.04, x86_64) with no nix, no clan and no VM anywhere in the procedure, and the procedure is written down and repeatable on a second plain box.
  2. storage.idss.nz serves the S3-compatible API from outside Mātou's network, with no port forwarded at the host's router.
  3. A bucket can be created with a scoped key that can read/write only that bucket, and a quota that refuses writes past its ceiling.
  4. internal/backupengine's S3Store drives it end to end against a real bucket: Put / Get / List / Delete, and a sealed artifact + inventory.json land as plain objects readable with the community's keys and standard tooling.
  5. Storage cannot exceed its own disk ceiling, and its usage is visible separately from the host's swarm/drive usage.
  6. S3Store.Free reports real headroom (it answers math.MaxInt64 today), so a run refuses before it fills a target.

Not in scope

  • The Broker's provisioning verb, the free-tier allowance figure, and the "Turn on" row on the policy screen — DDR 0268, its own ticket (blocked on this one).
  • Bring-your-own bucket and the partner-community site — later instances of the same offsite surface.
  • Arming the engine's resolver end to end for communities (#310) — un-deferred by DDR 0268, lands with the Broker verb.

Decisions

  • ADR 0269 — Mātou's hosted offsite storage runs on an ordinary box behind storage.idss.nz (the host ruling and the no-nix/no-clan/no-VM constraint).
  • DDR 0268 — the hosted offsite target it serves.
  • ADR 0082 §2 / ADR 0104 — plain sealed files beside a self-describing inventory; no foreign repository format.
  • #310 — the deferred offsite slice this un-blocks.

Why session

Host credentials for bens-mac-04, Mātou's mesh and the Broker droplet, plus a new public DNS name in the idss.nz zone — live infrastructure, not swarm-sandbox work.

## What Design and build the **IDSS storage module**: a self-contained, S3-compatible object store that runs on an **ordinary Linux box** — **no nix, no clan, no VM required**. This is the thing that holds every community's **"IDSS offsite storage"** copies (DDR 0268 decision 4). Nothing holds those bytes today: the backup engine's offsite resolver is never armed (#310, `deferred`) and the Broker has no bucket to hand out. ## Why it cannot be a clan/NixOS module ADR 0269 ruled the first host: **`bens-mac-04`**, which is **Ubuntu 24.04 on Mac hardware, not NixOS** — a swarm host and local-guest drive host brought up by hand. Every other piece of IDSS server software is a NixOS module rendered by clan onto a clan-managed machine. **None of that machinery exists on this host**, and Ben ruled it must not be required. A clan/NixOS module may exist **later, in addition** (e.g. a community hosting storage for a partner community). It must never be the only way to run this. ## Scope **Design** - Pick the store (Garage / MinIO / other) and record why, in the ADR 0269 line of reasoning: no foreign repository format between a community and its data — the engine writes plain sealed files beside `inventory.json` (ADR 0082 §2, ADR 0104). - Install/upgrade/supervise story on a host IDSS does not manage — this is a **new class of IDSS software** and it gets none of clan's lifecycle for free. - Per-bucket credentials + quota model the Broker can drive (bucket create, scoped key issue, read-only re-issue, quota enforcement). - Disk accounting: its own directory with a hard ceiling. **Measured on `bens-mac-04` 2026-09-22: 60 GB free of 229 GB (73% used), 15 GB RAM / ~12 GB available** — shared with swarm workers and drive images that churn tens of GB. Backups must not starve the drives; drives must not eat a community's only offsite copy. **Build** - The module, installable on a plain Ubuntu box by a documented, repeatable procedure. - Reachability per ADR 0269 decision 2: public name `storage.idss.nz` → Mātou infrastructure (Broker droplet) → `bens-mac-04` over NetBird (`100.98.33.81`). **No router port-forward at Ben's house; no home address published.** The `*.idss.nz` wildcard resolves everything, so the route must be **explicit**, never inherited from the wildcard. ## Acceptance criteria 1. The module installs and runs on `bens-mac-04` (Ubuntu 24.04, x86_64) with **no nix, no clan and no VM** anywhere in the procedure, and the procedure is written down and repeatable on a second plain box. 2. `storage.idss.nz` serves the S3-compatible API from outside Mātou's network, with no port forwarded at the host's router. 3. A bucket can be created with a **scoped** key that can read/write only that bucket, and a **quota** that refuses writes past its ceiling. 4. `internal/backupengine`'s `S3Store` drives it end to end against a real bucket: `Put` / `Get` / `List` / `Delete`, and a sealed artifact + `inventory.json` land as **plain objects** readable with the community's keys and standard tooling. 5. Storage cannot exceed its own disk ceiling, and its usage is visible separately from the host's swarm/drive usage. 6. `S3Store.Free` reports **real** headroom (it answers `math.MaxInt64` today), so a run refuses before it fills a target. ## Not in scope - The Broker's provisioning verb, the free-tier allowance figure, and the "Turn on" row on the policy screen — DDR 0268, its own ticket (blocked on this one). - Bring-your-own bucket and the partner-community site — later instances of the same offsite surface. - Arming the engine's resolver end to end for communities (#310) — un-deferred by DDR 0268, lands with the Broker verb. ## Decisions - **ADR 0269** — Mātou's hosted offsite storage runs on an ordinary box behind `storage.idss.nz` (the host ruling and the no-nix/no-clan/no-VM constraint). - **DDR 0268** — the hosted offsite target it serves. - **ADR 0082 §2 / ADR 0104** — plain sealed files beside a self-describing inventory; no foreign repository format. - **#310** — the deferred offsite slice this un-blocks. ## Why session Host credentials for `bens-mac-04`, Mātou's mesh and the Broker droplet, plus a new public DNS name in the `idss.nz` zone — live infrastructure, not swarm-sandbox work.

Session report (ADR 0174) — two-way parts landed, public edge routed to Ben

Worked under the standing-session drainer on bens-mac-04. This ticket bundles a two-way design + engine build with a one-way public-infrastructure edge; the two-way parts are landed and proven, the one-way edge stops on the human (below).

Landed — commit 2d938d1b on main

Design (ruled by agent under ADR 0174 — veto anytime):

  • DDR 0268 docs/adr/0268-design-the-hosted-offsite-storage-target.md — the hosted offsite target: plain sealed objects beside inventory.json (ADR 0082 §2), one bucket + one scoped key + one quota per community, the Broker drives provisioning. The member-facing free-tier figure and the "Turn on" row copy are explicitly left to Ben (a trust-surface accept), not decided here.
  • ADR 0269 docs/adr/0269-idss-storage-runs-garage-on-an-ordinary-box-behind-storage-idss-nz.md — the host + store ruling: store = Garage (rationale recorded in the ADR 0104 line of reasoning: a frugal single static binary that fits a shared ~12 GB-RAM/60 GB-free box, whose per-bucket scoped keys + max_size quota are exactly the Broker's model, keeping the sovereignty stance — the S3 object is the community's sealed file). Install/upgrade/supervise story, disk-accounting model, and the reachability design.
  • Runbook docs/ops/idss-storage-install.md — a repeatable Ubuntu 24.04 procedure (dedicated idss-storage user, pinned + sha-checked binary, garage.toml bound to the mesh address only, systemd unit, filesystem-enforced ceiling, and the by-hand bucket/scoped-key/quota commands the Broker verb will automate). Written to repeat on a second plain box.

Build (acceptance 6):

  • OffsiteConfig.Quota + a quota-aware S3Store.Free. It answered math.MaxInt64 unconditionally; now, when a target carries a quota, it reports real headroom (quota − measured bucket usage, via a shared eachObject walk, floored at 0) so a run refuses before it fills a community's only offsite copy. The generic-provider no-quota path stays MaxInt64 (documented). Red-first TestS3Store_FreeReportsQuotaHeadroom; internal/backup + internal/backupengine green, go vet + gofmt clean.

Proven — live, against real Garage (acceptances 3, 4, 5)

A transient Garage v1.1.0 was stood up on bens-mac-04 on loopback (high ports, so it never touched the pre-existing garage/services on this shared host) and torn down afterward — nothing persistent installed. Driven by the engine's own S3Store:

  • a bucket with a scoped RW key (read/write that bucket only) and a scoped RO rescue key (read-only re-issue on the same bucket), and a 1000-byte quota — the DDR 0268 credential/quota model, first-class in Garage;
  • a sealed artifact + inventory.json landed as plain objects; Get / List / Delete round-tripped them; Free tracked 944/1000 → 1000 back;
  • an over-quota Put was refused server-side by Garage (AccessDenied: Bucket size quota is reached, maximum total size of objects for this bucket: 1000. The bucket is already 56 bytes, and this object would add 2000 bytes).

This also confirms the engine's hand-signed SigV4 path-style client speaks Garage's S3 surface with no third-party SDK. The production offsite resolver stays unarmed (#310, the Broker verb's job — out of scope; WithOffsite still has no caller).

Proves it: the Go unit test (in tree) for the quota-aware Free; the live Garage drive above for the store choice + credential/quota model + plain-object contract. Why two-way: the store pick is a config + a userspace install a session can revert, the code is additive, and the docs are docs.

Why human

The remaining acceptance criteria are ADR 0174 one-way doors — Ben's hands, not a session's:

  1. A new deliberately-public surface — acceptance 2 stands up storage.idss.nz serving the S3 API from outside Mātou's network. New public surface = the #329-class security-posture widening the one-way-door list reserves for the human.
  2. A new record in the idss.nz zone — the route must be explicit, never inherited from the *.idss.nz wildcard (ADR 0269 decision 2). Zone credentials are Ben's.
  3. A Broker-droplet edge change — reverse-proxying storage.idss.nz over NetBird to bens-mac-04 at 100.98.33.81 (no router port-forward at the house, no home address published). Mātou-infra config, not revertible-by-commit from a session.

The proposed default for all three is written up in ADR 0269 "Reachability" + runbook §7 for Ben to accept or veto. Executing the persistent install on bens-mac-04 (acceptance 1) is best done in the same deliberate infra session as the public route — the transient drive above proved the procedure; standing the daemon up for real on the shared production host has no point until its public edge exists.

Acceptances 1 and 2 are the human residue; 3, 4, 5, 6 are landed/proven above. Routing ready-for-session → ready-for-human.

## Session report (ADR 0174) — two-way parts landed, public edge routed to Ben Worked under the standing-session drainer on `bens-mac-04`. This ticket bundles a two-way design + engine build with a one-way public-infrastructure edge; the two-way parts are **landed and proven**, the one-way edge **stops on the human** (below). ### Landed — commit `2d938d1b` on `main` **Design (ruled by agent under ADR 0174 — veto anytime):** - **DDR 0268** `docs/adr/0268-design-the-hosted-offsite-storage-target.md` — the hosted offsite target: plain sealed objects beside `inventory.json` (ADR 0082 §2), one bucket + one scoped key + one quota per community, the Broker drives provisioning. The member-facing **free-tier figure** and the **"Turn on" row copy** are explicitly left to Ben (a trust-surface accept), not decided here. - **ADR 0269** `docs/adr/0269-idss-storage-runs-garage-on-an-ordinary-box-behind-storage-idss-nz.md` — the host + store ruling: **store = Garage** (rationale recorded in the ADR 0104 line of reasoning: a frugal single static binary that fits a shared ~12 GB-RAM/60 GB-free box, whose per-bucket scoped keys + `max_size` quota are exactly the Broker's model, keeping the sovereignty stance — the S3 object *is* the community's sealed file). Install/upgrade/supervise story, disk-accounting model, and the reachability **design**. - **Runbook** `docs/ops/idss-storage-install.md` — a repeatable Ubuntu 24.04 procedure (dedicated `idss-storage` user, pinned + sha-checked binary, `garage.toml` bound to the mesh address only, systemd unit, filesystem-enforced ceiling, and the by-hand bucket/scoped-key/quota commands the Broker verb will automate). Written to repeat on a second plain box. **Build (acceptance 6):** - `OffsiteConfig.Quota` + a quota-aware `S3Store.Free`. It answered `math.MaxInt64` unconditionally; now, when a target carries a quota, it reports **real** headroom (quota − measured bucket usage, via a shared `eachObject` walk, floored at 0) so a run refuses **before** it fills a community's only offsite copy. The generic-provider no-quota path stays `MaxInt64` (documented). Red-first `TestS3Store_FreeReportsQuotaHeadroom`; `internal/backup` + `internal/backupengine` green, `go vet` + `gofmt` clean. ### Proven — live, against real Garage (acceptances 3, 4, 5) A transient Garage `v1.1.0` was stood up on `bens-mac-04` on loopback (high ports, so it never touched the pre-existing garage/services on this shared host) and **torn down afterward** — nothing persistent installed. Driven by the engine's own `S3Store`: - a **bucket** with a **scoped RW key** (read/write *that bucket only*) and a **scoped RO rescue key** (read-only re-issue on the same bucket), and a **1000-byte quota** — the DDR 0268 credential/quota model, first-class in Garage; - a sealed artifact + `inventory.json` landed as **plain objects**; `Get` / `List` / `Delete` round-tripped them; `Free` tracked `944/1000` → `1000` back; - an over-quota `Put` was **refused server-side by Garage** (`AccessDenied: Bucket size quota is reached, maximum total size of objects for this bucket: 1000. The bucket is already 56 bytes, and this object would add 2000 bytes`). This also confirms the engine's hand-signed SigV4 path-style client speaks Garage's S3 surface with no third-party SDK. The production offsite resolver **stays unarmed** (#310, the Broker verb's job — out of scope; `WithOffsite` still has no caller). **Proves it:** the Go unit test (in tree) for the quota-aware `Free`; the live Garage drive above for the store choice + credential/quota model + plain-object contract. **Why two-way:** the store pick is a config + a userspace install a session can revert, the code is additive, and the docs are docs. ## Why human The remaining acceptance criteria are ADR 0174 **one-way doors** — Ben's hands, not a session's: 1. **A new deliberately-public surface** — acceptance 2 stands up `storage.idss.nz` serving the S3 API from outside Mātou's network. New public surface = the #329-class security-posture widening the one-way-door list reserves for the human. 2. **A new record in the `idss.nz` zone** — the route must be **explicit**, never inherited from the `*.idss.nz` wildcard (ADR 0269 decision 2). Zone credentials are Ben's. 3. **A Broker-droplet edge change** — reverse-proxying `storage.idss.nz` over NetBird to `bens-mac-04` at `100.98.33.81` (no router port-forward at the house, no home address published). Mātou-infra config, not revertible-by-commit from a session. The **proposed default** for all three is written up in ADR 0269 "Reachability" + runbook §7 for Ben to accept or veto. Executing the **persistent** install on `bens-mac-04` (acceptance 1) is best done in the same deliberate infra session as the public route — the transient drive above proved the procedure; standing the daemon up for real on the shared production host has no point until its public edge exists. Acceptances **1 and 2 are the human residue**; **3, 4, 5, 6 are landed/proven** above. Routing `ready-for-session` → `ready-for-human`.
Author
Owner

Closed 2026-10-21 (Ben's ruling in the stale sweep): the engine and design landed (2d938d1b, DDR 0268 / ADR 0269); the Garage cluster Ben runs is the public edge this ticket routed to him, and the free-tier figure and "Turn on" row copy are settled.

Closed 2026-10-21 (Ben's ruling in the stale sweep): the engine and design landed (2d938d1b, DDR 0268 / ADR 0269); the Garage cluster Ben runs is the public edge this ticket routed to him, and the free-tier figure and "Turn on" row copy are settled.
ben 2026-10-21 20:49:06 +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.

Dependencies

No dependencies set.

Reference
Matou/idss#1754
No description provided.