Collapse portal under src/, unify pnpm workspace/scripts, thin VIP topic re-exports, drop orphan vip scaffolds and one-shot scripts, ignore xhs/release, document root commands. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
1.0 KiB
Python
29 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
import time
|
|
from pathlib import Path
|
|
|
|
import paramiko
|
|
|
|
HOST, USER, PASS = "82.157.112.245", "ubuntu", "Xiao4669805"
|
|
LOCAL = Path(__file__).resolve().parents[1] / "backend/app/services/tt_platform_config.py"
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect(HOST, username=USER, password=PASS, timeout=30, allow_agent=False, look_for_keys=False)
|
|
sftp = c.open_sftp()
|
|
sftp.put(str(LOCAL), "/tmp/tt_platform_config.py")
|
|
sftp.close()
|
|
|
|
cmd = """
|
|
sudo cp /tmp/tt_platform_config.py /opt/nomadmini/backend/app/services/tt_platform_config.py
|
|
sudo systemctl restart nomadmini-api
|
|
sleep 4
|
|
systemctl is-active nomadmini-api
|
|
curl -sk -o /dev/null -w 'api_health %{http_code}\\n' https://api.nomadro.cn/health
|
|
curl -sk -o /dev/null -w 'dy_meta %{http_code}\\n' https://admin.nomadro.cn/api/admin/douyin/meta
|
|
journalctl -u nomadmini-api -n 12 --no-pager
|
|
"""
|
|
_, stdout, _ = c.exec_command(cmd, timeout=60, get_pty=True)
|
|
print(stdout.read().decode("utf-8", "replace"))
|
|
c.close()
|