The Nix cache's setup steps pointed at a home-lab proxy that no longer exists #316

Merged
enricobuehler merged 1 commits from worktree-nix-binary-cache into main 2026-08-18 21:32:55 +00:00
Owner

Follow-up to #313. That PR's bring-up instructions were copied from packaging/flatpak/README.md, which still describes an edge proxy on home-reverse-proxy-1 forwarding to 192.168.50.50. That topology is gone, so anyone following those steps would have configured a proxy that isn't there.

packaging/winget/server/compose.production.yml — the newest of the three service definitions, and the only one written since the move — says so outright:

the sibling docs/flatpak compose files still carry stale comments about a home-reverse-proxy-1 and 192.168.50.50 from an earlier home-lab topology. The public hostnames resolve straight to the hcloud box and are served by Caddy there — no local proxy is involved.

Confirmed independently: flatpak.unom.io resolves to 167.233.145.172, which is unom-1 itself.

What changes

The steps now match how docs and winget were actually stood up:

  • DNS in the unom.io Cloudflare zone, DNS-only, straight at the hcloud box.
  • The vhost in unom/infra caddy/Caddyfile, proxying to localhost:3250 — not 192.168.50.50, and not hand-edited on the box. ~/caddy/Caddyfile there looks like the config but is an rsynced copy with no .git to warn you; a vhost added only on the box lasts until the next deploy. That's how the winget source vanished on 2026-07-26, so it's called out here too.
  • caddy_target_ports + terraform is dropped. It was the home-lab firewall allowlist; winget's setup, written post-move, has no such step.
  • Adds winget's hard-won SNI diagnostic: Caddy 308s every Host on :80 to https, including names it has never heard of, so probing port 80 proves nothing — check the certificate by SNI.

scripts/setup-nix-cache.sh

An interactive walkthrough of the five steps (built from the /wizard template). It opens each page, says exactly what to click, and verifies each stage before moving on — the failure signatures are easy to confuse: a TLS handshake failure means the vhost is missing, a 502 means the container is down, and a 404 means the cache is healthy and empty.

It also closes a loop #313 left open. It generates the signing key locally (a local nix, or the nixos/nix image) and writes the public half straight into the two docs that carried a <fill-in> placeholder — nobody waits an hour for the first publish to print a value we can derive up front. The secret half is shown once for pasting into Gitea and never touches disk. Re-running detects an installed key and refuses to silently replace it, since that would invalidate every signature already published.

Verified

  • shellcheck clean, bash -n clean, 5 stage calls against TOTAL_STAGES=5.
  • MEASURED with the real image: nix key generate-secret produces the name:base64 line, and convert-secret-to-public round-trips it.
  • The doc substitution tested against a real generated key — public keys are base64 and contain /, so the sed uses | as its delimiter.
  • Caddyfile and compose still validate after the comment corrections.

Not touched: the stale comments in the flatpak and docs compose files themselves. The winget note already records the drift, and rewriting those is a separate cleanup.

Follow-up to #313. That PR's bring-up instructions were copied from `packaging/flatpak/README.md`, which still describes an edge proxy on `home-reverse-proxy-1` forwarding to `192.168.50.50`. **That topology is gone**, so anyone following those steps would have configured a proxy that isn't there. `packaging/winget/server/compose.production.yml` — the newest of the three service definitions, and the only one written since the move — says so outright: > the sibling docs/flatpak compose files still carry stale comments about a `home-reverse-proxy-1` and 192.168.50.50 from an earlier home-lab topology. The public hostnames resolve straight to the hcloud box and are served by Caddy there — no local proxy is involved. Confirmed independently: `flatpak.unom.io` resolves to `167.233.145.172`, which is unom-1 itself. ## What changes The steps now match how `docs` and `winget` were actually stood up: - **DNS** in the `unom.io` Cloudflare zone, DNS-only, straight at the hcloud box. - **The vhost in `unom/infra` `caddy/Caddyfile`**, proxying to `localhost:3250` — not `192.168.50.50`, and *not* hand-edited on the box. `~/caddy/Caddyfile` there looks like the config but is an rsynced copy with no `.git` to warn you; a vhost added only on the box lasts until the next deploy. That's how the winget source vanished on 2026-07-26, so it's called out here too. - **`caddy_target_ports` + terraform is dropped.** It was the home-lab firewall allowlist; winget's setup, written post-move, has no such step. - Adds winget's hard-won SNI diagnostic: Caddy 308s every Host on `:80` to https, including names it has never heard of, so probing port 80 proves nothing — check the certificate by SNI. ## `scripts/setup-nix-cache.sh` An interactive walkthrough of the five steps (built from the `/wizard` template). It opens each page, says exactly what to click, and **verifies each stage before moving on** — the failure signatures are easy to confuse: a TLS handshake failure means the vhost is missing, a 502 means the container is down, and a 404 means the cache is healthy and empty. It also closes a loop #313 left open. It generates the signing key locally (a local `nix`, or the `nixos/nix` image) and writes the **public** half straight into the two docs that carried a `<fill-in>` placeholder — nobody waits an hour for the first publish to print a value we can derive up front. The secret half is shown once for pasting into Gitea and never touches disk. Re-running detects an installed key and refuses to silently replace it, since that would invalidate every signature already published. ## Verified - `shellcheck` clean, `bash -n` clean, 5 `stage` calls against `TOTAL_STAGES=5`. - **MEASURED** with the real image: `nix key generate-secret` produces the `name:base64` line, and `convert-secret-to-public` round-trips it. - The doc substitution tested against a real generated key — public keys are base64 and contain `/`, so the sed uses `|` as its delimiter. - Caddyfile and compose still validate after the comment corrections. Not touched: the stale comments in the flatpak and docs compose files themselves. The winget note already records the drift, and rewriting those is a separate cleanup.
enricobuehler added 1 commit 2026-08-18 21:27:02 +00:00
fix(nix): the cache's setup steps described a topology that no longer exists
ci / rust-arm64 (pull_request) Successful in 2m3s
ci / web (pull_request) Successful in 1m1s
ci / bun-nix (pull_request) Successful in 22s
ci / docs-site (pull_request) Successful in 2m16s
ci / rust (pull_request) Successful in 7m17s
nix / flake (pull_request) Failing after 19m10s
7c411f7ef4
The bring-up instructions were copied from packaging/flatpak/README.md, which
still describes an edge proxy on `home-reverse-proxy-1` forwarding to
192.168.50.50. That home-lab topology is gone. packaging/winget/server/
compose.production.yml — the newest of the three and the only one written since
the move — says so outright: "the sibling docs/flatpak compose files still carry
stale comments … the public hostnames resolve straight to the hcloud box and are
served by Caddy there — no local proxy is involved." flatpak.unom.io resolves to
167.233.145.172, which is unom-1 itself, confirming it.

So the steps now match how docs and winget were actually stood up:

  * DNS in the unom.io Cloudflare zone, DNS-only, straight at the hcloud box.
  * The vhost in unom/infra `caddy/Caddyfile`, proxying to localhost:3250 —
    NOT 192.168.50.50, and NOT hand-edited on the box. ~/caddy/Caddyfile there
    looks like the config but is an rsynced copy with no .git to warn you; a
    vhost added only on the box lasts until the next deploy. That is how the
    winget source vanished on 2026-07-26, and it is now called out here too.
  * `caddy_target_ports` + terraform is dropped. It was the home-lab firewall
    allowlist; winget's setup, written post-move, has no such step.

Also adds the SNI diagnostic winget's README hard-won: Caddy 308s every Host on
:80 to https, including names it has never heard of, so probing port 80 proves
nothing — check the certificate by SNI instead.

scripts/setup-nix-cache.sh walks the five steps interactively (built from the
/wizard template): it opens each page, says exactly what to click, and verifies
each stage before moving on, because the failure signatures are easy to confuse
— a TLS handshake failure means the vhost is missing, a 502 means the container
is down, and a 404 means the cache is healthy and empty.

It also closes the loop the first version left open: it generates the signing
key locally (a local nix, or the nixos/nix image — MEASURED: both produce the
`name:base64` line, and convert-secret-to-public round-trips), then writes the
PUBLIC half straight into the two docs that carried a `<fill-in>` placeholder.
Nobody has to wait an hour for the first publish to print a value we can derive
up front. The secret half is shown once for pasting into Gitea and never
touches disk. Re-running detects an installed key and refuses to silently
replace it, since that would invalidate every signature already published.

Verified: shellcheck clean, `bash -n` clean, 5 stages against TOTAL_STAGES=5,
and the doc substitution tested against a real generated key — public keys are
base64 and contain `/`, so the sed uses `|` as its delimiter.
enricobuehler merged commit c4cf53c1fc into main 2026-08-18 21:32:55 +00:00
enricobuehler deleted branch worktree-nix-binary-cache 2026-08-18 21:32:57 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unom/punktfunk#316