main/modules/25-angie.sh
mk 9f164f61ef angie(debian): pin VERSION_ID in apt repo URL — needs angie/<ID>/<VERSION_ID>/ (debian/13/dists/trixie/) not angie/<ID>/ (debian/dists/trixie/ -> 404 'no Release file') on trixie; suite stays VERSION_CODENAME
packages(debian): rm stale /etc/apt/sources.list.d/eza.list + gierens.gpg left by the pre-fix run that used the now-dead apt.fury.io PPA — otherwise 'apt-get update' keeps hitting the 401 forever even though we now install eza from GH releases
2026-07-28 07:11:22 +03:00

65 lines
2.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# 25-angie — Angie (nginx fork) web server.
step_name="angie"
step_desc="angie web server (nginx fork), enable + open 80/443"
step_run="run_angie"
run_angie() {
log "installing angie"
if command -v angie >/dev/null 2>&1; then
ok "angie already installed"
else
case "$DISTRO" in
arch) _angie_arch ;;
debian) _angie_debian ;;
esac
fi
if command -v systemctl >/dev/null 2>&1 && systemctl is-system-running >/dev/null 2>&1; then
sudo_ systemctl enable --now angie 2>/dev/null || warn "could not enable angie.service"
else
warn "systemctl unavailable — start angie manually if needed"
fi
# firewall note: ufw rules for 80/443 are owned by the hardening step
ok "angie installed. ufw 80/443 handled in the hardening step."
}
_angie_arch() {
if ! command -v yay >/dev/null 2>&1; then
warn "yay not available — install angie manually from AUR: yay -S angie-bin"
return
fi
# Prefer angie-bin: it repackages the upstream official Ubuntu .deb, so it's
# instant (no source compile) and carries the same compiled-in modules our
# config relies on — http_acme, http_ssl, http_v2/v3, http_realip, stream*
# (verified via the .deb's 'angie -V'). Drop back to the source 'angie'
# package only if the binary package is unavailable.
log "AUR install: angie-bin first, fall back to angie (source build)"
if as_user yay -S --noconfirm --needed angie-bin 2>/dev/null; then
ok "angie-bin installed from AUR"
return
fi
log "angie-bin unavailable/failed — building angie from source (may take a few minutes)"
if as_user yay -S --noconfirm --needed aur/angie 2>/dev/null; then
ok "angie (source) installed from AUR"
else
warn "angie install failed — try manually: yay -S angie-bin (or: yay -S angie)"
fi
}
_angie_debian() {
. /etc/os-release
sudo_ install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://angie.software/keys/angie-signing.gpg \
| sudo_ tee /etc/apt/keyrings/angie-signing.gpg >/dev/null
# Repo path is angie/<ID>/<VERSION_ID>/ with the codename as the apt suite, e.g.
# debian/13/dists/trixie/ or ubuntu/22.04/dists/jammy/. Omitting VERSION_ID (just
# angie/debian/) fetches debian/dists/trixie -> 404 'no Release file' — must pin the
# numeric version in the URL path.
echo "deb [signed-by=/etc/apt/keyrings/angie-signing.gpg] https://download.angie.software/angie/${ID}/${VERSION_ID}/ ${VERSION_CODENAME} main" \
| sudo_ tee /etc/apt/sources.list.d/angie.list >/dev/null
sudo_ apt-get update -y
sudo_ apt-get install -y angie
}