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>
38 lines
1.7 KiB
Python
38 lines
1.7 KiB
Python
# -*- coding: utf-8 -*-
|
|
import sys
|
|
import time
|
|
|
|
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)
|
|
time.sleep(8)
|
|
cmd = r"""
|
|
docker ps --format '{{.Names}} {{.Status}}' | grep neko
|
|
echo '=== supervisord programs ==='
|
|
docker exec douyinweb-neko-1 supervisorctl status 2>/dev/null || docker exec douyinweb-neko-1 sh -c 'ps aux | grep -E "chrome|http.server|browser-launch|tamper" | grep -v grep'
|
|
echo '=== profile TM ==='
|
|
P=/opt/douyinWEB/backend/data/neko/profiles/1
|
|
ls "$P/Default/Extensions" 2>/dev/null | head
|
|
ls "$P/Default/Local Extension Settings" 2>/dev/null | head
|
|
grep -a -l 'YouTube Studio Auto Dismiss' -R "$P/Default/Local Extension Settings" 2>/dev/null | head -3 || echo 'script marker not in profile yet'
|
|
echo '=== chrome log tail ==='
|
|
docker exec douyinweb-neko-1 sh -c 'tail -n 40 /var/log/neko/google-chrome.log 2>/dev/null || tail -n 40 /var/log/neko/chromium.log 2>/dev/null || ls /var/log/neko 2>/dev/null'
|
|
echo '=== provisioning ==='
|
|
docker exec douyinweb-neko-1 sh -c 'curl -fsS http://127.0.0.1:18080/tampermonkey-provisioning.json | head -c 120; echo; curl -fsS -o /dev/null -w %{http_code} http://127.0.0.1:8080/'
|
|
echo
|
|
cd /opt/douyinWEB/backend && .venv/bin/python - <<'PY'
|
|
from app import youtube_neko
|
|
for i in (1,2):
|
|
s=youtube_neko._container_state(i)
|
|
print(i, s.get('status'), 'ready', s.get('ready'), 'url', s.get('studio_url'))
|
|
print(youtube_neko.status_summary(desired=2).get('assets'))
|
|
PY
|
|
"""
|
|
_i, o, e = c.exec_command(cmd, timeout=90)
|
|
print(o.read().decode("utf-8", "replace"))
|
|
print(e.read().decode("utf-8", "replace")[:800])
|
|
c.close()
|