From 235b5c3b9a62bf862434592b848309b6c81f6770 Mon Sep 17 00:00:00 2001 From: Debian Date: Mon, 3 Aug 2026 10:36:51 +0200 Subject: [PATCH] =?UTF-8?q?fix(waf/packaging):=20CRS-Plugin-Download=20pro?= =?UTF-8?q?biert=20main=20+=20master,=20curl=20-f=20=E2=80=94=20v1.3.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WordPress-Plugin nutzt den Branch `master` (nicht `main`), und `curl -sL` ohne -f wertete den 404 als Erfolg → WordPress-Plugin wurde still übersprungen. Fix: beide Branches probieren, curl -f (harter HTTP-Fehler), Tarball-Extraktion als Erfolgskriterium. Co-Authored-By: Claude Opus 4.8 --- VERSION | 2 +- .../debian/edgeguard-api/DEBIAN/postinst | 24 ++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index ba50e86..bee17c9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.12 \ No newline at end of file +1.3.13 \ No newline at end of file diff --git a/packaging/debian/edgeguard-api/DEBIAN/postinst b/packaging/debian/edgeguard-api/DEBIAN/postinst index 3153975..ead225b 100755 --- a/packaging/debian/edgeguard-api/DEBIAN/postinst +++ b/packaging/debian/edgeguard-api/DEBIAN/postinst @@ -951,17 +951,23 @@ KEEPALIVEDDROPIN continue fi P_TMP="$(mktemp -d)" - if curl -sL --max-time 45 \ - "https://github.com/coreruleset/${plugin}-plugin/archive/refs/heads/main.tar.gz" \ - -o "${P_TMP}/p.tgz" 2>/dev/null; then - tar xzf "${P_TMP}/p.tgz" -C "${P_TMP}" 2>/dev/null || true - if ls "${P_TMP}"/*/plugins/${plugin}-*.conf >/dev/null 2>&1; then - install -m 0644 "${P_TMP}"/*/plugins/${plugin}-*.conf \ - "$WAF_CRS_DIR/plugins/" 2>/dev/null \ - && echo "postinst: CRS-Plugin ${plugin} installiert" + P_OK="" + # Plugin-Repos nutzen teils 'main', teils 'master' als Default- + # Branch. curl -f (statt still einen 404 als Erfolg zu werten). + for P_BR in main master; do + if curl -fsSL --max-time 45 \ + "https://github.com/coreruleset/${plugin}-plugin/archive/refs/heads/${P_BR}.tar.gz" \ + -o "${P_TMP}/p.tgz" 2>/dev/null \ + && tar xzf "${P_TMP}/p.tgz" -C "${P_TMP}" 2>/dev/null; then + P_OK=1; break fi + done + if [ -n "$P_OK" ] && ls "${P_TMP}"/*/plugins/${plugin}-*.conf >/dev/null 2>&1; then + install -m 0644 "${P_TMP}"/*/plugins/${plugin}-*.conf \ + "$WAF_CRS_DIR/plugins/" 2>/dev/null \ + && echo "postinst: CRS-Plugin ${plugin} installiert" else - echo "postinst: CRS-Plugin ${plugin} Download fehlgeschlagen (kein Internet?)" >&2 + echo "postinst: CRS-Plugin ${plugin} nicht installiert (Download/Layout)" >&2 fi rm -rf "${P_TMP}" done