douyinWEB/scripts/_deploy_reauth_batch.py
eric d409e416da Ship physical dual-edge stack, Studio CDP live metrics, and ops tooling.
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>
2026-09-04 22:42:40 -05:00

36 lines
1.2 KiB
Python

# -*- coding: utf-8 -*-
"""Deploy profile B batch reauth page."""
import paramiko
FILES = [
"backend/app/shorts_oauth.py",
"backend/app/main.py",
"frontend/src/app/shorts/reauth-batch/page.tsx",
]
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()
def run(cmd, timeout=240):
_, o, e = c.exec_command(cmd, timeout=timeout)
return (o.read() + e.read()).decode("utf-8", "replace").strip()
run("mkdir -p /opt/douyinWEB/frontend/src/app/shorts/reauth-batch")
for rel in FILES:
remote = f"/opt/douyinWEB/{rel.replace(chr(92), '/')}"
local = f"C:/Users/admin/Desktop/douyinWEB/{rel.replace(chr(92), '/')}"
print("[upload]", rel)
sftp.put(local, remote)
sftp.close()
print(run("systemctl restart douyinweb-api; sleep 4; systemctl is-active douyinweb-api"))
print(run("cd /opt/douyinWEB/frontend && npm run build 2>&1 | tail -6"))
print(run("systemctl restart douyinweb-web; systemctl is-active douyinweb-web"))
c.close()
print("DONE")
print("OPEN: https://dylive.nomadro.com/shorts/reauth-batch?profile=B")