chore(scripts): archive film demos, fold join.sh into connect.sh
CI / rust client (hh) (macos-latest) (push) Waiting to run
CI / rust client (hh) (ubuntu-latest) (push) Waiting to run
CI / rust coverage (push) Waiting to run
CI / python server (3.10) (push) Waiting to run
CI / python server (3.11) (push) Waiting to run
CI / python server (3.12) (push) Waiting to run
CI / headless e2e smoke (push) Waiting to run
CI / dependency audit (push) Waiting to run
CI / secret scanning (push) Waiting to run

Trim newcomer-facing clutter in hh/scripts/ without changing the running
product or CI.

- Move the one-off demo-recording scripts (film-save-load.sh,
  film-virtualbox.sh) to scripts/archive/ — they depend on external
  personal tooling (asciinema, video-toolkit, edge-tts, xdotool) and were
  never wired into the README or CI.
- Delete join.sh: it duplicated connect.sh's join with fewer options
  (hardcoded port, plaintext-only). Its only unique behaviour — a
  pre-join git pull (gitea→origin, ff-only) + rebuild — is now an opt-in
  `--sync` flag on connect.sh, leaving one canonical joiner.

No scripts or docs referenced the removed/moved files, so nothing else
needed updating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
leetcrypt
2026-06-07 13:12:46 -07:00
parent 37d5916b2e
commit cab266588d
4 changed files with 20 additions and 36 deletions
+20 -1
View File
@@ -13,11 +13,12 @@
# so it is briefly visible in the process list (ps) to other *local* users for # so it is briefly visible in the process list (ps) to other *local* users for
# the lifetime of the session. Nothing is ever written to disk. # the lifetime of the session. Nothing is ever written to disk.
# #
# Usage: ./connect.sh [NAME] [HOST] [-p PASSWORD] [-P PORT] [--tls] [--insecure] [--no-build] # Usage: ./connect.sh [NAME] [HOST] [-p PASSWORD] [-P PORT] [--tls] [--insecure] [--sync] [--no-build]
# NAME display handle; omit to be prompted for one on join # NAME display handle; omit to be prompted for one on join
# HOST server IP/host (default: 127.0.0.1) # HOST server IP/host (default: 127.0.0.1)
# -P port (default: 4173, or $HH_PORT) # -P port (default: 4173, or $HH_PORT)
# --tls use wss/https instead of the default plaintext-over-Tailscale # --tls use wss/https instead of the default plaintext-over-Tailscale
# --sync git-pull the latest code (gitea then origin, ff-only) before building
# --no-build run the prebuilt binary as-is (skip the fresh debug rebuild) # --no-build run the prebuilt binary as-is (skip the fresh debug rebuild)
set -euo pipefail set -euo pipefail
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
@@ -31,6 +32,7 @@ PORT="${HH_PORT:-$DEFAULT_PORT}"
PASSWORD="${HH_PASSWORD:-}" PASSWORD="${HH_PASSWORD:-}"
NO_TLS=1 # rooms run --no-tls over Tailscale/LAN by default NO_TLS=1 # rooms run --no-tls over Tailscale/LAN by default
INSECURE=0 INSECURE=0
SYNC=0 # opt-in: pull latest code before building (handy for demos/dev)
NO_BUILD=0 # rebuild a fresh debug binary first so the UI is never stale NO_BUILD=0 # rebuild a fresh debug binary first so the UI is never stale
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@@ -39,6 +41,7 @@ while [[ $# -gt 0 ]]; do
-P|--port) PORT="$2"; shift 2 ;; -P|--port) PORT="$2"; shift 2 ;;
--tls) NO_TLS=0; shift ;; --tls) NO_TLS=0; shift ;;
--insecure) INSECURE=1; shift ;; --insecure) INSECURE=1; shift ;;
--sync) SYNC=1; shift ;;
--no-build) NO_BUILD=1; shift ;; --no-build) NO_BUILD=1; shift ;;
-h|--help) sed -n '2,/^set /{/^set /d;s/^# \{0,1\}//;p}' "$0"; exit 0 ;; -h|--help) sed -n '2,/^set /{/^set /d;s/^# \{0,1\}//;p}' "$0"; exit 0 ;;
-*) echo "✖ unknown option: $1" >&2; exit 2 ;; -*) echo "✖ unknown option: $1" >&2; exit 2 ;;
@@ -59,6 +62,22 @@ if [[ -z "$PASSWORD" ]]; then
fi fi
[[ -n "$PASSWORD" ]] || { echo "✖ a password is required" >&2; exit 1; } [[ -n "$PASSWORD" ]] || { echo "✖ a password is required" >&2; exit 1; }
# --sync: pull the latest code before building so a fresh join runs current
# source. Pulls are best-effort and fast-forward only — an unreachable remote or
# diverged history just warns and is skipped, never blocking the join. Each pull
# is capped (timeout) and GIT_TERMINAL_PROMPT=0 stops it hanging on credentials.
if [[ "$SYNC" -eq 1 ]]; then
BRANCH="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo HEAD)"
TO=""; command -v timeout >/dev/null 2>&1 && TO="timeout 10"
for remote in gitea origin; do
if git remote get-url "$remote" >/dev/null 2>&1; then
echo "⛧ syncing $BRANCH from $remote" >&2
GIT_TERMINAL_PROMPT=0 $TO git pull --ff-only "$remote" "$BRANCH" 2>&1 \
|| echo " (skipped — couldn't fast-forward from $remote/$BRANCH)" >&2
fi
done
fi
# Build a fresh debug binary so the UI always matches the current source — an # Build a fresh debug binary so the UI always matches the current source — an
# incremental build is ~instant when nothing changed. --no-build skips this and # incremental build is ~instant when nothing changed. --no-build skips this and
# runs a prebuilt binary as-is (handy for remote joiners without a toolchain), # runs a prebuilt binary as-is (handy for remote joiners without a toolchain),
-35
View File
@@ -1,35 +0,0 @@
#!/usr/bin/env bash
# Join the live hack-house room. Usage: ./join.sh <yourname> [host]
# local: ./join.sh alice
# remote: ./join.sh alice 100.117.177.50
# The room password (a shared secret) comes from $HH_PASSWORD, else a no-echo
# prompt — never hardcoded, so it can't drift from the room's random password.
NAME="${1:-guest}"
HOST="${2:-127.0.0.1}"
cd "$(dirname "$0")/.."
# Sync the latest code before joining, then rebuild so it takes effect. Pulls
# are best-effort and fast-forward only: an unreachable remote or diverged
# history just warns and is skipped — it never blocks you from joining.
BRANCH="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo HEAD)"
# Cap each pull so an unreachable/slow remote fails fast instead of hanging on
# the OS TCP timeout; GIT_TERMINAL_PROMPT=0 stops it blocking on a credential
# prompt. (No `timeout` on this box? fall back to a plain pull.)
TO=""; command -v timeout >/dev/null 2>&1 && TO="timeout 10"
for remote in gitea origin; do
if git remote get-url "$remote" >/dev/null 2>&1; then
echo "⛧ syncing $BRANCH from $remote"
GIT_TERMINAL_PROMPT=0 $TO git pull --ff-only "$remote" "$BRANCH" 2>&1 \
|| echo " (skipped — couldn't fast-forward from $remote/$BRANCH)"
fi
done
echo "⛧ building client…"
cargo build --quiet 2>&1 || echo "✖ build failed — joining with the existing binary"
PASSWORD="${HH_PASSWORD:-}"
if [[ -z "$PASSWORD" ]]; then
read -rsp "⛧ room password: " PASSWORD < /dev/tty
echo
fi
[[ -n "$PASSWORD" ]] || { echo "✖ a password is required" >&2; exit 1; }
exec ./target/debug/hack-house connect "$HOST" 4173 "$NAME" --password "$PASSWORD" --no-tls