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>
43 lines
1.5 KiB
Python
43 lines
1.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
import sys
|
|
|
|
import paramiko
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
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)
|
|
|
|
|
|
def run(cmd, timeout=90):
|
|
_, o, e = c.exec_command(cmd, timeout=timeout)
|
|
out = (o.read() + e.read()).decode("utf-8", "replace")
|
|
print(out[-10000:] if len(out) > 10000 else out)
|
|
return out
|
|
|
|
|
|
print("=== follow redirects login page ===")
|
|
run(
|
|
"curl -skSL https://dylive.nomadro.com/login 2>/dev/null | grep -c 'data:text/javascript;base64'; "
|
|
"curl -skSL https://dylive.nomadro.com/ 2>/dev/null | grep -c 'data:text/javascript;base64'; "
|
|
"curl -sS http://127.0.0.1:4015/login 2>/dev/null | grep -c 'data:text/javascript;base64'; "
|
|
"echo '---snippet---'; "
|
|
"curl -skSL https://dylive.nomadro.com/login 2>/dev/null | tr '\\n' ' ' | grep -oE 'script[^>]{0,200}' | head -20"
|
|
)
|
|
|
|
print("=== caddy config ===")
|
|
run(
|
|
"ls /etc/caddy /opt/caddy 2>/dev/null; "
|
|
"find /etc /opt /root -name 'Caddyfile*' 2>/dev/null | head -20; "
|
|
"systemctl cat caddy 2>/dev/null | head -40"
|
|
)
|
|
|
|
print("=== caddyfile content dylive ===")
|
|
run(
|
|
"grep -RIn --include='Caddyfile*' --include='*.caddy' -E 'dylive|nomadro|inject|replace|respond|header|handle' /etc/caddy /opt 2>/dev/null | head -60; "
|
|
"sed -n '1,200p' /etc/caddy/Caddyfile 2>/dev/null; echo '===='; "
|
|
"ls /etc/caddy/sites /etc/caddy/conf.d 2>/dev/null"
|
|
)
|
|
|
|
c.close()
|