mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-06 07:47:53 +10:00
- Fix debian.yml: pin nfpm version, add permissions, improve test job with user creation, init test, and status check - Fix homebrew.yml: use PyPI JSON API (macOS-compatible, no grep -oP), wait for PyPI availability on release, use generated formula not template, add Linux (Linuxbrew) test job alongside macOS - Add release.yml orchestrator: pip → deb + brew + docker in order - Add workflow_call triggers to pip.yml and docker.yml - Fix build_brew.sh: replace grep -oP with Python-based PyPI API, add on_linux deps (pkg-config, openssl, libffi) - Fix setup.sh: use GitHub API to find correct .deb download URL (filename includes version number) - Fix postinstall.sh: create archivebox system user, pin version from package, check for systemd before daemon-reload - Fix preremove.sh: stop service before removal, check for systemd - Fix install.sh: fallback to latest if pinned version not on PyPI - Add on_linux deps to brew formula for Linuxbrew support - Tested: .deb builds, installs, creates user, runs archivebox init https://claude.ai/code/session_01Vx1EsNrNySgsc8Y67dGzCn
37 lines
1.3 KiB
Bash
Executable File
37 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# /opt/archivebox/install.sh - installs/upgrades archivebox into its virtualenv
|
|
# Called by the postinstall script and can be run manually to upgrade
|
|
|
|
set -e
|
|
|
|
ARCHIVEBOX_VENV="/opt/archivebox/venv"
|
|
ARCHIVEBOX_VERSION="${ARCHIVEBOX_VERSION:-}"
|
|
|
|
echo "[+] Setting up ArchiveBox virtualenv in $ARCHIVEBOX_VENV..."
|
|
|
|
# Create the virtualenv if it doesn't exist
|
|
if [ ! -d "$ARCHIVEBOX_VENV" ]; then
|
|
python3 -m venv "$ARCHIVEBOX_VENV"
|
|
fi
|
|
|
|
# Upgrade pip inside the virtualenv
|
|
"$ARCHIVEBOX_VENV/bin/python3" -m pip install --quiet --upgrade pip setuptools
|
|
|
|
# Install or upgrade archivebox
|
|
if [ -n "$ARCHIVEBOX_VERSION" ]; then
|
|
echo "[+] Installing archivebox==$ARCHIVEBOX_VERSION..."
|
|
"$ARCHIVEBOX_VENV/bin/pip" install --quiet --upgrade "archivebox==$ARCHIVEBOX_VERSION" || {
|
|
echo "[!] archivebox==$ARCHIVEBOX_VERSION not found on PyPI, installing latest..."
|
|
"$ARCHIVEBOX_VENV/bin/pip" install --quiet --upgrade archivebox
|
|
}
|
|
else
|
|
echo "[+] Installing latest archivebox..."
|
|
"$ARCHIVEBOX_VENV/bin/pip" install --quiet --upgrade archivebox
|
|
fi
|
|
|
|
echo "[+] Installing archivebox runtime dependencies..."
|
|
"$ARCHIVEBOX_VENV/bin/archivebox" install --binproviders pip,npm 2>/dev/null || true
|
|
|
|
echo "[√] ArchiveBox installed successfully."
|
|
echo " Run 'archivebox version' to verify."
|