nomadro/apps/admin/deploy/debug_remote.py
eric 3e5b7c2098 Monorepo super-optimize: src layout, workspace scripts, docs.
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>
2026-10-01 00:34:04 +08:00

24 lines
691 B
Python

import paramiko
from pathlib import Path
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("82.157.112.245", username="ubuntu", password="Xiao4669805", timeout=20)
cmd = """
journalctl -u nomadmini-api -n 50 --no-pager
echo '---'
ls -la /opt/nomadmini/backend/app
echo '---'
cd /opt/nomadmini/backend && ./.venv/bin/python -c 'import app.main' 2>&1
echo '---'
ss -ltnp | grep 8000 || true
echo '---'
ls -la /etc/nginx/sites-enabled/
echo '---'
cat /etc/nginx/sites-enabled/nomadmini | head -20
"""
_, o, _ = c.exec_command(cmd)
Path("deploy/remote-check2.txt").write_text(o.read().decode("utf-8", "replace"), encoding="utf-8")
c.close()
print("ok")