douyinWEB/scripts/_verify_dual_edge_final.py
eric d409e416da Ship physical dual-edge stack, Studio CDP live metrics, and ops tooling.
Capture Neko/WG/network hubs, Studio viewer charts, physical deploy docs, and one-shot scripts so VPS vs physical can be toggled later without losing WIP.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 22:42:40 -05:00

58 lines
1.8 KiB
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import paramiko
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
def ssh(h, p, u, pw):
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect(h, p, u, pw, timeout=45, allow_agent=False, look_for_keys=False)
return c
def run(c, cmd, t=60):
_, o, e = c.exec_command(cmd, timeout=t)
return (o.read() + e.read()).decode("utf-8", "replace")
v = ssh("107.173.30.245", 22, "root", "Xiao4669805")
print("=== OVERSEAS ===")
print(
run(
v,
r"""
curl -sS -m 15 -o /dev/null -w 'dylive=%{http_code} t=%{time_total}s\n' https://dylive.nomadro.com/api/health
curl -sS -m 15 -o /dev/null -w 'com_api=%{http_code} t=%{time_total}s\n' https://dy.nomadro.com/api/health
curl -sS -m 15 -o /dev/null -w 'com_neko=%{http_code} t=%{time_total}s\n' https://dy.nomadro.com/neko/1/
curl -sS -m 15 -o /dev/null -w 'cn_api=%{http_code} t=%{time_total}s\n' https://dy.nomadro.cn/api/health
curl -sS -m 15 -o /dev/null -w 'cn_neko=%{http_code} t=%{time_total}s\n' https://dy.nomadro.cn/neko/1/
echo '--- dy.com upstream ---'
grep -E '10\.(8|9)\.0\.' /etc/caddy/sites/dy.nomadro.com.caddy | head -3
echo '--- wg ---'
wg show wg-dy | head -8
wg show wg-dy-cn | head -8
""",
90,
)
)
v.close()
d = ssh("82.157.112.245", 22, "ubuntu", "Xiao4669805")
print("=== TENCENT ===")
print(
run(
d,
r"""
curl -sS -m 10 -o /dev/null -w 'cn_local_api=%{http_code} t=%{time_total}s\n' https://dy.nomadro.cn/api/health
curl -sS -m 8 -o /dev/null -w 'hub_to_app=%{http_code} t=%{time_total}s\n' http://10.9.0.2:8014/api/health
systemctl is-active caddy 2>/dev/null || echo caddy_inactive
sudo wg show wg-dy-cn | head -15
""",
40,
)
)
d.close()