# -*- coding: utf-8 -*- """Deploy OAuth via ShellCrash proxy + verify Google reachability.""" from __future__ import annotations import sys import time from pathlib import Path import paramiko sys.stdout.reconfigure(encoding="utf-8", errors="replace") ROOT = Path(__file__).resolve().parents[1] HUB = ROOT / "backend" / "app" / "shorts_oauth.py" def main(): g = paramiko.SSHClient() g.set_missing_host_key_policy(paramiko.AutoAddPolicy()) g.connect("107.173.30.245", 4014, "eric", "4669805", timeout=40, banner_timeout=80, allow_agent=False, look_for_keys=False) sftp = g.open_sftp() sftp.put(str(HUB), "/tmp/_up_shorts_oauth.py") sftp.close() cmd = r""" echo '4669805' | sudo -S -p '' bash -lc ' set -e install -m 644 /tmp/_up_shorts_oauth.py /opt/douyinWEB/backend/app/shorts_oauth.py cd /opt/douyinWEB/backend && .venv/bin/python -m py_compile app/shorts_oauth.py # verify google via proxy .venv/bin/python - <