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>
24 lines
758 B
Python
24 lines
758 B
Python
# -*- coding: utf-8 -*-
|
|
import paramiko
|
|
|
|
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)
|
|
sftp = c.open_sftp()
|
|
sftp.put(
|
|
r"C:/Users/admin/Desktop/douyinWEB/frontend/src/app/shorts/reauth-batch/page.tsx",
|
|
"/opt/douyinWEB/frontend/src/app/shorts/reauth-batch/page.tsx",
|
|
)
|
|
sftp.close()
|
|
|
|
|
|
def run(cmd, timeout=240):
|
|
_, o, e = c.exec_command(cmd, timeout=timeout)
|
|
return (o.read() + e.read()).decode("utf-8", "replace").strip()
|
|
|
|
|
|
print(run("cd /opt/douyinWEB/frontend && npm run build 2>&1 | tail -8"))
|
|
print(run("systemctl restart douyinweb-web; systemctl is-active douyinweb-web"))
|
|
c.close()
|
|
print("DONE")
|