douyinWEB/scripts/_debug_tm_hash.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

33 lines
1.3 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("108.174.50.68", 22, "root", "Xiao4669805", timeout=45, allow_agent=False, look_for_keys=False)
cmd = r"""
python3 - <<'PY'
from pathlib import Path
p=Path('/opt/douyinWEB/backend/data/neko/profiles/1/Default/Managed Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo/000003.log')
print('managed log size', p.stat().st_size if p.exists() else None)
if p.exists():
b=p.read_bytes()
print(b[:500])
print('has Auto Dismiss', b'Auto Dismiss' in b or b'YouTube Studio' in b)
print('has jsonImport', b'jsonImport' in b or b'18080' in b)
PY
# render hash on server
cd /opt/douyinWEB/backend/neko
python3 render_tampermonkey_provisioning.py >/tmp/tm_prov.out 2>/tmp/tm_prov.err || true
tail -5 /tmp/tm_prov.out
cat /tmp/tm_prov.err
# fetch provisioning via container
docker exec douyinweb-neko-1 sh -c 'wget -qO- http://127.0.0.1:18080/tampermonkey-provisioning.json | python3 -c "import sys,json,hashlib,base64; d=json.load(sys.stdin); print(d[\"scripts\"][0][\"name\"], len(d[\"scripts\"][0][\"source\"]))"'
"""
_i, o, e = c.exec_command(cmd, timeout=60)
print(o.read().decode("utf-8", "replace"))
print(e.read().decode("utf-8", "replace")[:1000])
c.close()