interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

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

Verified before the router change (2026-11-08, from the LAN with curl --resolve)

Switch (Drake, on the Calix router at https://192.168.1.1)

  1. Reserve 192.168.1.108 for the Spark (MAC 4c:bb:47:2b:b8:7b). Its address comes from DHCP today.
  2. Change the port-forward rule for TCP 443 from 192.168.1.192 to 192.168.1.108. Leave every other rule alone.

Undo

  1. On the router, point TCP 443 back to 192.168.1.192. This alone restores the old front door.
  2. 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:

Fix, in two parts:

  1. Spark (this repo, reviewed before deploy).
    • spark/nginx/sites-http-redirect answers 301 to https://<same name><same path> 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 <scratch>, which runs in throwaway network and mount namespaces.
  2. 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:

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).

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)

checklabelresult
test/http80-netns.sh (copy of the live firewall in a throwaway netns)HOST_TESTED21 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.shHOST_TESTED10 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_TESTED6 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_TESTED11 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.shEXERCISED10 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=0EXERCISEDrc 3, 0 passed, 4 failed (empty DNS, no address)
check-host.net for interplane.io, 2026-11-09T03:28ZEXERCISEDhttp: 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 ruleNOT_RUNwaits for a bay MERGE on this head, then Drake's router rule

Next (not done)