[SECURITY] Секреты вынесены в /root/*, VPN-конфиг под sops, сканер усилен
lint / hygiene (push) Successful in 15s

This commit is contained in:
root committed 2026-10-28 12:24:42 +03:00
1 parent b0e21265cd
commit 4723ed8134
14 files changed
+43 -31

No files matched your search

+21 -9
View File
@@ -24,16 +24,28 @@ jobs:
run: |
python3 - <<'PY'
import re, subprocess, sys
files = subprocess.run(["git","ls-files"],capture_output=True,text=True).stdout.split()
pat = re.compile(r"(?i)(password|passwd|api[_-]?key|secret|token)\s*[:=]\s*['\"]?[A-Za-z0-9_\-]{16,}")
hits=[]
rules = {
"name": re.compile(r"(?i)\b(pass|passwd|password|pwd|pw|secret|token|api[_-]?key|apikey)[a-z0-9_]{0,16}[\"']?\s*[:=]\s*[\"']?([A-Za-z0-9_\-]{16,})"),
"dsn": re.compile(r"://[^:/\s@]{1,32}:([^@\s'\"%]{12,})@"),
}
def placeholder(v):
v = v.strip().strip("'\"")
if not v: return True
if v.upper().startswith(("REMOVED", "EXAMPLE", "PLACEHOLDER", "CHANGEME", "XXX")): return True
if v.startswith(("{{", "${", "<")): return True
if re.fullmatch(r"[a-z][a-z0-9]*(_[a-z0-9]+)+", v): return True
return re.fullmatch(r"[A-Z0-9_]{6,}", v) is not None
files = subprocess.run(["git", "ls-files"], capture_output=True, text=True).stdout.split()
hits = []
for f in files:
if f.endswith(('.md','.yml','.yaml','.py','.sh','.json','.ini','.conf','.env')):
try: t=open(f,encoding='utf-8',errors='ignore').read()
except Exception: continue
for m in pat.finditer(t):
if 'example' in m.group(0).lower() or 'placeholder' in m.group(0).lower(): continue
hits.append(f"{f}: подозрение на секрет")
if not f.endswith((".md", ".yml", ".yaml", ".py", ".sh", ".json", ".ini", ".conf", ".env")): continue
try: t = open(f, encoding="utf-8", errors="ignore").read()
except Exception: continue
for i, line in enumerate(t.splitlines(), 1):
for rule, rx in rules.items():
m = rx.search(line)
if m and not placeholder(m.group(m.lastindex)):
hits.append("%s:%d (%s)" % (f, i, rule))
print("файлов проверено:", len(files))
if hits:
print("\n".join(hits[:10])); sys.exit(1)
+1 -1
View File
@@ -76,7 +76,7 @@
"parameters": [
{
"name": "Authorization",
"value": "token 416f50c1a559be2def78bd6e3616a97906b0623d"
"value": "token {{GITEA_TOKEN}}"
},
{
"name": "Content-Type",
@@ -1,3 +1,3 @@
Acquiring database migration lock...
Deprecation warning: The storage directory "/home/node/.n8n/binaryData" will be renamed to "/home/node/.n8n/storage" in n8n v3. To migrate now, set N8N_MIGRATE_FS_STORAGE_PATH=true. If you have a volume mounted at the old path, update your mount configuration after migration.
[{"updatedAt":"2026-10-08T16:48:29.376Z","createdAt":"2026-09-11T12:37:51.879Z","id":"TSqu00NJx2JOrtoN","name":"Uptime Kuma → Gitea Self-Healing","description":null,"active":false,"isArchived":false,"nodes":[{"parameters":{"httpMethod":"POST","path":"uptime-kuma","responseMode":"responseNode","options":{}},"name":"Uptime Kuma Webhook","webhookId":"95de5809-c2a6-4ba1-a472-89debbc46fbb","type":"n8n-nodes-base.webhook","typeVersion":2,"position":[144,256],"id":"a4c37fdc-fe82-4d53-8cd9-0d6af7afc90f"},{"parameters":{"jsCode":"const webhookData = $input.first().json;\nconst body = webhookData.body || webhookData;\n\n// УМНАЯ ПРОВЕРКА: если monitor_name пуст или 'Unknown', берем домен из URL\nlet monitorName = body.monitor_name || 'Unknown';\nif (monitorName === 'Unknown' || !monitorName) {\n const url = body.monitor_url || '';\n monitorName = url ? url.replace(/https?:\\/\\//, '').split('/')[0] : 'Unknown Service';\n}\n\nconst monitorUrl = body.monitor_url || 'N/A';\nconst status = parseInt(body.heartbeat_status) || 0;\nconst message = body.heartbeat_message || 'Service is down';\n\nconst ctMatch = monitorName.match(/\\((\\d+)\\)/);\nconst ctId = ctMatch ? ctMatch[1] : null;\n\n// Создаем четкий заголовок для Gitea\nconst giteaTitle = `AUTO-FIX: ${monitorName} DOWN`;\n\nreturn [{\n json: {\n monitorName,\n monitorUrl,\n status,\n message,\n ctId,\n giteaTitle,\n timestamp: new Date().toISOString(),\n shouldAlert: status === 0 && ctId !== null\n }\n}];"},"name":"Extract Info","type":"n8n-nodes-base.code","typeVersion":2,"position":[368,256],"id":"23e46b7d-28db-4d26-b90b-f86f49d216bc"},{"parameters":{"conditions":{"boolean":[{"value1":"={{ $json.shouldAlert }}","value2":true}],"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":1},"combinator":"and"},"options":{}},"name":"Should Create Issue?","type":"n8n-nodes-base.if","typeVersion":2,"position":[608,256],"id":"2b7f557f-8d80-4266-8f67-6b1dc3c38f25"},{"parameters":{"method":"POST","url":"http://192.168.1.140:3000/api/v1/repos/root/buryan-hub/issues","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Authorization","value":"token 416f50c1a559be2def78bd6e3616a97906b0623d"},{"name":"Content-Type","value":"application/json"}]},"sendBody":true,"specifyBody":"json","jsonBody":"={{ JSON.stringify({ title: $json.giteaTitle, body: \"CT_DOWN: \" + $json.ctId + \"\\n\\nАвтоматическое восстановление: \" + $json.monitorName + \".\\n\\nURL: \" + $json.monitorUrl + \"\\nMessage: \" + $json.message + \"\\nTime: \" + $json.timestamp, labels: [2] }) }}","options":{}},"name":"Create Gitea Issue","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[832,160],"id":"40bcfe34-b905-4ab2-ac2d-5de5ad5e9d5b"},{"parameters":{"method":"POST","url":"https://193.233.210.184/tg-api/bot8668603602:AAHVmUmq44dcomw8QOfw_qj1aICXuT5c5XU/sendMessage","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Content-Type","value":"application/json"}]},"sendBody":true,"bodyParameters":{"parameters":[{"name":"chat_id","value":"=273442500"},{"name":"text","value":"=🚨 <b>{{ $json.monitorName }}</b> DOWN\n\nURL: {{ $json.monitorUrl }}\nВремя: {{ new Date().toLocaleString(\"ru-RU\") }}\n\n✅ Issue создан в Gitea: {{ $json.giteaTitle }}"},{"name":"parse_mode","value":"HTML"}]},"options":{"allowUnauthorizedCerts":true}},"name":"Notify Telegram","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[1088,256],"id":"9cbd83b9-944f-4d3f-9803-62ccf51cd458"},{"parameters":{"respondWith":"json","responseBody":"={{ JSON.stringify({ ok: true, issue_created: $json.html_url || null }) }}","options":{}},"name":"Respond","type":"n8n-nodes-base.respondToWebhook","typeVersion":1.1,"position":[1312,256],"id":"6eac3128-5c63-4315-89af-4fb0be610522"}],"connections":{"Uptime Kuma Webhook":{"main":[[{"node":"Extract Info","type":"main","index":0}]]},"Extract Info":{"main":[[{"node":"Should Create Issue?","type":"main","index":0}]]},"Should Create Issue?":{"main":[[{"node":"Create Gitea Issue","type":"main","index":0}]]},"Create Gitea Issue":{"main":[[{"node":"Notify Telegram","type":"main","index":0}]]},"Notify Telegram":{"main":[[{"node":"Respond","type":"main","index":0}]]}},"settings":{"binaryMode":"separate","executionOrder":"v1"},"staticData":null,"meta":null,"nodeGroups":[],"pinData":{},"versionId":"804c1a12-b975-4e70-853e-5294085461b9","activeVersionId":null,"versionCounter":7,"triggerCount":1,"sourceWorkflowId":null,"tags":[],"shared":[{"updatedAt":"2026-10-06T17:32:23.758Z","createdAt":"2026-10-06T17:32:23.758Z","role":"workflow:owner","workflowId":"TSqu00NJx2JOrtoN","projectId":"Zd9FtLQS8Pbp0htn","project":{"updatedAt":"2026-10-06T14:24:06.720Z","createdAt":"2026-10-06T14:21:02.176Z","id":"Zd9FtLQS8Pbp0htn","name":"Roman Buryan <maloyakapg@gmail.com>","type":"personal","icon":null,"description":null,"customTelemetryTags":Line truncated
[{"updatedAt":"2026-10-08T16:48:29.376Z","createdAt":"2026-09-11T12:37:51.879Z","id":"TSqu00NJx2JOrtoN","name":"Uptime Kuma → Gitea Self-Healing","description":null,"active":false,"isArchived":false,"nodes":[{"parameters":{"httpMethod":"POST","path":"uptime-kuma","responseMode":"responseNode","options":{}},"name":"Uptime Kuma Webhook","webhookId":"95de5809-c2a6-4ba1-a472-89debbc46fbb","type":"n8n-nodes-base.webhook","typeVersion":2,"position":[144,256],"id":"a4c37fdc-fe82-4d53-8cd9-0d6af7afc90f"},{"parameters":{"jsCode":"const webhookData = $input.first().json;\nconst body = webhookData.body || webhookData;\n\n// УМНАЯ ПРОВЕРКА: если monitor_name пуст или 'Unknown', берем домен из URL\nlet monitorName = body.monitor_name || 'Unknown';\nif (monitorName === 'Unknown' || !monitorName) {\n const url = body.monitor_url || '';\n monitorName = url ? url.replace(/https?:\\/\\//, '').split('/')[0] : 'Unknown Service';\n}\n\nconst monitorUrl = body.monitor_url || 'N/A';\nconst status = parseInt(body.heartbeat_status) || 0;\nconst message = body.heartbeat_message || 'Service is down';\n\nconst ctMatch = monitorName.match(/\\((\\d+)\\)/);\nconst ctId = ctMatch ? ctMatch[1] : null;\n\n// Создаем четкий заголовок для Gitea\nconst giteaTitle = `AUTO-FIX: ${monitorName} DOWN`;\n\nreturn [{\n json: {\n monitorName,\n monitorUrl,\n status,\n message,\n ctId,\n giteaTitle,\n timestamp: new Date().toISOString(),\n shouldAlert: status === 0 && ctId !== null\n }\n}];"},"name":"Extract Info","type":"n8n-nodes-base.code","typeVersion":2,"position":[368,256],"id":"23e46b7d-28db-4d26-b90b-f86f49d216bc"},{"parameters":{"conditions":{"boolean":[{"value1":"={{ $json.shouldAlert }}","value2":true}],"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":1},"combinator":"and"},"options":{}},"name":"Should Create Issue?","type":"n8n-nodes-base.if","typeVersion":2,"position":[608,256],"id":"2b7f557f-8d80-4266-8f67-6b1dc3c38f25"},{"parameters":{"method":"POST","url":"http://192.168.1.140:3000/api/v1/repos/root/buryan-hub/issues","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Authorization","value":"token {{GITEA_TOKEN}}"},{"name":"Content-Type","value":"application/json"}]},"sendBody":true,"specifyBody":"json","jsonBody":"={{ JSON.stringify({ title: $json.giteaTitle, body: \"CT_DOWN: \" + $json.ctId + \"\\n\\nАвтоматическое восстановление: \" + $json.monitorName + \".\\n\\nURL: \" + $json.monitorUrl + \"\\nMessage: \" + $json.message + \"\\nTime: \" + $json.timestamp, labels: [2] }) }}","options":{}},"name":"Create Gitea Issue","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[832,160],"id":"40bcfe34-b905-4ab2-ac2d-5de5ad5e9d5b"},{"parameters":{"method":"POST","url":"https://193.233.210.184/tg-api/bot8668603602:AAHVmUmq44dcomw8QOfw_qj1aICXuT5c5XU/sendMessage","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Content-Type","value":"application/json"}]},"sendBody":true,"bodyParameters":{"parameters":[{"name":"chat_id","value":"=273442500"},{"name":"text","value":"=🚨 <b>{{ $json.monitorName }}</b> DOWN\n\nURL: {{ $json.monitorUrl }}\nВремя: {{ new Date().toLocaleString(\"ru-RU\") }}\n\n✅ Issue создан в Gitea: {{ $json.giteaTitle }}"},{"name":"parse_mode","value":"HTML"}]},"options":{"allowUnauthorizedCerts":true}},"name":"Notify Telegram","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[1088,256],"id":"9cbd83b9-944f-4d3f-9803-62ccf51cd458"},{"parameters":{"respondWith":"json","responseBody":"={{ JSON.stringify({ ok: true, issue_created: $json.html_url || null }) }}","options":{}},"name":"Respond","type":"n8n-nodes-base.respondToWebhook","typeVersion":1.1,"position":[1312,256],"id":"6eac3128-5c63-4315-89af-4fb0be610522"}],"connections":{"Uptime Kuma Webhook":{"main":[[{"node":"Extract Info","type":"main","index":0}]]},"Extract Info":{"main":[[{"node":"Should Create Issue?","type":"main","index":0}]]},"Should Create Issue?":{"main":[[{"node":"Create Gitea Issue","type":"main","index":0}]]},"Create Gitea Issue":{"main":[[{"node":"Notify Telegram","type":"main","index":0}]]},"Notify Telegram":{"main":[[{"node":"Respond","type":"main","index":0}]]}},"settings":{"binaryMode":"separate","executionOrder":"v1"},"staticData":null,"meta":null,"nodeGroups":[],"pinData":{},"versionId":"804c1a12-b975-4e70-853e-5294085461b9","activeVersionId":null,"versionCounter":7,"triggerCount":1,"sourceWorkflowId":null,"tags":[],"shared":[{"updatedAt":"2026-10-06T17:32:23.758Z","createdAt":"2026-10-06T17:32:23.758Z","role":"workflow:owner","workflowId":"TSqu00NJx2JOrtoN","projectId":"Zd9FtLQS8Pbp0htn","project":{"updatedAt":"2026-10-06T14:24:06.720Z","createdAt":"2026-10-06T14:21:02.176Z","id":"Zd9FtLQS8Pbp0htn","name":"Roman Buryan <maloyakapg@gmail.com>","type":"personal","icon":null,"description":null,"customTelemetryTags":[],"creatorId":"d78fe973-Line truncated
+1 -1
View File
@@ -20,7 +20,7 @@ def call(path, method="GET", body=None):
return None, str(e)[:120]
PASS = "HubNextcloud2026!"
PASS = open("/root/.nextcloud-admin-pass").read().strip()
flow, err = call("/api/config/config_entries/flow", "POST", {"handler": "nextcloud"})
if err:
print("flow:", err)
+1 -1
View File
@@ -6,7 +6,7 @@ import urllib.request
import bcrypt
PW_DB = "Buryan20261016mrAzbQ5SWdxwYg"
PW_DB = open("/root/.pg-superuser-pass").read().strip()
NEW_PASS = "HubImmich2026!"
EMAIL = "maloyakapg@gmail.com"
+1 -1
View File
@@ -4,7 +4,7 @@ import urllib.error
import urllib.request
BASE = "http://192.168.1.140:3000/api/v1"
TOK = "416f50c1a559be2def78bd6e3616a97906b0623d"
TOK = open("/root/.bwork-token").read().strip()
H = {"Authorization": "token " + TOK, "Content-Type": "application/json"}
+3 -3
View File
@@ -12,9 +12,9 @@ SRC=/root/matrix-backups
DEST=/mnt/backups/matrix
mkdir -p "$DEST"
TOKEN_LOCAL=5767150402f7d780402c
TOKEN_OFFSITE=747255608a9df3e81d01
TOKEN_RESTORE=4464c9566e26c42e519c
TOKEN_LOCAL=$(cat /root/.kuma-matrix-local)
TOKEN_OFFSITE=$(cat /root/.kuma-matrix-offsite)
TOKEN_RESTORE=$(cat /root/.kuma-matrix-restore)
VPS=root@193.233.210.184
VPS_DIR=/var/backups/matrix
@@ -34,7 +34,7 @@ echo
echo "=== 4. SONARR ==="
CODE=$(curl -s -o /tmp/s4.out -b "$JAR" -w '%{http_code}' --max-time 25 -X POST -H 'Content-Type: application/json' -d '{
"name":"Buryan Hub","hostname":"192.168.1.117","port":8989,"useSsl":false,"urlBase":"",
"apiKey":"7ff2c05ca6cf4b669d1f6f7d3345f1cb","activeProfileId":1,"activeProfileName":"Any",
"apiKey":"'$(cat /root/.sonarr-key)'","activeProfileId":1,"activeProfileName":"Any",
"activeDirectory":"/tv","activeLanguageProfileId":1,"activeTags":[],"is4k":false,
"isDefault":true,"syncEnabled":true,"preventSearch":false}' "$S/settings/sonarr")
echo " ответ: HTTP $CODE $(head -c 160 /tmp/s4.out | tr -d '\n')"
@@ -43,7 +43,7 @@ echo
echo "=== 5. RADARR ==="
CODE=$(curl -s -o /tmp/s5.out -b "$JAR" -w '%{http_code}' --max-time 25 -X POST -H 'Content-Type: application/json' -d '{
"name":"Buryan Hub","hostname":"192.168.1.118","port":7878,"useSsl":false,"urlBase":"",
"apiKey":"f5da223e81244144bb5a14683e415b9f","activeProfileId":1,"activeProfileName":"Any",
"apiKey":"'$(cat /root/.radarr-key)'","activeProfileId":1,"activeProfileName":"Any",
"activeDirectory":"/movies","activeLanguageProfileId":1,"activeTags":[],"is4k":false,
"isDefault":true,"syncEnabled":true,"preventSearch":false}' "$S/settings/radarr")
echo " ответ: HTTP $CODE $(head -c 160 /tmp/s5.out | tr -d '\n')"
+4 -4
View File
@@ -10,7 +10,7 @@ echo "=== SONARR ==="
CODE=$(curl -s -o /tmp/s4.out -b "$JAR" -w '%{http_code}' --max-time 30 -X POST -H 'Content-Type: application/json' -d '{
"name":"Buryan Hub",
"hostname":"192.168.1.117","port":8989,"useSsl":false,"urlBase":"",
"apiKey":"7ff2c05ca6cf4b669d1f6f7d3345f1cb",
"apiKey":"'$(cat /root/.sonarr-key)'",
"activeProfileId":1,"activeProfileName":"Any","activeDirectory":"/tv",
"activeLanguageProfileId":1,
"activeAnimeProfileId":null,"activeAnimeProfileName":null,"activeAnimeDirectory":null,
@@ -26,7 +26,7 @@ echo "=== RADARR ==="
CODE=$(curl -s -o /tmp/s5.out -b "$JAR" -w '%{http_code}' --max-time 30 -X POST -H 'Content-Type: application/json' -d '{
"name":"Buryan Hub",
"hostname":"192.168.1.118","port":7878,"useSsl":false,"urlBase":"",
"apiKey":"f5da223e81244144bb5a14683e415b9f",
"apiKey":"'$(cat /root/.radarr-key)'",
"activeProfileId":1,"activeProfileName":"Any","activeDirectory":"/movies",
"activeLanguageProfileId":1,"minimumAvailability":"released",
"activeTags":[],"tags":[],
@@ -54,5 +54,5 @@ done
echo
echo "=== ПРОВЕРКА СВЯЗИ С СЕРВИСАМИ ==="
printf ' sonarr тест: '; curl -s -o /dev/null -w '%{http_code}\n' --max-time 15 -b "$JAR" -X POST "$S/settings/sonarr/test" -H 'Content-Type: application/json' -d '{"hostname":"192.168.1.117","port":8989,"useSsl":false,"urlBase":"","apiKey":"7ff2c05ca6cf4b669d1f6f7d3345f1cb"}'
printf ' radarr тест: '; curl -s -o /dev/null -w '%{http_code}\n' --max-time 15 -b "$JAR" -X POST "$S/settings/radarr/test" -H 'Content-Type: application/json' -d '{"hostname":"192.168.1.118","port":7878,"useSsl":false,"urlBase":"","apiKey":"f5da223e81244144bb5a14683e415b9f"}'
printf ' sonarr тест: '; curl -s -o /dev/null -w '%{http_code}\n' --max-time 15 -b "$JAR" -X POST "$S/settings/sonarr/test" -H 'Content-Type: application/json' -d '{"hostname":"192.168.1.117","port":8989,"useSsl":false,"urlBase":"","apiKey":"'$(cat /root/.sonarr-key)'"}'
printf ' radarr тест: '; curl -s -o /dev/null -w '%{http_code}\n' --max-time 15 -b "$JAR" -X POST "$S/settings/radarr/test" -H 'Content-Type: application/json' -d '{"hostname":"192.168.1.118","port":7878,"useSsl":false,"urlBase":"","apiKey":"'$(cat /root/.radarr-key)'"}'
@@ -22,9 +22,9 @@ deploy() {
}
echo "=== 1. РАЗВЁРТЫВАЮ ЭКСПОРТЁРЫ ==="
deploy exportarr-sonarr sonarr 9707 http://192.168.1.117:8989 7ff2c05ca6cf4b669d1f6f7d3345f1cb
deploy exportarr-radarr radarr 9708 http://192.168.1.118:7878 f5da223e81244144bb5a14683e415b9f
deploy exportarr-prowlarr prowlarr 9709 http://192.168.1.119:9696 284d2086b6454d27a848d2bf81bb9055
deploy exportarr-sonarr sonarr 9707 http://192.168.1.117:8989 "$(cat /root/.sonarr-key)"
deploy exportarr-radarr radarr 9708 http://192.168.1.118:7878 "$(cat /root/.radarr-key)"
deploy exportarr-prowlarr prowlarr 9709 http://192.168.1.119:9696 "$(cat /root/.prowlarr-key)"
BAZKEY=$(pct exec 120 -- bash -c "grep -oE '<ApiKey>[^<]+' /opt/bazarr/config/config/config.yaml 2>/dev/null | head -1" 2>/dev/null | tr -d '\r')
if [ -z "$BAZKEY" ]; then
+2 -2
View File
@@ -1,7 +1,7 @@
"""Создаёт credentials для n8n (с фиксированными id)."""
import json
PW = "Buryan20261016mrAzbQ5SWdxwYg"
PW = open("/root/.pg-superuser-pass").read().strip()
creds = [
{
@@ -9,7 +9,7 @@ creds = [
"name": "Header Auth account",
"type": "httpHeaderAuth",
"data": {"name": "Authorization",
"value": "token 416f50c1a559be2def78bd6e3616a97906b0623d"},
"value": "token " + open("/root/.bwork-token").read().strip()},
},
{
"id": "BuryanMonitoring1",
+1 -1
View File
@@ -4,7 +4,7 @@ import os
import re
import subprocess
PW = "Buryan20261016mrAzbQ5SWdxwYg"
PW = open("/root/.pg-superuser-pass").read().strip()
OUT = "/tmp/n8n_import"
os.makedirs(OUT, exist_ok=True)
DBS = ["n8n_big", "n8n_restore", "n8n_tmp"]
+1 -1
View File
@@ -31,7 +31,7 @@ CT=113
CONT=grafana
DB=grafana_db
ROLE=grafana_user
PASS='Grafana_Local_2026!'
PASS="$(cat /root/.grafana-admin-pass)"
STAMP=$(date +%Y%m%d_%H%M%S)
QUAR="/mnt/backups/retired/${STAMP}-grafana-pilot"
WORK="/tmp/grafana-pilot-$STAMP"
+1 -1
View File
@@ -21,5 +21,5 @@ echo "=== Открываем порт 8888 в iptables VPS ==="
ssh root@193.233.210.184 'iptables -C INPUT -p tcp --dport 8888 -j ACCEPT 2>/dev/null || iptables -I INPUT 1 -p tcp --dport 8888 -j ACCEPT; iptables-save > /etc/iptables/rules.v4; echo ok'
echo "=== Тест: CT108 -> tinyproxy -> api.telegram.org ==="
pct exec 108 -- curl -s -m 10 -x http://n8nrelay:BuryanRelay2026@193.233.210.184:8888 \
pct exec 108 -- curl -s -m 10 -x http://$(cat /root/.proxy-user):$(cat /root/.proxy-pass)@193.233.210.184:8888 \
-o /dev/null -w "PROXY: code=%{http_code}\n" https://api.telegram.org/ || echo "FAIL proxy"