Skip to content

0030: The store comes from a signed companion repo

Status: Accepted (owner, 2026-11-24). Proposed (2026-11-17, owner picked "PRs reviewed and merged, CI builds, Couchdogs pulls", approved moving the existing apps there, "keep it private for now")

Context

Today every app's recipe and Dockerfile live in this repo and the runner builds the image on the host (ADR 0020). An install takes minutes of the host's CPU, the household's other services share that box, and adding an app means a Couchdogs release. Options: keep building on the host; pull prebuilt images from a registry the Couchdogs repo publishes; a separate store repo whose CI builds and signs the images and an index. Plex and Steam may not allow their images to be published.

Decision

Apps move to a private repo couchdogs-store (apps/<id>/recipe.yaml, apps/<id>/image/, icon). It carries a pinned copy of our base folder and recipe parser (vendor/, origin commit in BASE_REF), so CI builds on the same base and checks recipes with the same rules plus policy: no privileged, Docker socket, host network or host PID, and every security entry needs a why: line. On a merge to main, CI builds each app, pushes it as ghcr.io/<owner>/couchdogs-app-<id> and signs it with a cosign key pair (private key in a repo secret; not keyless, which writes the private repo's name into the public Rekor log). It then pushes a signed OCI artifact couchdogs-store-index holding index.json (serial, apps, recipes, image digests, source hashes, sizes), the icons, and the build folders of apps marked redistribute: false (Plex, Steam), which the runner still builds on the host.

The runner fetches the index, verifies it with cosign against stack/runner/store.pub (shipped in this repo), refuses an index with a lower serial than the last one it accepted, and keeps the last good index in DATA_DIR/runner/store/. An install pulls by digest through the Engine API (X-Registry-Auth, no docker login), verifies the image's signature, and tags it couchdogs-<id>:local. Any failed check refuses the install ("Store signature check failed"); there is no unverified fallback. The read-only token (read:packages) lives in DATA_DIR/runner/store-token (600), set by ./couchdogs store-token, never logged or returned by an API. The details card lists what the app can use, read from the recipe.

Consequences

Installs become pulls; adding an app is a reviewed PR, not a Couchdogs release. Couchdogs keeps no app recipes: without a token or a reachable registry the store shows the last good index, or is empty on a fresh install while the repo is private. Supersedes ADR 0020's "a registry stays open" line; its builder stays for redistribute: false apps. Going public means keyless signing and no token, same code otherwise.

Amended 2026-11-28: the store and its packages are public, so the token is optional. Without one the runner fetches the index and pulls images anonymously, with the same cosign check; STORE_INDEX defaults to the official index. A registry that refuses an anonymous fetch (a fork's private store) is Store needs a token, and ./couchdogs store-token is only for that case. Signing stays on the key pair: keyless was not needed to go public.