Shield external portal jumps (keep EXTERNAL_* for later), serve /nav from static build, and proxy /book + /community to vertical Next apps with Caddy notes. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
797 B
Python
27 lines
797 B
Python
import paramiko
|
|
from pathlib import Path
|
|
|
|
conf = Path("deploy/admin.nomadro.cn.conf").read_text(encoding="utf-8")
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("82.157.112.245", username="ubuntu", password="Xiao4669805", timeout=20)
|
|
|
|
sftp = c.open_sftp()
|
|
with sftp.file("/tmp/admin.nomadro.cn.conf", "w") as f:
|
|
f.write(conf)
|
|
sftp.close()
|
|
|
|
cmd = """
|
|
sudo cp /tmp/admin.nomadro.cn.conf /www/server/panel/vhost/nginx/admin.nomadro.cn.conf
|
|
sudo nginx -t && sudo /etc/init.d/nginx reload
|
|
curl -sI https://admin.nomadro.cn/ | head -8
|
|
echo '---'
|
|
curl -s https://admin.nomadro.cn/ | head -c 120
|
|
echo
|
|
"""
|
|
_, o, _ = c.exec_command(cmd)
|
|
Path("deploy/admin-ssl-fix.txt").write_text(o.read().decode("utf-8", "replace"), encoding="utf-8")
|
|
c.close()
|
|
print("ok")
|