fix: audit pass — WebRTC audit, HTTPS gate, leak compare, kill-switch guard, doc backlog
Some checks failed
CI / Test Python 3.10 (push) Has been cancelled
CI / Test Python 3.11 (push) Has been cancelled
CI / Test Python 3.12 (push) Has been cancelled

This commit is contained in:
Dr Jones
2026-05-22 18:00:45 -07:00
parent 255fdf3e8c
commit 04d486a335
9 changed files with 164 additions and 31 deletions

View File

@@ -1773,7 +1773,7 @@ def _main_inner() -> None:
preflight_card = _signup_card(
"Pre-flight check",
"Exhaustive readiness check: chain, exit IP, geo/ASN, DNS leak, WebRTC, "
"IPv6, fingerprint, target site reachability, and direct-IP comparison.",
"IPv6, HTTPS tunnel, target site reachability, and direct-IP comparison.",
)
pf_rows: dict[str, dict[str, ctk.StringVar | ctk.CTkLabel]] = {}
@@ -1853,8 +1853,11 @@ def _main_inner() -> None:
target_host = urlparse(url).hostname or "(unknown)"
def work() -> None:
from .leak_detect import is_chain_leak, leak_reason
timeout = min(15.0, max(8.0, float(svc.settings.validation_timeout_seconds) + 2.0))
warns: list[str] = []
vpn_active = detect_vpn().active
# ── 1. Direct IP (bypass chain) ──────────────────────────────────
from .validator import get_direct_ip as _get_direct_ip
@@ -1882,12 +1885,12 @@ def _main_inner() -> None:
_pf_set("exit_ip", "ok", ip_)
else:
_pf_set("exit_ip", "warn", "no exit IP yet")
# IP leak compare
# IP leak compare (same logic as production leak_detect)
if direct_ip and ip_ and ip_ not in ("", ""):
if direct_ip == ip_:
_pf_set("leak_compare", "fail",
f"exit == direct ({ip_}) — chain not working!")
warns.append("exit IP matches direct IP (chain not routing)")
if is_chain_leak(ip_, direct_ip, vpn_active):
reason = leak_reason(ip_, direct_ip, vpn_active)
_pf_set("leak_compare", "fail", reason[:80])
warns.append(f"IP leak: {reason}")
else:
_pf_set("leak_compare", "ok",
f"exit {ip_} ≠ direct {direct_ip}")
@@ -2148,12 +2151,38 @@ def _main_inner() -> None:
tag = f" [{' · '.join(extras)}]" if extras else ""
signup_status_var.set(f"Opened {label}{tag} — autofill active (you submit + captcha).")
_log(f"Signup prep: opened {url} with autofill extension{tag}.")
# Auto-save entry so the account is recorded even if user forgets to save manually
_save_signup_account()
# Record draft metadata only — password saved when user clicks Save Account
_save_signup_account_draft_only()
else:
signup_status_var.set("Browser launch failed.")
svc.set_sticky(0)
def _save_signup_account_draft_only() -> None:
"""After browser open: save email/exit metadata without password until user confirms."""
draft = _persist_signup_draft()
url = resolve_signup_url(draft)
exit_ip, exit_hop = _current_exit_meta()
preset = SIGNUP_PRESETS.get(draft.site_key)
site_label = preset.label if preset else "Custom"
rec = AccountRecord(
id=datetime.now().strftime("%Y%m%d%H%M%S%f"),
site=site_label,
url=url,
email=draft.email,
password="",
username=draft.username,
first_name=draft.first_name,
last_name=draft.last_name,
exit_ip=exit_ip,
exit_hop=exit_hop,
notes=draft.notes,
status="pending",
created_at=datetime.now().isoformat(timespec="seconds"),
)
append_account(rec)
_refresh_accounts_ui()
_log(f"Signup prep: draft account {draft.email or draft.username} ({site_label}) — save password after signup.")
def _save_signup_account() -> None:
draft = _persist_signup_draft()
url = resolve_signup_url(draft)