fix(ci): harden community image smoke
CI / Rust Checks (push) Successful in 12m30s
CI / UI Checks (push) Successful in 5s
CI / Frontend E2E (push) Failing after 9m30s
CI / Community Image Smoke (push) Successful in 11m18s
CI / Deploy (push) Has been skipped

This commit is contained in:
2026-08-30 22:22:13 +03:00
parent ad8390e297
commit d92f817e73
10 changed files with 162 additions and 30 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail
port="${1:?port is required}"
path="${2:?path is required}"
if [[ ! "$port" =~ ^[0-9]{1,5}$ ]] || (( port < 1 || port > 65535 )); then
exit 64
fi
if [[ "$path" != /* || "$path" == *$'\r'* || "$path" == *$'\n'* ]]; then
exit 64
fi
# Bash provides /dev/tcp without adding a network client package to the runtime
# image. Compose still applies its own five-second timeout to the whole probe.
exec 3<>"/dev/tcp/127.0.0.1/${port}"
printf 'GET %s HTTP/1.1\r\nHost: 127.0.0.1\r\nConnection: close\r\n\r\n' "$path" >&3
IFS=$'\r' read -r -t 2 status <&3
case "$status" in
'HTTP/1.0 200 '*|'HTTP/1.1 200 '*) ;;
*) exit 1 ;;
esac