release 1.3.4: summary i18n, monpages code-21, aptdeploy path
This commit is contained in:
parent
8840341079
commit
949837d2e6
6 changed files with 32 additions and 12 deletions
|
|
@ -104,14 +104,15 @@ check_one() {
|
|||
local body code hint
|
||||
body=$(mktemp)
|
||||
code=$(curl -skS -L --max-redirs 5 -m "${TIMEOUT}" -o "$body" -w '%{http_code}' "$url" 2>/dev/null || echo 000)
|
||||
if [ "$code" != "200" ]; then
|
||||
fail "public mon page" "$url -> HTTP $code (want 200 HTML)"
|
||||
if grep -qE '"code"[[:space:]]*:[[:space:]]*21' "$body" 2>/dev/null \
|
||||
|| grep -qiE 'There is no endpoint defined for the URL' "$body" 2>/dev/null; then
|
||||
fail "public mon page missing" \
|
||||
"$url -> HTTP $code merchant/API JSON code 21 (Caddy handle not live — sudo ~/koopa-caddy/apply-monitoring-live.sh)"
|
||||
rm -f "$body"
|
||||
return 1
|
||||
fi
|
||||
if grep -qE '"code"[[:space:]]*:[[:space:]]*21' "$body" 2>/dev/null; then
|
||||
fail "public mon page missing" \
|
||||
"$url -> merchant/API JSON code 21 (Caddy handle not live or not published — sudo apply-monitoring-live.sh)"
|
||||
if [ "$code" != "200" ]; then
|
||||
fail "public mon page" "$url -> HTTP $code (want 200 HTML)"
|
||||
rm -f "$body"
|
||||
return 1
|
||||
fi
|
||||
|
|
@ -142,6 +143,22 @@ while IFS= read -r line; do
|
|||
URLS+=("$line")
|
||||
done < <(build_urls)
|
||||
|
||||
# also check non-trailing-slash forms (Caddy redir or merchant fallthrough)
|
||||
_extra=()
|
||||
for u in "${URLS[@]}"; do
|
||||
case "$u" in
|
||||
*/) _bare=${u%/}; [ -n "$_bare" ] && _extra+=("$_bare") ;;
|
||||
esac
|
||||
done
|
||||
for u in "${_extra[@]+"${_extra[@]}"}"; do
|
||||
skip=0
|
||||
for e in "${URLS[@]+"${URLS[@]}"}"; do
|
||||
[ "$e" = "$u" ] && skip=1 && break
|
||||
done
|
||||
[ "$skip" = "1" ] && continue
|
||||
URLS+=("$u")
|
||||
done
|
||||
|
||||
if [ "${#URLS[@]}" -eq 0 ]; then
|
||||
fail "monpages" "no URLs to check (set MON_HOSTS or MONITORING_PAGE_URLS)"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue