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>
75 lines
3.1 KiB
Python
75 lines
3.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""Diagnose neko black screen on physical deploy."""
|
|
import sys
|
|
import paramiko
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
|
|
PVE = ("107.173.30.245", 4014, "eric", "4669805")
|
|
VPS = ("107.173.30.245", 22, "root", "Xiao4669805")
|
|
|
|
|
|
def run(host, port, user, pwd, cmd, sudo=False, timeout=45):
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect(host, port, user, pwd, timeout=25, allow_agent=False, look_for_keys=False)
|
|
full = cmd
|
|
if sudo and user != "root":
|
|
full = f"echo '{pwd}' | sudo -S -p '' bash -c {repr(cmd)}"
|
|
_, o, e = c.exec_command(full, timeout=timeout)
|
|
out = o.read().decode("utf-8", "replace")
|
|
err = e.read().decode("utf-8", "replace")
|
|
c.close()
|
|
return out, err
|
|
|
|
|
|
def section(title):
|
|
print("\n" + "=" * 60)
|
|
print(title)
|
|
print("=" * 60)
|
|
|
|
|
|
def main():
|
|
section("PVE Ubuntu (physical) - neko1")
|
|
pve_cmds = [
|
|
"docker ps -a --filter name=neko --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'",
|
|
"docker logs neko1 --tail 80 2>&1",
|
|
"docker exec neko1 supervisorctl status 2>&1 || true",
|
|
"docker exec neko1 ls -la /etc/neko/browser-launch.sh 2>&1 || true",
|
|
"ls -la /opt/douyinWEB/backend/neko/browser-launch.sh 2>&1 || ls -la ~/douyinWEB/backend/neko/browser-launch.sh 2>&1 || find /opt /home -name browser-launch.sh 2>/dev/null | head -5",
|
|
"curl -s -o /dev/null -w 'http_9200:%{http_code}' http://127.0.0.1:9200/ ; echo",
|
|
"curl -s -o /dev/null -w 'http_0_9200:%{http_code}' http://0.0.0.0:9200/ ; echo",
|
|
"ss -tlnp | grep 920 || true",
|
|
"cat /opt/douyinWEB/backend/data/neko/docker-compose.yml 2>/dev/null | head -80 || cat ~/douyinWEB/backend/data/neko/docker-compose.yml 2>/dev/null | head -80",
|
|
"ip -4 addr show wg-dy 2>/dev/null | head -5",
|
|
"systemctl is-active dylive-api 2>/dev/null || systemctl is-active douyinweb 2>/dev/null || true",
|
|
"grep -E 'DY_NEKO|NEKO' /etc/systemd/system/dylive*.service /etc/systemd/system/douyin*.service 2>/dev/null || env | grep -i neko || true",
|
|
]
|
|
for cmd in pve_cmds:
|
|
print(f"\n--- {cmd[:70]}...")
|
|
out, err = run(*PVE, cmd, sudo=True)
|
|
print(out.rstrip())
|
|
if err.strip():
|
|
print("STDERR:", err.rstrip())
|
|
|
|
section("VPS (Caddy edge) - dy.nomadro.com")
|
|
vps_cmds = [
|
|
"grep -rn neko /etc/caddy/ 2>/dev/null | head -30",
|
|
"cat /etc/caddy/sites/dy.nomadro.com.caddy 2>/dev/null || cat /etc/caddy/Caddyfile 2>/dev/null",
|
|
"curl -sk -I https://dy.nomadro.com/neko/1/ 2>&1 | head -25",
|
|
"curl -s -o /dev/null -w 'wg_9200:%{http_code}' http://10.8.0.2:9200/ ; echo",
|
|
"ping -c1 -W2 10.8.0.2 2>&1",
|
|
"wg show wg-dy 2>&1 | head -15",
|
|
"journalctl -u caddy --no-pager -n 30 2>&1 | grep -i neko || journalctl -u caddy --no-pager -n 15 2>&1",
|
|
]
|
|
for cmd in vps_cmds:
|
|
print(f"\n--- {cmd[:70]}...")
|
|
out, err = run(*VPS, cmd)
|
|
print(out.rstrip())
|
|
if err.strip():
|
|
print("STDERR:", err.rstrip())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|