Compare commits

...

5 Commits

Author SHA1 Message Date
CanbiZ
6f358d7e5d Add PostGIS extension check to Reitti update_script
Automatically enable PostGIS extension on existing installations if missing.
Checks if extension is already enabled before attempting to create it.

Fixes existing Reitti installations that were created before PostGIS was
added to the initial setup (commit b6312b87d).

Users no longer need to manually run 'CREATE EXTENSION postgis;'
2026-01-05 15:15:59 +01:00
CanbiZ
e44a8e8af8 Add idempotency check for Debian 13 certbot fix
Only apply certbot-dns-multi fix if not already installed.
Checks pip list for certbot-dns-multi before installing golang deps.

Prevents unnecessary reinstallation on repeated update runs.
2026-01-05 15:00:25 +01:00
CanbiZ
b42f9fabe1 Fix NPM API health issues on Debian 13 with certbot-dns-multi
On Debian 13 Trixie, NPM shows 'API isn't healthy' after upgrade.
Install certbot-dns-multi with golang dependencies to fix this.

Changes:
- Install golang, build-essential, git on Debian 13
- Install setuptools-golang==2.9.0 in certbot venv
- Set CGO_ENABLED=1 and GO111MODULE=on for pip install
- Install certbot-dns-multi with --no-build-isolation flag
- Applied to both fresh install and update_script()

Credit: @i4mr000t and @CrazyWolf13
Source: https://v64.tech/t/nginx-proxy-manager-dnschallenge-ipv64-debian-13-fail/4177/7
Fixes: #7489 - NPM Web UI broken after Debian 13 upgrade
2026-01-05 14:59:30 +01:00
CanbiZ
259f14b8e9 Fix openresty suite mapping for Debian 13
Openresty doesn't have trixie packages yet, only bookworm.
Map trixie and sid to use bookworm packages which are compatible.

Available openresty suites: bookworm, bullseye, buster, stretch, jessie
Fixes 404 errors when installing/updating on Debian 13 Trixie
2026-01-05 14:57:40 +01:00
CanbiZ
0fb5fc5ce0 Fix Nginx Proxy Manager for Debian 13 Trixie
- Detect Debian version dynamically from /etc/os-release
- Replace hardcoded 'bookworm' with VERSION_CODENAME in openresty sources
- Fixes both install and update_script() functions
- Ensures openresty repository matches container's Debian version

Fixes: Nginx Proxy Manager update fails on Debian 13 with 404 errors
Previously: Only worked on Debian 12 Bookworm due to hardcoded suite name
2026-01-05 14:56:49 +01:00
3 changed files with 54 additions and 4 deletions

View File

@@ -157,18 +157,39 @@ EOF
[ -f /etc/apt/trusted.gpg.d/openresty-archive-keyring.gpg ] && rm -f /etc/apt/trusted.gpg.d/openresty-archive-keyring.gpg
[ -f /etc/apt/sources.list.d/openresty.list ] && rm -f /etc/apt/sources.list.d/openresty.list
[ ! -f /etc/apt/trusted.gpg.d/openresty.gpg ] && curl -fsSL https://openresty.org/package/pubkey.gpg | gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/openresty.gpg
[ ! -f /etc/apt/sources.list.d/openresty.sources ] && cat <<'EOF' >/etc/apt/sources.list.d/openresty.sources
if [ ! -f /etc/apt/sources.list.d/openresty.sources ]; then
DEBIAN_VERSION=$(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d'=' -f2)
# Openresty only has bookworm, not trixie - map newer versions to bookworm
case "$DEBIAN_VERSION" in
trixie|sid) OPENRESTY_SUITE="bookworm" ;;
*) OPENRESTY_SUITE="$DEBIAN_VERSION" ;;
esac
cat <<EOF >/etc/apt/sources.list.d/openresty.sources
Types: deb
URIs: http://openresty.org/package/debian/
Suites: bookworm
Suites: ${OPENRESTY_SUITE}
Components: openresty
Signed-By: /etc/apt/trusted.gpg.d/openresty.gpg
EOF
fi
$STD apt update
$STD apt -y install openresty
if [ -d /opt/certbot ]; then
$STD /opt/certbot/bin/pip install --upgrade pip setuptools wheel
$STD /opt/certbot/bin/pip install --upgrade certbot certbot-dns-cloudflare
# Fix for Debian 13 Trixie - certbot-dns-multi needed to prevent "API isn't healthy" error
if [[ $(grep -E '^VERSION_ID=' /etc/os-release) == *"13"* ]]; then
if ! /opt/certbot/bin/pip list 2>/dev/null | grep -q certbot-dns-multi; then
msg_info "Applying Debian 13 Certbot Fix"
$STD apt-get install -y golang build-essential git
$STD /opt/certbot/bin/pip install --no-cache-dir setuptools-golang==2.9.0
export CGO_ENABLED=1
export GO111MODULE=on
$STD /opt/certbot/bin/pip install --no-build-isolation --no-cache-dir certbot-dns-multi
msg_ok "Applied Debian 13 Certbot Fix"
fi
fi
fi
msg_ok "Updated Certbot"

View File

@@ -28,6 +28,15 @@ function update_script() {
exit
fi
# Enable PostGIS extension if not already enabled
if systemctl is-active --quiet postgresql; then
if ! sudo -u postgres psql -d reitti -tAc "SELECT 1 FROM pg_extension WHERE extname='postgis'" 2>/dev/null | grep -q 1; then
msg_info "Enabling PostGIS extension"
sudo -u postgres psql -d reitti -c "CREATE EXTENSION IF NOT EXISTS postgis;" &>/dev/null
msg_ok "Enabled PostGIS extension"
fi
fi
if [ ! -d /var/cache/nginx/tiles ]; then
msg_info "Installing Nginx Tile Cache"
mkdir -p /var/cache/nginx/tiles

View File

@@ -36,15 +36,35 @@ msg_info "Setting up Certbot"
$STD python3 -m venv /opt/certbot
$STD /opt/certbot/bin/pip install --upgrade pip setuptools wheel
$STD /opt/certbot/bin/pip install certbot certbot-dns-cloudflare
# Fix for Debian 13 Trixie - certbot-dns-multi needed to prevent "API isn't healthy" error
if [[ $(grep -E '^VERSION_ID=' /etc/os-release) == *"13"* ]]; then
if ! /opt/certbot/bin/pip list 2>/dev/null | grep -q certbot-dns-multi; then
msg_info "Applying Debian 13 Certbot Fix"
$STD apt-get install -y golang build-essential git
$STD /opt/certbot/bin/pip install --no-cache-dir setuptools-golang==2.9.0
export CGO_ENABLED=1
export GO111MODULE=on
$STD /opt/certbot/bin/pip install --no-build-isolation --no-cache-dir certbot-dns-multi
msg_ok "Applied Debian 13 Certbot Fix"
fi
fi
ln -sf /opt/certbot/bin/certbot /usr/local/bin/certbot
msg_ok "Set up Certbot"
msg_info "Installing Openresty"
curl -fsSL "https://openresty.org/package/pubkey.gpg" | gpg --dearmor -o /etc/apt/trusted.gpg.d/openresty.gpg
cat <<'EOF' >/etc/apt/sources.list.d/openresty.sources
DEBIAN_VERSION=$(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d'=' -f2)
# Openresty only has bookworm, not trixie - map newer versions to bookworm
case "$DEBIAN_VERSION" in
trixie|sid) OPENRESTY_SUITE="bookworm" ;;
*) OPENRESTY_SUITE="$DEBIAN_VERSION" ;;
esac
cat <<EOF >/etc/apt/sources.list.d/openresty.sources
Types: deb
URIs: http://openresty.org/package/debian/
Suites: bookworm
Suites: ${OPENRESTY_SUITE}
Components: openresty
Signed-By: /etc/apt/trusted.gpg.d/openresty.gpg
EOF