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>
30 lines
863 B
Python
30 lines
863 B
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import annotations
|
|
|
|
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("107.173.30.245", 22, "root", "Xiao4669805", timeout=30, allow_agent=False, look_for_keys=False)
|
|
|
|
|
|
def run(cmd: str, timeout: int = 120) -> str:
|
|
_, o, e = c.exec_command(cmd, timeout=timeout)
|
|
return (o.read() + e.read()).decode("utf-8", "replace").strip()
|
|
|
|
|
|
print("[status]", run("cd /opt/douyinWEB && git status -sb && git log --oneline -3"))
|
|
print("[diffstat]", run("cd /opt/douyinWEB && git diff --stat"))
|
|
print(
|
|
"[diff heads]",
|
|
run(
|
|
"cd /opt/douyinWEB && git diff -- backend/app/main.py | head -80; "
|
|
"echo '---'; git diff -- frontend/src/app/ops/page.tsx | head -40"
|
|
),
|
|
)
|
|
c.close()
|