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/server/tests/favicon.sh
# 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 / server / tests / favicon.sh`
121 lines ยท 7182 bytes Raw Blame History
1 #!/usr/bin/env bash
2 # Site icon: every forge HTML page names assets/favicon.svg, and forged serves it.
3 # Finding BOARD 2026-11-10T15:08:43Z: pages had no icon link, so browsers asked /favicon.ico (404 and
4 # a console error). Entirely private: own port, own storage fixture, no radicle-node, never 18480.
5 # bash server/tests/favicon.sh (spark; FORGED_CPUS default 4,5; FORGE_ICON_PORT default 18562)
6 # Negative control: FORGE_ICON_BASE (default `8f6b4a29`, the head before the fix) built the same way
7 # must NOT name the icon and must answer 404 for assets/favicon.svg.
8 set -euo pipefail
9 cd "$(dirname "$0")/../.."
10 OMC=$HOME/work/flux/omega-mv/seed/out/omc
11 PIN=`3ad9f10f64309e7acf8a725082b28e23a2a4aeb07e98322fb4dc0fcd8fc93194`
12 PORT=${FORGE_ICON_PORT:-18562}
13 BASEREV=${FORGE_ICON_BASE:-`8f6b4a29f261665f83df81fbebf9b4955b85df5f`}
14 case "$PORT" in 185[5-9][0-9]) ;; *) echo 'REFUSED: use a private port in 18550..18599'; exit 2;; esac
15 [ "$(sha256sum "$OMC" | cut -d' ' -f1)" = "$PIN" ] || { echo 'FAIL compiler pin'; exit 1; }
16 if ss -ltnH "sport = :$PORT" | grep -q .; then echo "NOT_RUN: private port $PORT busy"; exit 3; fi
17 T=$(mktemp -d)
18 pid=
19 pass=0
20 ok() { pass=$((pass+1)); echo "PASS $*"; }
21 die() { echo "FAIL $*"; exit 1; }
22 cleanup() {
23 if [ -n "$pid" ]; then kill "$pid" 2>/dev/null || true; wait "$pid" 2>/dev/null || true; fi
24 git worktree remove --force "$T/basewt" 2>/dev/null || true
25 if [ "${KEEP_TEST_TMP:-0}" = 1 ]; then echo "Evidence: $T"; else rm -rf "$T"; fi
26 }
27 trap cleanup EXIT
28 run() { taskset -c "${FORGED_CPUS:-4,5}" nice -n 10 "$@"; }
29 RID=z631r2JJiVT8it4tST7RK24hpowi
30 mkdir -p "$T/repo" "$T/storage" "$T/data/logs" "$T/ng" "$T/bin"
31 cp server/tests/fake/rad server/tests/fake/getent "$T/bin/"
32 chmod 755 "$T/bin/rad" "$T/bin/getent"
33 : > "$T/ng/dl.log"; : > "$T/ng/access.log"
34 printf 'icon fixture\n' > "$T/repo/README.md"
35 git -C "$T/repo" init -q -b main
36 git -C "$T/repo" add .
37 git -C "$T/repo" -c user.name=Fixture -c user.email=fixture@example.invalid commit -qm 'icon fixture'
38 git clone -q --bare "$T/repo" "$T/storage/$RID"
39 printf '| repo | RID | default branch |\n|---|---|---|\n| iconfixture | rad:%s | main |\n' "$RID" > "$T/RIDS.md"
40
41 # build SRCDIR NAME: compose SRCDIR's units with every live target moved into $T, compile to $T/NAME.bin
42 build() {
43 local src=$1 name=$2
44 ( cd "$src" && { printf 'om2\n'; for u in $(./run.sh units); do cat "$u"; done; } ) > "$T/$name.base.om"
45 sed -e "s|`2130706433` 18480|`2130706433` $PORT|" \
46 -e "s|/home/drakestapleton/handoffs/radicle/RIDS.md|$T/RIDS.md|g" \
47 -e "s|/home/drakestapleton/.radicle/storage/|$T/storage/|g" \
48 -e "s|/home/drakestapleton/forge-data/|$T/data/|g" \
49 -e "s|^text tfzp0 \".*\"|text tfzp0 \"$T/ng/dl.log\"|" \
50 -e "s|^text tfzp1 \".*\"|text tfzp1 \"$T/ng/access.log\"|" \
51 -e "s|^text tfzwal \".*\"|text tfzwal \"$T/ng/wal\"|" \
52 -e "s|^text tfzrad \".*\"|text tfzrad \"$T/bin/rad\"|" \
53 -e "s|^text tfzspth \".*\"|text tfzspth \"$T/counts.snapshot\"|" \
54 -e "s|^text tfzgent \".*\"|text tfzgent \"$T/bin/getent\"|" "$T/$name.base.om" > "$T/$name.om"
55 for marker in "`2130706433` $PORT" "$T/RIDS.md" "$T/storage/" "$T/data/"; do grep -qF "$marker" "$T/$name.om"; done
56 if grep -qE '`2130706433` 18480|/home/drakestapleton/(forge-data|\.radicle|handoffs/radicle)' "$T/$name.om"; then
57 die "live target remains in $name"
58 fi
59 run "$OMC" < "$T/$name.om" > "$T/$name.bin" 2> "$T/$name.err" || { cat "$T/$name.err"; die "compile $name"; }
60 chmod 755 "$T/$name.bin"
61 }
62 start() {
63 FORGE_SOCIAL_DIR="$T/data/" taskset -c "${FORGED_CPUS:-4,5}" nice -n 10 "$T/$1.bin" > "$T/$1.log" 2>&1 &
64 pid=$!
65 for _ in $(seq 50); do
66 kill -0 "$pid" 2>/dev/null || die "$1 server exited during startup"
67 curl --max-time 1 -fsS -o /dev/null "http://127.0.0.1:$PORT/explore" && return 0
68 sleep 0.1
69 done
70 die "$1 server not ready"
71 }
72 stop() { kill "$pid" 2>/dev/null || true; wait "$pid" 2>/dev/null || true; pid=; }
73 # get PATH BASE [curl args]: status on stdout; body $T/body, headers $T/hdr
74 get() {
75 local p=$1 b=$2; shift 2
76 curl --max-time 10 -sS -o "$T/body" -D "$T/hdr" -H "X-Forge-Base: $b" "$@" "http://127.0.0.1:$PORT/$p" -w '%{http_code}'
77 }
78 hdr() { grep -i "^$1:" "$T/hdr" | head -1 | tr -d '\r' | cut -d' ' -f2-; }
79 WANT_SVG=''
80
81 build . new
82 start new
83 for base in / /forge/; do
84 link=""
85 for page in explore drakestapleton/iconfixture search?q=icon login no-such-page-xyz; do
86 code=$(get "$page" "$base")
87 case "$page" in no-such-page-xyz) [ "$code" = 404 ] || die "$base$page HTTP $code, expected 404";;
88 *) [ "$code" = 200 ] || die "$base$page HTTP $code";; esac
89 [ "$(grep -cF "$link" "$T/body")" = 1 ] || die "$base$page: icon link missing or repeated"
90 grep -qF "${base}assets/forge.css\">