fix(smoke): проверки используют адрес привязки, а не localhost
This commit is contained in:
+10
-7
@@ -28,6 +28,9 @@ if [ -f "$ENV_FILE" ]; then
|
||||
fi
|
||||
DOMAIN="${DOMAIN:-}"
|
||||
APP_PORT="${APP_PORT:-8080}"
|
||||
APP_BIND="${GLCHAT_APP_BIND:-127.0.0.1}"
|
||||
case "$APP_BIND" in 0.0.0.0 | "") APP_BIND="127.0.0.1" ;; esac
|
||||
APP_URL="http://${APP_BIND}:${APP_PORT}"
|
||||
PROXY_MODE="${PROXY_MODE:-embedded}"
|
||||
LIVEKIT_TCP_PORT="${LIVEKIT_TCP_PORT:-7881}"
|
||||
LIVEKIT_UDP_PORT="${LIVEKIT_UDP_PORT:-7882}"
|
||||
@@ -41,20 +44,20 @@ ENABLE_FAIL2BAN="${FAIL2BAN_ENABLED:-true}"
|
||||
printf '\n=== glchat smoke-тест ===\n'
|
||||
|
||||
printf '\n[1] Приложение\n'
|
||||
if curl -fsS "http://127.0.0.1:${APP_PORT}/healthz" >/dev/null; then
|
||||
pass "/healthz отвечает 200"
|
||||
if curl -fsS "${APP_URL}/healthz" >/dev/null; then
|
||||
pass "/healthz отвечает 200 (${APP_URL})"
|
||||
else
|
||||
fail "/healthz недоступен на 127.0.0.1:${APP_PORT}"
|
||||
fail "/healthz недоступен на ${APP_URL}"
|
||||
fi
|
||||
|
||||
ready="$(curl -fsS "http://127.0.0.1:${APP_PORT}/readyz" 2>/dev/null || true)"
|
||||
ready="$(curl -fsS "${APP_URL}/readyz" 2>/dev/null || true)"
|
||||
if printf '%s' "$ready" | grep -q '"status":"ready"'; then
|
||||
pass "/readyz: база данных готова"
|
||||
else
|
||||
fail "/readyz: ${ready:-нет ответа}"
|
||||
fi
|
||||
|
||||
meta="$(curl -fsS "http://127.0.0.1:${APP_PORT}/api/v1/meta" 2>/dev/null || true)"
|
||||
meta="$(curl -fsS "${APP_URL}/api/v1/meta" 2>/dev/null || true)"
|
||||
if printf '%s' "$meta" | grep -q '"api_version":"v1"'; then
|
||||
version="$(printf '%s' "$meta" | sed -n 's/.*"version":"\([^"]*\)".*/\1/p')"
|
||||
pass "/api/v1/meta отвечает, версия ${version}"
|
||||
@@ -63,7 +66,7 @@ else
|
||||
fi
|
||||
|
||||
printf '\n[2] Веб-клиент\n'
|
||||
index="$(curl -fsS "http://127.0.0.1:${APP_PORT}/" 2>/dev/null || true)"
|
||||
index="$(curl -fsS "${APP_URL}/" 2>/dev/null || true)"
|
||||
if printf '%s' "$index" | grep -qi '<div id="root"'; then
|
||||
pass "заглушка клиента отдаётся с /"
|
||||
elif printf '%s' "$index" | grep -qi 'web client bundle is not present'; then
|
||||
@@ -128,7 +131,7 @@ else
|
||||
turn_domain="$(grep -A3 '^turn:' "${GLCHAT_ETC_DIR}/livekit/livekit.yaml" 2>/dev/null |
|
||||
awk '/domain:/ {print $2; exit}')"
|
||||
if [ -n "$turn_domain" ] && command -v openssl >/dev/null 2>&1; then
|
||||
cert_cn="$(echo | timeout 8 openssl s_client -connect "127.0.0.1:${TURN_TLS_PORT}" \
|
||||
cert_cn="$(echo | timeout 8 openssl s_client -connect "${APP_BIND}:${TURN_TLS_PORT}" \
|
||||
-servername "$turn_domain" 2>/dev/null |
|
||||
openssl x509 -noout -subject 2>/dev/null | sed 's/.*CN *= *//')"
|
||||
if [ "$cert_cn" = "$turn_domain" ]; then
|
||||
|
||||
Reference in New Issue
Block a user