Files
wadamesh/scripts/deploy-webclient.sh
Kaj SchittecatandClaude Opus 5.5 d2ec668535 site: the web client (app.wadamesh.com), its page, and a third hero button
- webclient.html: what the web client is, how to connect (USB, Bluetooth,
  Wi-Fi), where it works (desktop, Android, iPhone), the https / http split
  for Wi-Fi, where data lives, what only a device can do, and a FAQ, with
  screenshots of the real client.
- index: "Use the web client" next to Install and Join the community, a Web
  client button on the side rail and a resource card; sitemap.
- deploy/nginx/app.wadamesh.com.conf: the vhost (COOP/COEP/CORP, versioned
  bundles cached, same-origin /tiles/ and /fw/apps/ handed to the tiles and
  firmware vhosts over loopback). scripts/deploy-webclient.sh publishes
  web/dist (and web/dist-nothreads to nt/).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 15:09:22 +02:00

38 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Publish the WADAMESH web client to app.wadamesh.com.
# web/dist/ (pthreads build, https) -> <root>/
# web/dist-nothreads/ (no-threads build, http) -> <root>/nt/ (when built)
# Nginx vhost: deploy/nginx/app.wadamesh.com.conf (installed separately, once).
#
# Usage:
# WADAMESH_VPS=user@your-vps scripts/deploy-webclient.sh # build + deploy
# WADAMESH_VPS=user@your-vps scripts/deploy-webclient.sh --dry-run # preview only
# WADAMESH_WEB_NOBUILD=1 ... # deploy what is built
#
# The VPS target comes from the environment; never commit it.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
DEST="${WADAMESH_VPS:?set WADAMESH_VPS=user@host}"
DEST_PATH="${WADAMESH_APP_PATH:-/srv/wadamesh/app}"
DRY=""
[ "${1:-}" = "--dry-run" ] && DRY="--dry-run"
if [ -z "${WADAMESH_WEB_NOBUILD:-}" ]; then
"$ROOT/web/build.sh" web
[ -x "$ROOT/web/build.sh" ] && grep -q "web-nothreads" "$ROOT/web/build.sh" && "$ROOT/web/build.sh" web-nothreads || true
fi
[ -f "$ROOT/web/dist/index.html" ] || { echo "no web/dist: build first (web/build.sh web)" >&2; exit 1; }
# The threaded build owns the root; the no-threads build lives in nt/ next to it, so
# --delete on the root must leave nt/ alone (it is synced on its own below).
rsync -avz $DRY --delete --exclude 'nt/' "$ROOT/web/dist/" "$DEST:$DEST_PATH/"
if [ -d "$ROOT/web/dist-nothreads" ]; then
rsync -avz $DRY --delete "$ROOT/web/dist-nothreads/" "$DEST:$DEST_PATH/nt/"
fi
if [ -z "$DRY" ]; then
echo
echo "deployed web/dist -> $DEST:$DEST_PATH"
echo "note: index.html is no-cache; bundles are versioned (?v=<hash>), so no purge is needed."
fi