install.sh: OpenResty repo distro/component fix for Debian (#122)

Follow-up to #121: the repo line still used the live codename + "main", but
the openresty.org Debian tree only publishes up to bookworm (no trixie) and
uses the "openresty" component, not "main". Verified against the repo:
  /package/debian/dists/  -> bookworm bullseye buster jessie stretch (no trixie)
  bookworm Release        -> Components: openresty
  /package/ubuntu/dists/  -> noble jammy focal ... ; Components: main

So:
- Debian: distro = host codename when published (jessie..bookworm), else
  bookworm (binary-compatible with trixie, same OpenSSL 3 era); component
  "openresty".
- Ubuntu/Mint: distro = host codename; component "main" (unchanged).

Produces the working line on a trixie host:
  deb [...] http://openresty.org/package/debian bookworm openresty

docs/installation.md manual steps updated to match.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-13 20:41:51 -04:00
committed by GitHub
parent 6158a3a693
commit 3df7d8c5cb
2 changed files with 40 additions and 12 deletions
+20 -6
View File
@@ -48,18 +48,32 @@ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.co
> /etc/apt/sources.list.d/nodesource.list
echo "==> OpenResty apt source"
# openresty.org ships distinct trees for Debian vs Ubuntu; pick by distro ID.
# (Using the ubuntu tree with a Debian codename worked on older Debian by
# coincidence — trixie lives under /debian, so be explicit.)
# openresty.org ships distinct trees (and components) for Debian vs Ubuntu.
# Debian tree: component "openresty", published only up to "bookworm" (no
# trixie block) — so on a newer Debian host use the host codename when it's
# published, else fall back to bookworm (binary-compatible with trixie, same
# OpenSSL 3 era). Ubuntu tree: component "main", use the host codename.
. /etc/os-release 2>/dev/null || true
CODENAME="$(lsb_release -sc 2>/dev/null || echo "")"
case "${ID:-}" in
debian) OR_REPO_PATH="package/debian" ;;
*) OR_REPO_PATH="package/ubuntu" ;; # ubuntu, mint, etc.
debian)
OR_REPO_PATH="package/debian"
OR_COMPONENT="openresty"
case "$CODENAME" in
jessie|stretch|buster|bullseye|bookworm) OR_DISTRO="$CODENAME" ;;
*) OR_DISTRO="bookworm" ;;
esac
;;
*)
OR_REPO_PATH="package/ubuntu"
OR_DISTRO="$CODENAME"
OR_COMPONENT="main"
;;
esac
install -d -m 0755 /usr/share/keyrings
wget -qO- https://openresty.org/package/pubkey.gpg \
| gpg --dearmor --yes -o /usr/share/keyrings/openresty.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/${OR_REPO_PATH} $(lsb_release -sc) main" \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/${OR_REPO_PATH} ${OR_DISTRO} ${OR_COMPONENT}" \
> /etc/apt/sources.list.d/openresty.list
# Debian 13 (trixie) tightened apt's sequoia GPG backend to reject SHA-1