From dcb2a8b3fa80ce2068b6bb4abf341a63a4e15cde Mon Sep 17 00:00:00 2001 From: grendervill Date: Sat, 19 Sep 2026 20:46:43 +0300 Subject: [PATCH] =?UTF-8?q?fix(smoke):=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=BA=D0=B8=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D1=83=D1=8E=D1=82=20=D0=B0=D0=B4=D1=80=D0=B5=D1=81=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D0=B2=D1=8F=D0=B7=D0=BA=D0=B8,=20=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B5=20localhost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/smoke.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/deploy/smoke.sh b/deploy/smoke.sh index d92d75f..51ccdfe 100755 --- a/deploy/smoke.sh +++ b/deploy/smoke.sh @@ -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 '
/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