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>
28 lines
1.2 KiB
Python
28 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
import json
|
|
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("108.174.50.68", 22, "root", "Xiao4669805", timeout=30, allow_agent=False, look_for_keys=False)
|
|
|
|
sh = r"""#!/bin/bash
|
|
set -e
|
|
curl -sS -c /tmp/dy.ck -X POST http://127.0.0.1:8014/api/auth/login \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{"username":"hackrobot","password":"Xiao4669805@"}' > /dev/null
|
|
echo "=== local status ==="
|
|
curl -sS -b /tmp/dy.ck http://127.0.0.1:8014/api/shorts/status | python3 -c "import sys,json; d=json.load(sys.stdin); print('oauth_redirect_uri:', d.get('oauth_redirect_uri'))"
|
|
echo "=== public status ==="
|
|
curl -sS -b /tmp/dy.ck https://dy.nomadro.live/api/shorts/status | python3 -c "import sys,json; d=json.load(sys.stdin); print('oauth_redirect_uri:', d.get('oauth_redirect_uri'))"
|
|
echo "=== db value ==="
|
|
sqlite3 /opt/douyinWEB/backend/data/monitor.db "SELECT value FROM kv_settings WHERE key='shorts_oauth_redirect_uri';"
|
|
"""
|
|
|
|
_, o, e = c.exec_command(f"bash -s <<'EOF'\n{sh}\nEOF", timeout=60)
|
|
print((o.read() + e.read()).decode("utf-8", "replace"))
|
|
c.close()
|