Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-forge/blob/main/infra/spark/README-edge.md # interplane-forge INTERPLANE Forge Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `interplane-forge / infra / spark / README-edge.md` 156 lines · 10962 bytes Raw Blame History Source # Spark front door (2026-11-08) Drake, 2026-11-08: "I still want you to setup the front door". The Spark (LAN 192.168.1.108) serves www.aienos.com, aienos.com, interplane.io and the forge in place of the hub Pi, whose root filesystem is a USB flash stick (sdb, "USB 3.2.1 FD") with IO pressure at 92% (full avg10, measured 2026-11-08). ## Shape - nginx 1.24.0-2ubuntu7.19 (Ubuntu apt, plus libnginx-mod-stream) on the Spark. It is a host dependency in the production path: TLS, HTTP and the SNI router. A future Omega replacement is forged growing a TLS front end built on vetted crypto, not hand-rolled math. Until then, nginx stays. - The config is the hub Pi's of the same day (`nginx -T` evidence), copied whole. Differences: - The SNI router listens on `192.168.1.108:443` only. The tailnet :443 belongs to vaultwarden and `*:80` to apache. - `hs.aienos.com` passes raw to the Pi (`192.168.1.192:443`), so Headscale keeps its own TLS and ACME. Headscale now sees the Spark as the client address. - `http2 on;` became `listen ... http2`, because nginx 1.24 predates `http2 on`. The Pi runs 1.28.3. - Copies of the edited files are in `spark/nginx/`. Certificates are not in git. - Upstreams are unchanged and already local to the Spark: - forged at 127.0.0.1:18480 - the allen gateway at 100.64.0.2:18110 - agora at 100.64.0.2:18132 - `/rad/` git clone uses the Pi's radicle-httpd, reached at 127.0.0.1:8780 through the user unit `edge-rad-tunnel.service` (`ssh -N -L 8780:127.0.0.1:8780 hub`). - Site folders `/var/www/{aienos.com,aienos-code,aienos-hive,aienos-stats,interplane.io,replicate,si}` are pulled from the Pi. - `edge-mirror.sh` runs every 5 minutes from `edge-mirror.timer`. - The publishers still write to the Pi. - Certificates renew on the Pi (acme.sh with Gandi DNS, so renewal works wherever :443 points). `edge-certs.sh` copies them daily from `edge-certs.timer` and reloads nginx only on a change. - Firewall: one rule in `/etc/atlas/ingress.nft` and live: `iifname "enP7s7" ip daddr 192.168.1.108 tcp dport 443 accept`. The backup is `ingress.nft.bak-edge-20261108T114750Z`. - Stats: `~/handoffs/forge/stats/collect.sh` also reads the Spark's `/var/log/nginx/aienos-dl.log*`. ## Verified before the router change (2026-11-08, from the LAN with curl --resolve) - 32 paths answered the same on the Spark and the Pi: status, body sha256 and security headers. - main site, .md files, install, si, replicate, agent-prompt - hive live.json and board - stats, code page, code zip, code git refs, Radicle git refs - forge, allen presence and infer-info, agora hello - interplane.io pages, www.interplane.io, the apex redirect - hs.aienos.com /health answered 200. - An unknown name was refused (TLS reset, as on the Pi). - `git clone` of a Radicle repo through the Spark gave the same head as through the Pi. ## Switch (Drake, on the Calix router at https://192.168.1.1 ) - Reserve 192.168.1.108 for the Spark (MAC 4c:bb:47:2b:b8:7b). Its address comes from DHCP today. - Change the port-forward rule for TCP 443 from 192.168.1.192 to 192.168.1.108. Leave every other rule alone. ## Undo - On the router, point TCP 443 back to 192.168.1.192. This alone restores the old front door. - Optional, on the Spark: - `sudo systemctl disable --now nginx` - `systemctl --user disable --now edge-mirror.timer edge-certs.timer edge-rad-tunnel.service` - Restore `/etc/atlas/ingress.nft` from the backup above, then reload the firewall: `sudo systemctl restart atlas-ingress`. Check that service's ExecStart first. - The Spark's original nginx config is in `/etc/nginx.dist-20261108T114650Z`. ## Plain http (port 80), 2026-11-09 (forge-iplreach, L1008 QW1) Found: `http://interplane.io/` (and every other name on plain http) timed out for outside visitors. https answered. Evidence, 2026-11-09 00:0xZ to 00:33Z: - check-host.net: http 0 of 48 node answers for the four names, https 47 of 48. Control sites (example.com, wikipedia.org) lose 1 to 2 of 20 nodes on https, so the https misses are checker noise. - An outside fetch tool got no content for `http://interplane.io/` and the full page for `https://`. This is how "interplane.io timed out" can come from a tool while curl to https gives 200. - Packet captures on the Spark's and the Pi's LAN ports during an outside http check: 0 SYNs for port 80 on either. The router does not forward TCP 80 at all. - From inside the house, `http:///` is answered by the router's own web server (`Server: micro_httpd`, a script redirect to https). That is why it looked fine from the LAN. Fix, in two parts: - Spark (this repo, reviewed before deploy). - `spark/nginx/sites-http-redirect` answers 301 to `https://` for the four names. It closes the connection (444) for any other name, as :443 refuses unknown TLS names. - It listens on `192.168.1.108:4480`. A prerouting rule in the atlas firewall (chain `http80_redirect`) moves public TCP 80 there. - apache2 keeps `*:80` (Ubuntu default page). The firewall keeps that apache unreachable from the network, and no process I did not start is restarted. - Apply: `sudo bash infra/spark/edge-http-apply.sh infra` (backs up `/etc/atlas/ingress.nft`, then checks from the Pi). If the nginx reload itself fails, apply rolls back. If that rollback's reload also fails, it says so instead of claiming nginx was reloaded. Undo: `sudo bash infra/spark/edge-http-rollback.sh`, which uses the newest `/etc/nginx/forge-backups/http80-*`. - Checks: `bash infra/spark/edge-http-checks.sh`. Rehearsal: `sudo bash infra/test/http80-netns.sh `, which runs in throwaway network and mount namespaces. - Router (Drake, Calix at https://192.168.1.1 ). Add a port-forward rule: TCP 80 to 192.168.1.108, the same machine as the TCP 443 rule. Leave every other rule alone. Undo: delete that rule. `bash infra/smoke.sh reach` checks the whole path for each name and exits 3 if any part fails: - DNS from 1.1.1.1 and 8.8.8.8; - https and certificate days, from the Pi; - http to https, from the Pi; - outside nodes on check-host.net. - A name that is not a DNS name, or a REACH_ADDR that is not four dotted octets 0..255, is refused before dig, ssh or curl run. The certificate check passes the address and name as arguments. check-host.net is a read-only outside checker (verification oracle). Nothing depends on it in production. Smoke from the Spark itself: its requests to its own public address lose packets at the router. Measured: 4 of 40 timed out at 15 s, and TLS stalled up to 10 s. Requests from the Mac and the Pi lost 0 of 40 and 0 of 20. Real outside connections retransmit 0.12% of bytes, against 3.7% on the Spark's own turnaround connections. So `smoke.sh reach` runs its curls on the Pi. ## Dead ssh sessions hold forwarded ports (aien-floor-edge restarts), 2026-11-09 The hub stalled at about 13:48 CST on 2026-11-08 ("Timeout, server hub not responding" at 13:49:06). After that, `aien-floor-edge` (`ssh -R 127.0.0.1:4748:… hub`) failed 1296 times with "remote port forwarding failed for listen port 4748", from 13:52:49 to 15:59:43. It held again at 15:59:48. The hub's sshd runs with `ClientAliveInterval 0`. A session whose client vanished therefore keeps its forwarded port until TCP keepalive gives up: 7200 s + 9 × 75 s = 7875 s. The observed hold was 7842 s from the client's own timeout, inside the 7830 to 7875 s window. forged-tunnel (18480) and rad-hub-tunnel (18776) use the same `-R` shape and the same hub sshd. Fix: `hub/sshd-forward-keepalive.conf` sets `ClientAliveInterval 15` and `ClientAliveCountMax 4`, so a dead session is dropped after about 75 s (sshd drops it at the 5th unanswered ask; measured 75 s on 2026-11-09T03:35Z). - Apply on the hub: `sudo bash /hub/sshd-keepalive-apply.sh ` (`sshd -t`, reload, `sshd -T` must be 15/4). A failed reload removes the drop-in. If `sshd -T` is not 15/4 after the reload, the drop-in is removed and ssh is reloaded back. - Undo: `hub/sshd-keepalive-rollback.sh`. - Rehearsal: `sudo bash infra/test/sshd-keepalive.sh `. With the front door on the Spark, `www.aienos.com/now/` is served from the Spark's own 127.0.0.1:4748. The tunnel only matters if the router goes back to the Pi. The unit belongs to the factory floor lane (`~/workspace/aien-factory/edge/`); its file is not changed here. ### Evidence (forge-iplreach, 2026-11-09) check label result `test/http80-netns.sh` (copy of the live firewall in a throwaway netns) HOST_TESTED 21 passed, 0 failed (2026-11-09T03:31Z). N1: http times out (rc 28). Apply: 8 of 8 checks. M1 mutant caught. N2 re-apply refused. Rollback: firewall file byte-identical, :80 times out again. N3: a reload command that always fails rolls back and does not claim success. N4: a reload that fails once rolls back, and that rollback's reload succeeds `test/netns-refuse.sh` HOST_TESTED 10 passed, 0 failed. A second run refuses and leaves the first run's namespaces and sleep processes alone. A missing scratch directory exits 2 before any trap `test/sshd-keepalive.sh` (Spark OpenSSH in a netns; dead client = black-holed flow + SIGKILL) HOST_TESTED 6 passed, 0 failed. A (no drop-in): 4748 still held after 100 s. B (drop-in): 4748 freed 75 s after the client died, client 2 gets the forward `test/sshd-keepalive-scripts.sh` (ubuntu:26.04, OpenSSH_10.2p1 Ubuntu-2ubuntu3.8) HOST_TESTED 11 passed, 0 failed: apply 0/3 to 15/4, re-apply refused, rollback restores 0/3 and 10 files byte-identical, broken drop-in removed, failed reload removes the drop-in, a drop-in sshd does not read is removed and ssh is reloaded back `test/reach-reject.sh` EXERCISED 10 passed, 0 failed. A quote, a space, a short address, octet 999 and a five-part address are refused before dig, ssh or curl. A quoted name does not create a file. A real IPv4 is passed as an argument `smoke.sh reach interplane-dead.invalid` with REACH_OUTSIDE=0 EXERCISED rc 3, 0 passed, 4 failed (empty DNS, no address) check-host.net for interplane.io, 2026-11-09T03:28Z EXERCISED http: 0 of 12 nodes answered (11 timed out, 1 did not report). https: 11 nodes HTTP 200, 1 did not report live apply on the Spark and the hub, router TCP 80 rule NOT_RUN waits for a bay MERGE on this head, then Drake's router rule ## Next (not done) - Point the publishers at the Spark directly, then retire `edge-mirror`: - aienos.com deploy - interplane.io `sync-to-hub.sh` (HUB/WEBDIR) - codepage `publish.sh` - `hive-publish` (`HIVE_EDGE_HOST`) - stats `collect.sh` (STATS_HUB/STATS_DEST) - Run radicle-httpd, or my own equivalent, on the Spark so `/rad/` stops depending on the Pi. - Headscale stays on the Pi. If the Spark is down, hs.aienos.com is unreachable from outside too.