fix: canary telegram-алерт через --noproxy (xray не роутит telegram)

This commit is contained in:
anor
2026-07-15 17:24:52 +10:00
parent 1df4a3c081
commit f1c9bcf51d
+2 -1
View File
@@ -74,7 +74,8 @@ send_tg() { # $1=text
if [ -z "${ALERT_TG_BOT_TOKEN:-}" ] || [ -z "${ALERT_TG_CHAT_ID:-}" ]; then
echo "$TS ALERT-UNSENT (TG не настроен) $1" >> "$LOG"; return 0
fi
if curl -s --max-time 10 "https://api.telegram.org/bot${ALERT_TG_BOT_TOKEN}/sendMessage" \
# --noproxy: xray (HTTPS_PROXY) телегу НЕ роутит (даёт 000); слать напрямую.
if curl -s --noproxy "*" --max-time 10 "https://api.telegram.org/bot${ALERT_TG_BOT_TOKEN}/sendMessage" \
--data-urlencode "chat_id=${ALERT_TG_CHAT_ID}" \
--data-urlencode "text=$1" | grep -q '"ok":true'; then
echo "$TS ALERT-SENT tg" >> "$LOG"