interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / infra / test / forge-redirect.sh

26 lines · 1792 bytes Raw Blame History
1#!/usr/bin/env bash
2# www.aienos.com/forge/ redirect (one-site, 2026-11-10): rehearse hub/forge-edge-update.sh with this
3# tree over a COPY of the hub's /etc/nginx, in a throwaway ubuntu:26.04 container, with the REAL forged
4# binary and the real (read-only) Radicle storage behind it. Old: the deployed edge tree (default
5# hub:/tmp/forge-infra-p23/infra, which every live forge file equals). Checks: old /forge/ proxies
6# (negative control), the update applies with its own live checks, the redirect matrix, interplane.io
7# answers byte-identical before and after, and forge-edge-rollback.sh restores the old files.
8# Reads the hub; changes nothing there.
9# Run on spark: taskset -c 2 nice -n 10 bash infra/test/forge-redirect.sh
10set -u
11INFRA=$(cd "$(dirname "$0")/.." && pwd)
12FORGED=${FORGED_BIN:-$INFRA/../server/forged}
13OLD=${OLD_TREE:-/tmp/forge-infra-p23/infra}
14H=/home/drakestapleton
15[ -x "$FORGED" ] || { echo "no forged binary at $FORGED (set FORGED_BIN)"; exit 2; }
16W=$(mktemp -d /tmp/forge-redirect.XXXXXX)
17trap 'rm -rf "$W"' EXIT
18ssh -o BatchMode=yes hub 'sudo -n tar -C /etc -cf - --exclude=nginx/certs --exclude=nginx/sitehub-backups --exclude=nginx/forge-backups nginx' > "$W/etc-nginx.tar" \
19 || { echo "could not read hub /etc/nginx"; exit 2; }
20rsync -a "hub:$OLD/" "$W/old/" || { echo "could not read hub $OLD"; exit 2; }
21echo "hub /etc/nginx copy: sha256 $(sha256sum < "$W/etc-nginx.tar" | cut -c1-16); old tree hub:$OLD; forged sha256 $(sha256sum < "$FORGED" | cut -c1-16)"
22docker run --rm --cpuset-cpus "${REDIRECT_CPUS:-2}" \
23 -v "$INFRA:/infra:ro" -v "$W:/w:ro" -v "$FORGED:/forged:ro" \
24 -v "$H/.radicle/storage:$H/.radicle/storage:ro" \
25 -v "$H/handoffs/radicle/RIDS.md:$H/handoffs/radicle/RIDS.md:ro" \
26 ubuntu:26.04 bash /infra/test/forge-redirect-inner.sh