fix(waf/packaging): CRS-Plugin-Download probiert main + master, curl -f — v1.3.13
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user