douyinWEB/scripts/_check_cover_after_fix.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

28 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
import sys
import paramiko
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
cmds = [
"systemctl is-active douyinweb-api douyinweb-s3",
"""KEY=$(cd /opt/douyinWEB/backend && .venv/bin/python -c "from app import db
for s in db.list_active_sessions():
cp=str(s.get('cover_path') or '')
if '/douyin-covers/' in cp:
print(cp.split('/douyin-covers/',1)[-1]); break")
echo key=$KEY
[ -n "$KEY" ] && curl -sS -o /dev/null -w 'anon=%{http_code} sz=%{size_download}\n' "http://127.0.0.1:8333/douyin-covers/$KEY"
[ -n "$KEY" ] && curl -sS -o /dev/null -w 'nginx=%{http_code} sz=%{size_download}\n' -k "https://127.0.0.1/douyin-covers/$KEY" -H 'Host: dy.nomadro.live'""",
"curl -sS -o /dev/null -w 'health=%{http_code}\n' http://127.0.0.1:8014/api/health",
]
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("108.174.50.68", 22, "root", "Xiao4669805", timeout=45, allow_agent=False, look_for_keys=False)
for cmd in cmds:
print("\n===", cmd[:60], "===")
_i, o, e = c.exec_command(cmd, timeout=60)
print(o.read().decode("utf-8", "replace"))
c.close()