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>
31 lines
1.2 KiB
Python
31 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
import sys
|
|
|
|
import paramiko
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
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)
|
|
cmd = r"""
|
|
docker ps -a --filter name=douyinweb-neko --format '{{.Names}} {{.Status}}'
|
|
docker logs --tail 80 douyinweb-neko-1 2>&1
|
|
echo '--- start ---'
|
|
docker start douyinweb-neko-1
|
|
sleep 12
|
|
docker ps --filter name=douyinweb-neko --format '{{.Names}} {{.Status}}'
|
|
docker exec douyinweb-neko-1 supervisorctl status || true
|
|
docker exec douyinweb-neko-1 sh -c 'for f in /proc/[0-9]*/cmdline; do tr "\0" " " < "$f"; echo; done' 2>/dev/null | grep -E 'load-extension|browser-launch' | head -10 || true
|
|
cd /opt/douyinWEB/backend && .venv/bin/python - <<'PY'
|
|
from app import youtube_neko
|
|
print(youtube_neko.status_summary(desired=2).get('assets'))
|
|
for i in youtube_neko.list_instances(2):
|
|
print(i.get('id'), i.get('status'), i.get('ready'), i.get('studio_url'))
|
|
PY
|
|
"""
|
|
_i, o, e = c.exec_command(cmd, timeout=120)
|
|
o.channel.settimeout(120)
|
|
print(o.read().decode("utf-8", "replace"))
|
|
print(e.read().decode("utf-8", "replace")[:1000])
|
|
c.close()
|