interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / infra / hub / forge-edge-checks.sh

30 lines · 2279 bytes Raw Blame History
1#!/usr/bin/env bash
2# Live checks of the forge edge on the hub, through the real :443 router (--resolve to 127.0.0.1).
3# Used by forge-edge-apply.sh and forge-edge-update.sh; exit 1 if any check fails.
4set -u
5fail=0
6chk() { local want=$1 host=$2 path=$3 got
7 got=$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 --resolve "$host:443:127.0.0.1" "https://$host$path")
8 if [ "$got" = "$want" ]; then echo "ok $want https://$host$path"; else echo "FAIL https://$host$path = $got (want $want)"; fail=1; fi; }
9# every CSP on a forge page keeps scripts off (forged's own, or the edge's added on top)
10cspchk() { local host=$1 path=$2 got
11 got=$(curl -s -D - -o /dev/null --max-time 15 --resolve "$host:443:127.0.0.1" "https://$host$path" | tr -d '\r' | sed -n 's/^[Cc]ontent-[Ss]ecurity-[Pp]olicy: //p')
12 case "$got" in *"script-src 'none'"*|"sandbox;"*) echo "ok CSP https://$host$path";; *) echo "FAIL CSP https://$host$path: '$got'"; fail=1;; esac; }
13# www.aienos.com/forge/ redirects to interplane.io (one-site, 2026-11-10): status, Location and HSTS
14redir() { local want=$1 path=$2 to=$3 m=${4:-GET} got
15 got=$(curl -s -o /dev/null -D - -X "$m" --max-time 15 --resolve "www.aienos.com:443:127.0.0.1" "https://www.aienos.com$path" | tr -d '\r' \
16 | awk 'NR == 1 { c = $2 } tolower($1) == "location:" { l = $2 } tolower($1) == "strict-transport-security:" { h = 1 } END { print c, l, (h ? "hsts" : "no-hsts") }')
17 if [ "$got" = "$want $to hsts" ]; then echo "ok $m $want https://www.aienos.com$path -> $to"; else echo "FAIL $m https://www.aienos.com$path = '$got' (want '$want $to hsts')"; fail=1; fi; }
18chk 200 interplane.io /
19chk 200 interplane.io /quick-start/
20chk 200 interplane.io /drakestapleton
21chk 200 interplane.io /drakestapleton/cuda-crack/archive/refs/heads/main.tar.gz
22chk 404 interplane.io /rad:z2ft64NFLsKzWttCXw6NWNbRQLggQ
23chk 200 www.aienos.com /
24redir 301 /forge/ https://interplane.io/explore
25redir 301 /forge https://interplane.io/explore
26redir 301 '/forge/drakestapleton/cuda-crack/archive/refs/heads/main.zip?x=1' 'https://interplane.io/drakestapleton/cuda-crack/archive/refs/heads/main.zip?x=1'
27redir 308 /forge/login https://interplane.io/login POST
28cspchk interplane.io /drakestapleton
29chk 200 hs.aienos.com /health
30exit $fail