douyinWEB/scripts/_check_studio_cookies.py
eric d409e416da Ship physical dual-edge stack, Studio CDP live metrics, and ops tooling.
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>
2026-09-04 22:42:40 -05:00

21 lines
749 B
Python

# -*- coding: utf-8 -*-
import paramiko
script = """import sys, json
sys.path.insert(0, '/opt/douyinWEB/backend')
from app import db
s = db.get_settings_map()
keys = [k for k in s if any(x in k.lower() for x in ('cookie','studio','sapisid','session_token','google'))]
print('matching keys', keys)
for k in keys:
v = str(s.get(k) or '')
print(k, v[:80] + ('...' if len(v)>80 else ''))
"""
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)
_, o, e = c.exec_command(f"cd /opt/douyinWEB/backend && .venv/bin/python - <<'PY'\n{script}\nPY", timeout=60)
print(o.read().decode("utf-8", "replace"))
c.close()