interplane-forge
INTERPLANE Forge
Brought by drakestapleton
interplane-forge / infra / DEPLOY.md
| 1 | # INTERPLANE Forge edge: deploy, verify, roll back |
| 2 | |
| 3 | ## Path |
| 4 | |
| 5 | ``` |
| 6 | client ─TLS─▶ hub :443 stream sni-router (PROXY protocol on) |
| 7 | interplane.io, www.interplane.io ─▶ 127.0.0.1:4448 (NEW: ssl proxy_protocol listener, was 4454 shim → 4444) |
| 8 | www.aienos.com ─▶ 127.0.0.1:4446 (unchanged; gains `location /forge/`, a redirect since 2026-11-10) |
| 9 | nginx http ─▶ hub 127.0.0.1:18480 ─ssh -R (spark tmux forged-tunnel)─▶ spark 127.0.0.1:18480 forged (tmux forged) |
| 10 | ``` |
| 11 | |
| 12 | - interplane.io: static files in `/var/www/interplane.io` win (`try_files $uri $uri/ @forged`); every |
| 13 | other path goes to forged with `X-Forge-Base: /`. `/` stays the static homepage; the forge home is |
| 14 | `/explore` and the profile `/drakestapleton`. |
| 15 | - www.aienos.com: since 2026-11-10 `/forge` and `/forge/…` only redirect to interplane.io (section |
| 16 | "www.aienos.com/forge/ redirect" below); nothing there reaches forged. No other aienos path changes. |
| 17 | Until then: `/forge` → 301 `/forge/`; `/forge/…` went to forged with the prefix stripped and |
| 18 | `X-Forge-Base: /forge/`. |
| 19 | - The edge overwrites X-Forge-Base, Host, X-Real-IP and X-Forwarded-For (the PROXY address) and strips |
| 20 | Authorization. forged's Content-Security-Policy passes through (pages: `script-src 'none'`, |
| 21 | `form-action 'self'`; raw files: `sandbox; default-src 'none'`, security review P2-3). The edge |
| 22 | adds its own policy only when forged sends none, or one that is neither a bare `sandbox` nor has |
| 23 | both `script-src 'none'` and `form-action 'self'`/`'none'`. Browsers enforce both headers then. |
| 24 | The edge's fallback is a sandbox policy on downloads and its page policy elsewhere. |
| 25 | - Limits: `client_max_body_size 64k`; POSTs are limited per IP (zone `forge_post`, 429), GETs are not; |
| 26 | only GET, HEAD and POST are allowed (others 403). |
| 27 | - forged serves one connection at a time, so nginx buffers every forged response and spools what a slow |
| 28 | client has not taken yet to /var/lib/nginx/proxy (`proxy_max_temp_file_size 600m`, `send_timeout 60s`; |
| 29 | security review P2-1). Downloads (`archive/`, `raw/`, `releases/download/`) have a 300 s read |
| 30 | timeout and are capped at 2 concurrent per client and 6 in total (429), which bounds the spool at |
| 31 | 6 × 512 MiB (forged's cap) = 3 GiB of the hub's 6.5 GiB free. |
| 32 | - Port 18091 is not used, proxied or probed anywhere. |
| 33 | |
| 34 | ## Files |
| 35 | |
| 36 | | file | goes to (hub) | |
| 37 | |---|---| |
| 38 | | nginx/conf.d/forge.conf | /etc/nginx/conf.d/forge.conf (upstream, POST limit zone) | |
| 39 | | nginx/snippets/forge-proxy.conf, forge-headers.conf, forge-archive.conf (downloads) | /etc/nginx/snippets/ | |
| 40 | | nginx/snippets/aienos-forge.conf | /etc/nginx/snippets/, included after `aienos-replicate.conf` in sites-enabled/aienos.com | |
| 41 | | nginx/sites-enabled/interplane.io | replaces /etc/nginx/sites-enabled/interplane.io (based on sha256 949a0a38…; apply refuses if the live file differs) | |
| 42 | | stream.d/sni-router.conf | edited in place: `interplane_web` 127.0.0.1:4454 → 127.0.0.1:4448 | |
| 43 | | spark/interplane-forged.service | spark: `~/.config/systemd/user/` (systemd user unit, enabled): runs `forged-service.sh _loop`, the supervisor, from the build in `FORGED_DIR` | |
| 44 | | spark/interplane-forged-tunnel.service | spark: `~/.config/systemd/user/` (enabled): `ssh -R 127.0.0.1:18480:127.0.0.1:18480 hub` | |
| 45 | | spark/forged-service.sh | spark: the supervisor, `taskset -c ${FORGED_CPUS:-4-5} nice -n 10`; start/stop/restart/status act on the unit when it runs this data directory, else tmux `forged` | |
| 46 | | spark/forged-tunnel.sh | spark: start/stop/status act on the tunnel unit when it is loaded, else tmux `forged-tunnel` | |
| 47 | |
| 48 | ## Apply (in this order) |
| 49 | |
| 50 | On spark: |
| 51 | |
| 52 | ``` |
| 53 | cd ~/work/forge/web |
| 54 | # the service units: see "Service (systemd user units)" below |
| 55 | bash infra/spark/forged-service.sh status # names the unit, the supervisor and forged |
| 56 | bash infra/smoke.sh local # forged answers directly |
| 57 | bash infra/spark/forged-tunnel.sh start # starts the tunnel unit; verifies hub 127.0.0.1:18480 is listening |
| 58 | ssh hub 'mkdir -p /tmp/forge-infra' && rsync -a --delete infra/ hub:/tmp/forge-infra/infra/ |
| 59 | ssh hub 'sudo bash /tmp/forge-infra/infra/hub/forge-edge-apply.sh /tmp/forge-infra/infra' |
| 60 | bash infra/smoke.sh # both public URLs |
| 61 | ``` |
| 62 | |
| 63 | `forge-edge-apply.sh` does, and stops at the first failure: |
| 64 | |
| 65 | 1. Preconditions: all files are present; the live interplane.io site file has the pinned sha256; the |
| 66 | router line is exactly `127.0.0.1:4454` once; the aienos-replicate include occurs once and no forge |
| 67 | include or `/forge` location exists; port 4448 is free; hub `curl 127.0.0.1:18480/drakestapleton` |
| 68 | = 200; `nginx -t` passes before any change. |
| 69 | 2. Backup to `/etc/nginx/forge-backups/<UTC>/` (`sites-enabled_interplane.io`, |
| 70 | `sites-enabled_aienos.com`, `stream.d_sni-router.conf`, `NEW_FILES`, `README`). |
| 71 | 3. Install the files, edit the router and the aienos include. |
| 72 | 4. Gate: `nginx -t`. On failure it rolls back automatically and nothing is reloaded. |
| 73 | 5. `systemctl reload nginx` (a reload, never a restart). |
| 74 | 6. Live checks (`hub/forge-edge-checks.sh`) through `--resolve <host>:443:127.0.0.1`: interplane.io |
| 75 | `/`, `/quick-start/`, `/drakestapleton` and a cuda-crack tar.gz = 200, `/rad:<a withdrawn RID>` = 404; |
| 76 | www.aienos.com `/`, `/forge/`, `/forge/drakestapleton` and a cuda-crack zip = 200, |
| 77 | `/forge/rad:<a withdrawn RID>` = 404; hs.aienos.com `/health` = 200. Any failure rolls back automatically. |
| 78 | |
| 79 | ## Update (edge already applied) |
| 80 | |
| 81 | `forge-edge-apply.sh` refuses to run twice. To change the forge-owned files (conf.d/forge.conf, the four |
| 82 | forge snippets, sites-enabled/interplane.io), stage the new tree next to the deployed one and run: |
| 83 | |
| 84 | ``` |
| 85 | ssh hub 'sudo bash /tmp/forge-infra-<tag>/infra/hub/forge-edge-update.sh /tmp/forge-infra-<tag>/infra /tmp/forge-infra/infra' |
| 86 | ``` |
| 87 | |
| 88 | It aborts with nothing changed unless every live file equals the deployed tree, the edge is applied, |
| 89 | forged answers, `nginx -t` passes and at least 6 GiB is free under /var/lib/nginx. It then backs up in |
| 90 | the rollback layout, installs, gates on `nginx -t`, reloads and runs the live checks; any failure runs |
| 91 | `forge-edge-rollback.sh` on its backup. |
| 92 | |
| 93 | ## Roll back |
| 94 | |
| 95 | ``` |
| 96 | ssh hub 'sudo bash /tmp/forge-infra/infra/hub/forge-edge-rollback.sh /etc/nginx/forge-backups/<UTC>' |
| 97 | ``` |
| 98 | |
| 99 | With no argument it uses the newest backup. It restores the three files, deletes the files in |
| 100 | `NEW_FILES`, runs `nginx -t` and reloads, then checks interplane.io, www.aienos.com and hs.aienos.com. |
| 101 | After it: `bash infra/spark/forged-tunnel.sh stop` (forged may keep running; it is bound to loopback). |
| 102 | |
| 103 | Backups on the hub: `20261107T110404Z` is the first apply (rolling back to it removes the whole |
| 104 | forge edge); `20261107T113222Z` is the P2-1 update (rolling back to it restores the first deployed |
| 105 | edge with unbuffered downloads); `20261107T114153Z` is the P2-3 update (rolling back to it restores |
| 106 | the P2-1 edge, which hides forged's CSP, and is what the no-argument form now picks): |
| 107 | |
| 108 | ``` |
| 109 | ssh hub 'sudo bash /tmp/forge-infra-p23/infra/hub/forge-edge-rollback.sh /etc/nginx/forge-backups/20261107T114153Z' |
| 110 | ``` |
| 111 | |
| 112 | Smoke failure policy: `infra/smoke.sh` exits 2 when an existing page (`[site]`) fails, which means roll |
| 113 | back at once; it exits 1 when only forge routes (`[forge]`) fail, which means the forge slices need |
| 114 | fixing and the edge stays. `infra/smoke.sh reach` exits 3 when a public name does not answer the way |
| 115 | an outside visitor needs (DNS, https, certificate days, http to https, check-host.net nodes): the path |
| 116 | needs fixing, nothing to roll back. The Spark front door, its plain-http redirect and the hub sshd |
| 117 | keepalive are documented in `spark/README-edge.md`. |
| 118 | |
| 119 | ## Service (systemd user units, spark) |
| 120 | |
| 121 | Since 2026-11-10 forged and the tunnel are systemd user units (linger is on, so they run without a |
| 122 | login and start at boot). A deploy installs a reviewed build as a directory and points the unit at it: |
| 123 | |
| 124 | ``` |
| 125 | B=~/.local/lib/interplane-forge/<commit> # out/{forged,forged-listen,public-read,forged-seccomp.bpf}, infra/spark/ |
| 126 | mkdir -p ~/.config/systemd/user/interplane-forged.service.d |
| 127 | printf '[Service]\nEnvironment=FORGED_DIR=%s\n' "$B" > ~/.config/systemd/user/interplane-forged.service.d/build.conf |
| 128 | cp infra/spark/interplane-forged.service infra/spark/interplane-forged-tunnel.service ~/.config/systemd/user/ |
| 129 | systemctl --user daemon-reload |
| 130 | systemctl --user enable --now interplane-forged.service interplane-forged-tunnel.service |
| 131 | ``` |
| 132 | |
| 133 | A new build: back up `build.conf`, point it at the new directory, `daemon-reload`, then |
| 134 | `forged-service.sh restart` (one stop and start of the port). Roll back: put the previous |
| 135 | `build.conf` back, `daemon-reload`, restart. The previous build directory stays beside the new one. |
| 136 | `forged-service.sh start|stop|restart|status` and `forged-tunnel.sh start|stop|status` act on the |
| 137 | units. Do not stop the service with a forged-service.sh older than this change: it kills the |
| 138 | supervisor and systemd starts it again. |
| 139 | |
| 140 | Restart policy. forged: the supervisor restarts forged itself and holds the port; systemd restarts |
| 141 | a supervisor that died after 1 s (`RestartSec=1s`, never giving up), and every process of the unit |
| 142 | dies with it first, so the port is free at once. The delay only bounds a start that fails at once |
| 143 | (the port held by another process: one attempt a second). No `RestartSteps`: on systemd 255 its |
| 144 | backoff counts every restart in the unit's life (measured: runs of 3 s still stepped to the |
| 145 | maximum), so after a few deaths over weeks every restart would wait the maximum. Tunnel: 5 s. |
| 146 | |
| 147 | Since the 2026-11-08 front door (`spark/README-edge.md`) the public names reach forged through the |
| 148 | Spark's own nginx; the tunnel only carries the hub's 127.0.0.1:18480 for the Pi's nginx. |
| 149 | |
| 150 | ## Stop order (spark) |
| 151 | |
| 152 | `forged-tunnel.sh stop` (forge paths on the Pi's nginx then answer 502), then `forged-service.sh |
| 153 | stop`. Reload the allow-list without restarting: `forged-service.sh reload` (touches |
| 154 | `~/forge-data/reload`; the supervisor also turns SIGHUP into that flag). |
| 155 | |
| 156 | ## Evidence |
| 157 | |
| 158 | | check | label | result | |
| 159 | |---|---|---| |
| 160 | | `test/edge-local.sh`: the edge config on Mac nginx 1.29.0 with a stand-in forged (P2-1 version: buffered downloads, page during a slow download, per-client 429) | HOST_TESTED | 49 passed, 0 failed; mutants each fail: `buffering` 3 (page stalled 6.02 s / 5.98 s, 3rd download got 200), `base` 3, `csp` 2 | |
| 161 | | the same config with `EDGE_SYNTAX_ONLY=1` on the hub's nginx 1.28.3 (temp dir, removed) | HOST_TESTED | syntax ok | |
| 162 | | `test/hub-rehearsal.sh`: apply/rollback on a copy of hub /etc/nginx in an ubuntu:26.04 container (nginx 1.28.3); since the edge is live, the copy is first rebuilt to its pre-apply state from backup 20261107T110404Z | HOST_TESTED | 17 passed, 0 failed: baseline; N1 broken config auto-rolled back byte-identical; N2 forged down → apply aborted, nothing changed; P1 apply, base and client IP reach forged, statics and headscale unaffected, :4444 leak fixed; N3 re-apply refused; P2 rollback byte-identical to pristine | |
| 163 | | `test/slow-client.sh` (P2-1): real `server/forged` (sha256 27068beb…) and storage behind a copy of hub /etc/nginx in ubuntu:26.04, reference archive omega-mv main.tar.gz 96568781 bytes | HOST_TESTED | 18 passed, 0 failed. A (deployed config, negative control): `/explore` during a 1 KiB/s archive download 200 in 12.03 s (idle 0.016 s). U1 broken config: update refused, auto-rollback, identical; U2 drifted live file: aborted, nothing changed. B (`forge-edge-update.sh`): `/explore` 0.019 s, `/forge/explore` 0.014 s, raw 0.029 s during the slow download; slow client still served; 3rd per-client and 7th site-wide download 429; `/explore` 0.015 s with 6 slow downloads; full downloads byte-identical via both hosts | |
| 164 | | `spark/forged-service.sh` with a bounded stand-in: start, restart after exit, reload flag, SIGHUP, forbidden cores, failed start leaves nothing running, stop | HOST_TESTED | all as expected | |
| 165 | | `smoke.sh local` against the real forged (before slices integrated) | HOST_TESTED | 30 passed; the forge-route failures were unintegrated slices | |
| 166 | | live hub apply 2026-11-07, backup `/etc/nginx/forge-backups/20261107T110404Z` | DEPLOYED | `nginx -t` ok, reload, all 9 live checks ok | |
| 167 | | `smoke.sh` public, both URLs, 2026-11-07 ~11:05Z | DEPLOYED, exercised | 53 passed, 0 site failures, 10 forge failures (tree/commits/blob 501, login 404, star POST 501: slices not yet wired into forged) | |
| 168 | | live hub update (P2-1) 2026-11-07 11:32Z, backup `/etc/nginx/forge-backups/20261107T113222Z`; disk 6.4 G free before and after | DEPLOYED | `nginx -t` ok, reload, 11 live checks ok (incl. both archives) | |
| 169 | | `smoke.sh` public, both URLs, 2026-11-07 ~11:33Z | DEPLOYED, exercised | 63 passed, 0 site failures, 0 forge failures | |
| 170 | | live slow client (Mac, 1 KiB/s) after the update | DEPLOYED, exercised | cuda-crack tar.gz slow: `/explore` 0.029 s, `/forge/explore` 0.025 s, repo page 0.057 s. omega-mv 96 MB slow: first `/explore` 9.36 s (forged busy pushing the 96 MB through the tunnel into the nginx spool), later ones 0.024–0.039 s while the slow client was still open; two slow omega-mv downloads open: a 3rd → 429, `/explore` 0.38 s | |
| 171 | | `test/edge-local.sh` (P2-3 CSP pass-through): stand-in forged sends a page CSP, a raw sandbox CSP, none (`csp=none`) or a weak one (`csp=weak`) | HOST_TESTED | 53 passed, 0 failed: exactly one CSP (forged's) on pages and raw under both bases; none → the edge page policy or, on raw, the edge sandbox; weak → both. Mutants each fail: `csp` (hide again) 6, `cspfallback` (no edge CSP) 5, `buffering` 3, `base` 3 | |
| 172 | | `test/hub-rehearsal.sh` with the P2-3 tree | HOST_TESTED | 17 passed, 0 failed (the update's live checks now include a page CSP check on both hosts) | |
| 173 | | `test/raw-csp.sh` (P2-3): real `server/forged` (sha256 3a97bf67…) and storage behind a copy of hub /etc/nginx in ubuntu:26.04 (nginx 1.28.3); old = the P2-1 tree (hub `/tmp/forge-infra-p21/infra`), new = this tree via `forge-edge-update.sh` | HOST_TESTED | 14 passed, 0 failed. forged direct: raw `sandbox; default-src 'none'; …`. Old (negative control), both hosts: raw rows.txt carries the edge's `default-src 'self'; …` instead. New, both hosts: rows.txt and svg have exactly one CSP, forged's sandbox; svg `Content-Disposition: attachment`; `/drakestapleton` and `/explore` have exactly one CSP with `script-src 'none'` and `form-action 'self'`. The container starts cold, so it warms forged's cache first (forged allows 2 cold builds per 60 s, else 503) | |
| 174 | | `smoke.sh` public before the P2-3 update (negative control) | DEPLOYED, exercised | 67 passed, 2 forge failures: raw CSP was the edge's `default-src 'self'…`, not forged's sandbox | |
| 175 | | live hub update (P2-3) 2026-11-07 11:41Z, backup `/etc/nginx/forge-backups/20261107T114153Z`; disk 6.4 G free | DEPLOYED | `nginx -t` ok, reload, 13 live checks ok | |
| 176 | | `curl -sD-` on omega-mv `raw/main/…/x925/rows.txt` at both URLs; pages and archive zip | DEPLOYED, exercised | raw: exactly one header, `sandbox; default-src 'none'; …; form-action 'none'`; pages and zip: exactly one, forged's `default-src 'none'; … script-src 'none'; form-action 'self'; …` | |
| 177 | | live raw svg (benchmarks-mv `raw/main/assets/chart_multi_model.svg`) at both URLs | DEPLOYED, exercised | exactly one CSP, forged's sandbox; `content-disposition: attachment; filename="chart_multi_model.svg"`; `image/svg+xml`, nosniff. rows.txt (text/plain) is sandboxed but inline: forged sends `attachment` only for the svg | |
| 178 | | `smoke.sh` public after the P2-3 update | DEPLOYED, exercised | 69 passed, 0 site failures, 0 forge failures | |
| 179 | |
| 180 | Residual (forged, not the edge): forged answers one connection at a time, so any archive holds it |
| 181 | for as long as the response takes to cross the tunnel into the hub spool (about 9 s for 96 MB), |
| 182 | whatever the client speed. Small archives (cuda-crack) cross in well under a second. `send_timeout` |
| 183 | 60 s is configured but has no dedicated test (NOT_RUN). |
| 184 | |
| 185 | ## Spark front door (since 2026-11-08) |
| 186 | |
| 187 | The Path above is the hub Pi's front door. Since 2026-11-08 the public :443 goes to the Spark instead; |
| 188 | `infra/spark/README-edge.md` is the full record (shape, switch, undo). In short: |
| 189 | |
| 190 | ``` |
| 191 | client ─TLS─▶ Calix router TCP 443 ─▶ spark nginx 1.24 stream SNI router on 192.168.1.108:443 |
| 192 | www.aienos.com, aienos.com, interplane.io, www.interplane.io ─▶ the Pi's nginx config, copied whole |
| 193 | hs.aienos.com ─▶ raw TCP passthrough to the Pi 192.168.1.192:443 (Headscale keeps its own TLS) |
| 194 | nginx http ─▶ spark 127.0.0.1:18480 forged (no ssh -R tunnel on this path) |
| 195 | /rad/ ─▶ 127.0.0.1:8780 ─ssh -L (user unit edge-rad-tunnel.service)─▶ the Pi's radicle-httpd |
| 196 | ``` |
| 197 | |
| 198 | - Parts on the Spark: nginx with libnginx-mod-stream (config copies in `infra/spark/nginx/`); user |
| 199 | units `edge-mirror.timer` (site folders pulled from the Pi every 5 minutes), `edge-certs.timer` |
| 200 | (certificates copied daily from the Pi, nginx reloaded only on a change) and `edge-rad-tunnel.service`; |
| 201 | one firewall rule in `/etc/atlas/ingress.nft` (`iifname "enP7s7" ip daddr 192.168.1.108 tcp dport 443 accept`). |
| 202 | - Verified before the router change (2026-11-08, from the LAN with `curl --resolve`): 32 paths answered |
| 203 | the same on the Spark and the Pi (status, body sha256, security headers); hs.aienos.com /health 200; |
| 204 | an unknown name refused; a Radicle `git clone` through the Spark gave the same head as through the Pi. |
| 205 | - Router switch: reported done on the BOARD (2026-11-08T12:39Z, night-fable: "Drake moved the router 443 |
| 206 | forward to 192.168.1.108", an outside fetch landed in the Spark's access log). Not re-checked for this |
| 207 | section: the Calix rule itself was not inspected. |
| 208 | - Not done: the publishers still write to the Pi (the Spark mirrors them), and radicle-httpd does not |
| 209 | run on the Spark, so `/rad/` and the copied certificates still depend on the Pi. Headscale stays on the Pi. |
| 210 | - Undo: point the router's TCP 443 back to 192.168.1.192 (README-edge.md "Undo"). The forged |
| 211 | binary rule and log below are unchanged by this path. |
| 212 | |
| 213 | ## www.aienos.com/forge/ redirect (one-site, 2026-11-10) |
| 214 | |
| 215 | Drake, 2026-11-10: one Interplane. `nginx/snippets/aienos-forge.conf` no longer proxies to forged; it |
| 216 | answers every `/forge` address with a permanent redirect to the same page on interplane.io: |
| 217 | |
| 218 | | request | answer | |
| 219 | |---|---| |
| 220 | | `/forge`, `/forge/` (and either with `?q`) | `https://interplane.io/explore[?q]`: forged's home under `/forge/` was the explore list, and `/` on interplane.io is the static site | |
| 221 | | `/forge/<path>[?q]` | `https://interplane.io/<path>[?q]`: every forged route (profiles, repos, tree/blob/raw, archive and release downloads, explore, search, stars, login, `rad:<RID>`) | |
| 222 | | GET, HEAD | 301 | |
| 223 | | any other method (POST, PUT, ...) | 308, so a POST stays a POST | |
| 224 | |
| 225 | `<path>` is copied from `$request_uri` through a named capture, so the client's percent-encoding is |
| 226 | kept as sent (a numbered capture would escape `%20` again to `%2520`) and nothing nginx decoded can |
| 227 | reach `Location`. The redirect carries the site's headers (HSTS with includeSubDomains, nosniff, |
| 228 | X-Frame-Options DENY, Referrer-Policy strict-origin-when-cross-origin, CSP `frame-ancestors 'none'`). |
| 229 | `conf.d/forge.conf`, the other forge snippets and `sites-enabled/interplane.io` are unchanged. |
| 230 | `/rad/` (the read-only Radicle clones) stays on www.aienos.com. |
| 231 | |
| 232 | Before the change (Spark `/var/log/nginx/aienos.access.log.1`, 2026-11-08T11:48Z to 11-10T06:00Z, and |
| 233 | `aienos.access.log` to 11-10T22:33Z): 3,873,088 `/forge` requests, all but 402 from crawlers (user |
| 234 | agent matching bot, crawl, spider, slurp or GoogleOther). Git over `/forge/`: 6 requests (`info/refs`, |
| 235 | answered 404 or 301; forged never served git, clones use `/rad/`). Archive downloads: 6,035 (2,798 |
| 236 | answered 200); 10 of them from curl (curl/8.5.0 and curl/8.7.1, the paths the smoke and cutover checks |
| 237 | use, such as `no-such-branch.zip`; that they were those checks is an inference), none from wget, git or |
| 238 | another tool. Release downloads: 0. The hub's logs from before the Spark front door hold 356 `/forge` |
| 239 | lines (2026-11-07 to 11-08, not broken down). So no client is known to fetch git or archives through |
| 240 | `/forge/`; one that does now gets a 301 it must follow (curl needs `-L`). |
| 241 | |
| 242 | Apply (after the READY has VERDICT MERGE and is landed on main; post a 10-minute notice on the BOARD |
| 243 | to one-interplane and ForgeDeployTake first; nginx is reloaded, never restarted, and forged is not |
| 244 | touched): |
| 245 | |
| 246 | Spark (the public front door; its nginx config is a copy, see "Spark front door"): |
| 247 | |
| 248 | ``` |
| 249 | cd <clone at the landed commit> |
| 250 | TS=$(date -u +%Y%m%dT%H%M%SZ)-forge-redirect; BK=/etc/nginx/forge-backups/$TS |
| 251 | sudo mkdir -p $BK && sudo cp -a /etc/nginx/snippets/aienos-forge.conf $BK/ \ |
| 252 | && sudo install -m 0644 infra/nginx/snippets/aienos-forge.conf /etc/nginx/snippets/aienos-forge.conf \ |
| 253 | && sudo nginx -t && sudo systemctl reload nginx \ |
| 254 | || { sudo cp -a $BK/aienos-forge.conf /etc/nginx/snippets/aienos-forge.conf; sudo nginx -t; echo "NOT APPLIED, restored"; } |
| 255 | bash infra/smoke.sh # exit 2 = an aienos or interplane.io page failed: roll back at once |
| 256 | ``` |
| 257 | |
| 258 | Roll back (Spark): `sudo cp -a /etc/nginx/forge-backups/<TS>-forge-redirect/aienos-forge.conf |
| 259 | /etc/nginx/snippets/aienos-forge.conf && sudo nginx -t && sudo systemctl reload nginx`. |
| 260 | |
| 261 | Hub (the Pi; serves only if the router goes back to .192): the "Update" route above, with the deployed |
| 262 | tree `/tmp/forge-infra-p23/infra` (every live forge file equals it, checked 2026-11-10T22:4xZ): |
| 263 | |
| 264 | ``` |
| 265 | ssh hub 'mkdir -p /tmp/forge-infra-redirect' && rsync -a --delete infra/ hub:/tmp/forge-infra-redirect/infra/ |
| 266 | ssh hub 'sudo bash /tmp/forge-infra-redirect/infra/hub/forge-edge-update.sh /tmp/forge-infra-redirect/infra /tmp/forge-infra-p23/infra' |
| 267 | ``` |
| 268 | |
| 269 | It prints the backup and the rollback line (`forge-edge-rollback.sh /etc/nginx/forge-backups/<UTC>`). |
| 270 | Its live checks (`hub/forge-edge-checks.sh`) now expect the redirects. It refuses with nothing changed |
| 271 | while the hub has less than 6 GiB free under /var/lib/nginx: on 2026-11-10T22:45Z it had 5,155,868 KiB |
| 272 | (4.9 GiB), so the hub update waits until someone frees space there. |
| 273 | |
| 274 | Evidence: |
| 275 | |
| 276 | | check | label | result | |
| 277 | |---|---|---| |
| 278 | | `test/edge-local.sh` in ubuntu:26.04 (nginx 1.28.3, curl 8.18.0), run as a non-root user, stand-in forged | HOST_TESTED | base b55b3389: 53 passed, 0 failed. This change: 85 passed, 0 failed. Mutants each fail: `method` (POST gets 301) 3, `query` (query dropped) 5, `headers` (no security headers) 20, `base` 1, `buffering` 2, `csp` 3, `cspfallback` 3 | |
| 279 | | first draft with a numbered capture (`$1`) | HOST_TESTED, rejected | `%20` came back as `%2520` and `%0d%0a` as `%250d%250a`: fixed with the named capture | |
| 280 | | `test/forge-redirect.sh`: `hub/forge-edge-update.sh` with this tree over a copy of hub /etc/nginx (sha256 b3f2cbc37d7765db) in ubuntu:26.04, old tree hub `/tmp/forge-infra-p23/infra`, the real forged (sha256 858eb9d1…, the b55b3389 build) on the real storage | HOST_TESTED | 33 passed, 0 failed: the hub copy equals the old tree; negative control (old edge) `/forge/drakestapleton` 200; UPDATE OK with its live checks; only aienos-forge.conf changed; 14 redirect rows (301 for GET and HEAD, 308 for POST, query and `%20` kept); the 308 carries all five headers; www.aienos.com/ and 7 interplane.io answers (pages, archive, css) byte-identical before and after; `forge-edge-rollback.sh` restores every file and `/forge/drakestapleton` 200. Two earlier runs differed only in forged's counts line on the repo page, which reads `/var/log/nginx/aienos.access.log` and changes from "not measured" once that log has a line; the test now writes one line before capturing | |
| 281 | | the Spark config itself (sudo tar of the Spark's /etc/nginx, certs replaced) on ubuntu:24.04 nginx 1.24.0 with this snippet, router moved to 127.0.0.1:443 (bay 5 F2) | HOST_TESTED | 13 passed, 0 failed: `nginx -t` before and after; 9 redirect rows incl. POST 308 and `%20`; HSTS on the 301; www.aienos.com/ unchanged (`~/handoffs/hive/one-site/ready/spark-config-probe-522b29a.log`) | |
| 282 | | Spark apply 2026-11-11T00:07:52Z of main 522b29ab (bay 5 VERDICT MERGE, landed 23:56:50Z, BOARD notice 23:57:27Z), backup `/etc/nginx/forge-backups/20261111T000752Z-forge-redirect/` (old file sha256 53b2c76d…, new 20c3c76e…) | DEPLOYED | `nginx -t` ok, `systemctl reload nginx`. Live from the Mac (00:08Z): `/forge/`, `/forge`, `/forge/explore`, `/forge/search?q=omega`, `/forge/drakestapleton/CUDApp`, `/forge/drakestapleton/hop/releases`, `/forge/login` each 301 to the matching interplane.io address with HSTS, and each target 200; POST `/forge/login` 308 to https://interplane.io/login. www.aienos.com/ (sha256 feb4243b…), /zh-CN/ (a304cf70…) and `/rad/<RID>.git/info/refs` for aienos.com (e933cb4a…) and interplane-forge (5a1b5830…) byte-identical before (00:07:38Z) and after. Spark sites-enabled/interplane.io (cbcd2a89…), forge-proxy/headers/archive unchanged. `smoke.sh` public: 62 passed, 0 site failures, 2 forge failures (Accept: application/json answered text/html on interplane.io, present before the apply; one-interplane's page cache) | |
| 283 | | hub `forge-edge-update.sh /tmp/forge-infra-redirect/infra /tmp/forge-infra-p23/infra`, 2026-11-11T00:09Z | NOT_RUN (refused) | "UPDATE ABORTED (nothing changed): only 5146244 KiB free under /var/lib/nginx, need 6291456 KiB". The hub keeps the proxy; it serves only if the router goes back to .192. Rerun the same command once 6 GiB are free there | |
| 284 | |
| 285 | Roll back (Spark), as applied: `sudo cp -a /etc/nginx/forge-backups/20261111T000752Z-forge-redirect/aienos-forge.conf /etc/nginx/snippets/aienos-forge.conf && sudo nginx -t && sudo systemctl reload nginx`. |
| 286 | A rollback does not reach browsers that cached the 301 (bay 5 F1). |
| 287 | |
| 288 | ## forged binary: deploy rule and log (spark) |
| 289 | |
| 290 | Rule (correctness review forge-web-13102b54, P1): the live binary is always built from a commit, never from the working tree. |
| 291 | |
| 292 | 1. Commit the change on `main`. |
| 293 | 2. `./run.sh deploy [commit]` (default HEAD): `git worktree add --detach` into a temp dir, refuse if that checkout is dirty, compile with the pinned omc (sha256 checked), install `server/forged` atomically, remove the worktree, append `<UTC> <commit> <binary sha256>` below. |
| 294 | 3. `pkill -x forged`; the supervisor (`spark/forged-service.sh`) restarts it. Check `sha256sum /proc/$(pgrep -x forged)/exe` equals the logged sha. Since 2026-11-10 the live service runs a build directory under `~/.local/lib/interplane-forge/` through the systemd unit (see "Service"); a deploy there installs the build, edits `build.conf` and restarts the unit. |
| 295 | 4. Commit this file and put the same line on the BOARD. |
| 296 | |
| 297 | `./run.sh build` / `restart` refuse to install the live path `server/forged` while `git status --porcelain` is non-empty; trial builds use `FORGED_OUT=/tmp/x.try`. |
| 298 | |
| 299 | Host dependencies in the production path (outside the seeded Omega build): |
| 300 | |
| 301 | | binary | exact version | what it does for forged | Omega replacement plan | |
| 302 | |---|---|---|---| |
| 303 | | `/usr/bin/git` | git 2.43.0 (Ubuntu deb 1:2.43.0-1ubuntu7.3) | every repository read: refs, trees, blobs, log, blame, archive, grep (argv exec, allow-listed storage only) | an Omega object-store reader (loose + pack objects with zlib inflate, ref and namespace walk) in seed, then tree/log/blame/archive on top; git stays as the read-only verification oracle | |
| 304 | | `/usr/bin/ssh-keygen` | OpenSSH_9.6p1 Ubuntu-3ubuntu13.19 (deb 1:9.6p1-3ubuntu13.19) | `-Y verify` of the Radicle-key sign-in signature (SSHSIG, Ed25519) | Ed25519 verify in Omega (omega-mv f4df8239 has sha2.om and x25519.om under om/tls but no Ed25519; add edwards25519 point ops + SHA-512 and the SSHSIG framing), ssh-keygen then kept only as a test oracle | |
| 305 | |
| 306 | Log (`<UTC> <commit> <binary sha256>`): |
| 307 | |
| 308 | - 2026-11-07 historical, NOT compliant: binary ebfb5abd… was built from 86ba7e2 (pre-review) |
| 309 | - 2026-11-07 historical, NOT compliant: binary 27068beb… was built from a dirty working tree on top of 687e03a |
| 310 | - 2026-11-07T11:35Z b058226d85d02cad390daee83c8cf798af378f47 44a93793705610949d66b719faebde1dfb1d8684a553ae9e468efa742806dc31 |
| 311 | - 2026-11-07T11:37Z 200bfc15ee2505996360fdc20232c5a9cf66b912 e8d33e19541e54b87cb1c8a6c7c5375f58e4ca80e741e1a14b6d134907f7fa8d |
| 312 | - 2026-11-07T11:42Z adb25e0aab946062526b1ed7fee355079096e29b 3a97bf672d73e3182555712d528eaa68431cd2769466aca61ddfbe7d0a26dc08 |
| 313 | - 2026-11-09T04:48Z a42737923e6bde52a98765d0556391faafba9cc1 c55fa3b3decfcc5684949f51237ae279d6394c3ca208987d721439f4b68e01a9 |
| 314 | - 2026-11-09T09:31Z 49347e4f860af6a1d33c82a240f24bd20b9cafb0 4398687442ec831d8aec634b5c262f70cfb2c3010800640bcdeb64cbfe9e9f35 nodes-snap 5c14bcbdd7551848d2097661cb6fe760fd69926f55f7a1b6ac48c183a10f39fd |
| 315 | - 2026-11-09T23:20Z 5129fbffe206ea6cfa23f97b62b032e92ae5b293 60764fc51a0704c1c661b8a97c1a45260b5106d513b3b77af59becc5ff510e28 nodes-snap 5c14bcbdd7551848d2097661cb6fe760fd69926f55f7a1b6ac48c183a10f39fd |
| 316 | - 2026-11-09T23:23Z 408091d10949998bcab55e0d039c15fad079a473 b072f54fcd9b0a8d6ac9b77c20289d63bfe434c9db6ed6dabe5ab048331ab59b nodes-snap 5c14bcbdd7551848d2097661cb6fe760fd69926f55f7a1b6ac48c183a10f39fd |
| 317 | - 2026-11-18 historical, NOT compliant: binary 3b1027001737fa69b725bbfca164fdbc644cf74f8520d64bb8365b1176d2b57b (store-reading build, build folder store-93a9faf19775, site c6c3d3b3d2a846bb60c67b224e18d22e408fa2be) was live from 2026-11-18 to 2026-11-22 from source that was in no repository. e2d7a25 re-creates that source: built alone on 539217d with the same site commit it gives the same bytes. |
| 318 | - 2026-11-22T18:34Z e8ae0f2ce0e12ca87b06a1be46e8cbf5d9012aac a0ddd6dfae54c558160a3ee0bc01458339b1c810b52d3145e24a66e1a7bab1e2 store-reading build (FORGE_STORE, FORGE_CLONE_BASE=https://interplane.io/) public-read a1a1ffb98605b88bc1bf2be1b710ce9347c1f2bc961b51bdd9c2b58a60b3bc5f forged-listen 6bb35bbde7561015a05dbb852411e27d73b4ead17ac7a8bb32dbd503f82a4ae5 forged-seccomp.bpf 3cb9ff770e1507c680e12c5b0f47599753cec7594960556e09c41ebdeb85d2d0 site 4d5a52b7478e9e83f0763263d836af631dfc4380; build folder store-e8ae0f2ce0e1; previous build folder store-93a9faf19775 kept for rollback (build.conf.bak-20261122T183416Z) |