Updates
Rolling release / release (push) Successful in 4m2s
CI / verify (push) Successful in 5m27s

This commit is contained in:
2026-09-11 15:14:22 -04:00
parent 9712bed6f3
commit fede00f902
4 changed files with 98 additions and 1 deletions
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
set -euo pipefail
# Supported invocation:
# curl -fsSL https://git.ssh.surf/snxraven/gnome-jarvis/raw/branch/main/packaging/web-installer.sh | bash -s -- --enable
# Override JARVIS_SERVER and JARVIS_REPO for a mirror or private deployment.
SERVER="${JARVIS_SERVER:-https://git.ssh.surf}"
REPO="${JARVIS_REPO:-snxraven/gnome-jarvis}"
REF="${JARVIS_REF:-rolling}"
TMP_DIR=""
usage() {
cat <<'EOF'
JARVIS-QVAC web installer
Usage:
curl -fsSL https://git.ssh.surf/snxraven/gnome-jarvis/raw/branch/main/packaging/web-installer.sh | bash -s -- [--enable]
Options:
--enable Enable and start the per-user jarvisd.service after install.
--help Show this help.
Environment:
JARVIS_SERVER Gitea server base URL.
JARVIS_REPO Gitea owner/repository, default snxraven/gnome-jarvis.
JARVIS_REF Gitea ref to install, default rolling.
EOF
}
for arg in "$@"; do
case "$arg" in
--enable) ;;
--help|-h) usage; exit 0 ;;
*) echo "Unknown option: $arg" >&2; usage >&2; exit 2 ;;
esac
done
command -v curl >/dev/null || { echo "curl is required" >&2; exit 1; }
command -v tar >/dev/null || { echo "tar is required" >&2; exit 1; }
command -v npm >/dev/null || { echo "Node.js/npm 22.17+ is required" >&2; exit 1; }
node -e 'const [major,minor]=process.versions.node.split(".").map(Number); if (major < 22 || (major === 22 && minor < 17)) process.exit(1)' \
|| { echo "Node.js 22.17+ is required" >&2; exit 1; }
TMP_DIR="$(mktemp -d "${TMPDIR:-/tmp}/jarvis-web-install.XXXXXX")"
cleanup() { rm -rf "$TMP_DIR"; }
trap cleanup EXIT
ARCHIVE_URL="${SERVER%/}/${REPO}/archive/${REF}.tar.gz"
ARCHIVE="${TMP_DIR}/jarvis.tar.gz"
echo "Downloading JARVIS-QVAC source ref '${REF}' from ${SERVER}"
curl --fail --location --silent --show-error --retry 3 --proto '=https' --tlsv1.2 \
"$ARCHIVE_URL" -o "$ARCHIVE"
test -s "$ARCHIVE"
mkdir -p "$TMP_DIR/src"
tar -xzf "$ARCHIVE" -C "$TMP_DIR/src"
SOURCE_DIR="$(find "$TMP_DIR/src" -mindepth 1 -maxdepth 1 -type d -print -quit)"
test -n "$SOURCE_DIR" || { echo "Downloaded archive contained no source directory" >&2; exit 1; }
test -x "$SOURCE_DIR/packaging/install.sh" || { echo "Downloaded ref has no installer" >&2; exit 1; }
echo "Installing into the current user account"
exec bash "$SOURCE_DIR/packaging/install.sh" "$@"