nomadro/apps/admin/deploy/_fix_config_ws_nginx2.py
Eric 4389ebe6cb Ship WeChat audit release 2026-11-02: realtime config, audit vip-ebook shell, admin ops.
Document test9 tag 2026-11-02 for upload; POST config pull + WS, fixed dark home, no debug bar.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-02 16:12:57 +08:00

31 lines
999 B
Python

# -*- coding: utf-8 -*-
from __future__ import annotations
import paramiko
HOST, USER, PASS = "82.157.112.245", "ubuntu", "Xiao4669805"
REMOTE = r"""
set -e
echo '=== find api host conf ==='
sudo grep -RIl 'api.nomadro.cn' /www/server/panel/vhost/nginx /etc/nginx /www/server/nginx/conf 2>/dev/null | head -30
echo '=== find 8010 ==='
sudo grep -RIl '8010' /www/server/panel/vhost/nginx /etc/nginx /www/server/nginx/conf 2>/dev/null | head -30
echo '=== our bak? ==='
ls -la /www/server/panel/vhost/nginx/api.nomadro.cn.conf* 2>/dev/null || true
ls -la /www/server/panel/vhost/nginx/*.bak-config-ws 2>/dev/null || true
"""
def main() -> None:
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)
_, stdout, _ = c.exec_command(REMOTE, timeout=90)
print(stdout.read().decode("utf-8", "replace"))
c.close()
if __name__ == "__main__":
main()