From e74dd17d0eaadd1e745de36e4d967f226ec42ff8 Mon Sep 17 00:00:00 2001 From: goober Date: Fri, 21 Aug 2026 15:47:57 +0300 Subject: [PATCH] chore: remove private deployment details --- package.json | 3 +-- tools/deploy.sh | 19 ++++++++----------- vite.config.ts | 3 +-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 424a3f9..a7b3aa0 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,7 @@ "test": "vitest run", "test:watch": "vitest", "typecheck": "tsc -b --noEmit", - "check:guides": "node --experimental-strip-types tools/check-guides.ts", - "deploy": "sh tools/deploy.sh" + "check:guides": "node --experimental-strip-types tools/check-guides.ts" }, "dependencies": { "idb": "8.0.3", diff --git a/tools/deploy.sh b/tools/deploy.sh index 973a14a..3cb60e9 100755 --- a/tools/deploy.sh +++ b/tools/deploy.sh @@ -1,14 +1,11 @@ #!/usr/bin/env sh -# Build and publish to [removed]. -# -# The homelab has no rsync, so the tree goes over as a tar stream. Caddy serves -# /mnt/docker/appdata/caddy/sites/[removed] as /srv/[removed] (a -# read-only bind mount declared in /mnt/docker/compose/caddy/docker-compose.yml), -# so a deploy is a file copy - no container restart, no config reload. +# Build and publish to a user-supplied static host. set -eu -HOST="${DEPLOY_HOST:-hl}" -DEST="${DEPLOY_DEST:-/mnt/docker/appdata/caddy/sites/[removed]}" +: "${DEPLOY_HOST:?set DEPLOY_HOST}" +: "${DEPLOY_DEST:?set DEPLOY_DEST}" +HOST="$DEPLOY_HOST" +DEST="$DEPLOY_DEST" ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" @@ -20,6 +17,6 @@ npm run build:single # served forever, since /assets/* is cached as immutable. tar -C dist -cz . | ssh "$HOST" "rm -rf '$DEST'/* && tar -C '$DEST' -xz" -printf '\ndeployed. checking...\n' -curl -fsS -o /dev/null -w '[removed] -> %{http_code}\n' [removed] -curl -fsS -o /dev/null -w '[removed] -> %{http_code} (%{size_download} bytes)\n' [removed] +if [ -n "${DEPLOY_URL:-}" ]; then + curl -fsS -o /dev/null -w '%{http_code}\n' "$DEPLOY_URL" +fi diff --git a/vite.config.ts b/vite.config.ts index 9077373..303947a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,8 +1,7 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; -// `base: './'` keeps the build working unchanged at [removed], under a -// plain `python3 -m http.server -d dist`, and inside the single-file build. +// Relative assets keep the build portable across static hosts, local HTTP, and the single-file build. export default defineConfig({ base: "./", plugins: [react()],