From 3baf943a534a32be9ba85d46b69742ba85b48057 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Tue, 12 May 2026 20:35:43 -0700 Subject: [PATCH] Switch from git clone to archive-based install --- install/install.sh | 53 +++++++++++++++++++++------------------ scripts/remote-install.sh | 8 +----- src/server/proxy.ts | 1 - 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/install/install.sh b/install/install.sh index 17f2291..11e72c1 100755 --- a/install/install.sh +++ b/install/install.sh @@ -8,7 +8,7 @@ set -euo pipefail # Installs or updates toes on a Raspberry Pi. # Must be run as the 'toes' user with passwordless sudo. -REPO="https://git.nose.space/defunkt/toes" +ARCHIVE="https://git.nose.space/defunkt/toes/archive/main.tar.gz" DEST=~/toes APPS_DIR=~/apps DATA_DIR=~/data @@ -59,16 +59,11 @@ sudo ln -sf "$BUN" /usr/local/bin/bun sudo setcap 'cap_net_bind_service=+ep' "$BUN" -# ── Clone or pull ──────────────────────────────────────── +# ── Download ───────────────────────────────────────────── -if [ -d "$DEST/.git" ]; then - info "Pulling latest toes" - git -C "$DEST" fetch origin main - git -C "$DEST" reset --hard origin/main -else - info "Cloning toes" - git clone "$REPO" "$DEST" -fi +info "Downloading toes" +mkdir -p "$DEST" +curl -fsSL "$ARCHIVE" | tar xz --strip-components=1 -C "$DEST" # ── Directories ────────────────────────────────────────── @@ -91,25 +86,33 @@ REPOS_DIR="$DATA_DIR/repos" mkdir -p "$REPOS_DIR" info "Installing bundled apps" +pids=() for app_dir in "$DEST"/apps/*/; do app=$(basename "$app_dir") [ -f "$app_dir/package.json" ] || continue echo " $app" - cp -a "$app_dir" "$APPS_DIR/$app" - quiet bun install --frozen-lockfile --cwd "$APPS_DIR/$app" || quiet bun install --cwd "$APPS_DIR/$app" + ( + cp -a "$app_dir" "$APPS_DIR/$app" + quiet bun install --frozen-lockfile --cwd "$APPS_DIR/$app" || quiet bun install --cwd "$APPS_DIR/$app" - # Seed bare repo for git-based versioning - bare="$REPOS_DIR/$app.git" - quiet git -C "$APPS_DIR/$app" init -b main - quiet git -C "$APPS_DIR/$app" add -A - quiet git -C "$APPS_DIR/$app" -c user.name=toes -c user.email=toes@localhost commit -m "install" - if [ -d "$bare" ]; then - quiet git -C "$APPS_DIR/$app" push --force "$bare" main - else - quiet git clone --bare "$APPS_DIR/$app" "$bare" - quiet git -C "$bare" config http.receivepack true - fi - rm -rf "$APPS_DIR/$app/.git" + # Seed bare repo for git-based versioning + bare="$REPOS_DIR/$app.git" + quiet git -C "$APPS_DIR/$app" init -b main + quiet git -C "$APPS_DIR/$app" add -A + quiet git -C "$APPS_DIR/$app" -c user.name=toes -c user.email=toes@localhost commit -m "install" + if [ -d "$bare" ]; then + quiet git -C "$APPS_DIR/$app" push --force "$bare" main + else + quiet git clone --bare "$APPS_DIR/$app" "$bare" + quiet git -C "$bare" config http.receivepack true + fi + rm -rf "$APPS_DIR/$app/.git" + ) & + pids+=("$!") +done + +for pid in "${pids[@]}"; do + wait "$pid" || fail "A bundled app failed to install." done # ── CLI + SSH ──────────────────────────────────────────── @@ -134,7 +137,7 @@ sudo systemctl restart toes # ── Done ───────────────────────────────────────────────── -VERSION=$(git describe --tags --always 2>/dev/null || echo "unknown") +VERSION=$(grep '"version"' "$DEST/package.json" | head -1 | sed 's/.*"version": *"\(.*\)".*/\1/') echo "" echo " ${b}${g}🐾 toes $VERSION is up!${r}" diff --git a/scripts/remote-install.sh b/scripts/remote-install.sh index 5e766a6..8dc7f1a 100755 --- a/scripts/remote-install.sh +++ b/scripts/remote-install.sh @@ -11,11 +11,5 @@ source "$ROOT_DIR/scripts/config.sh" # Run remote install on the target ssh "$SSH_HOST" bash <<'SCRIPT' set -e -DEST="${DEST:-$HOME/toes}" -if [ -d "$DEST/.git" ]; then - cd "$DEST" && git pull -else - git clone https://git.nose.space/defunkt/toes "$DEST" && cd "$DEST" -fi -./scripts/install.sh +curl -fsSL https://toes.dev/install | sh SCRIPT diff --git a/src/server/proxy.ts b/src/server/proxy.ts index 83c3468..d2342be 100644 --- a/src/server/proxy.ts +++ b/src/server/proxy.ts @@ -63,7 +63,6 @@ export async function proxySubdomain(subdomain: string, req: Request): Promise