Ship Steam login, D1 player sync, and cached「我」dashboard.

Players get a fast TTL-backed homepage (local profile / Cloudflare D1) with dense UI polish; login unlocks /home without blocking on every OpenDota refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
voson
2026-08-01 01:24:30 +08:00
co-authored by Cursor
parent 4a61aeeb26
commit f5b7011c45
65 changed files with 7304 additions and 552 deletions
+37
View File
@@ -409,6 +409,42 @@ def bind_domain(
ensure_cname(email, api_key, domain, project)
def check_player_bindings(email: str, api_key: str, account_id: str, project: str) -> None:
"""Warn (do not abort) if D1/Queue bindings for player pages are missing."""
data = cf_api(
"GET",
f"/accounts/{account_id}/pages/projects/{project}",
email=email,
api_key=api_key,
)
if not data.get("success"):
print("warning: could not verify Pages player bindings")
return
prod = ((data.get("result") or {}).get("deployment_configs") or {}).get(
"production"
) or {}
d1 = prod.get("d1_databases") or {}
queues = prod.get("queue_producers") or {}
r2 = prod.get("r2_buckets") or {}
missing = []
if "DB" not in d1:
missing.append("D1:DB")
if "SYNC_QUEUE" not in queues:
missing.append("Queue:SYNC_QUEUE")
if missing:
print(
"warning: Pages missing player bindings "
f"{', '.join(missing)} — run python web/cloudflare/provision.py"
)
else:
print("pages player bindings: DB + SYNC_QUEUE ok")
if "MATCHES" not in r2:
print(
"note: R2 MATCHES not bound yet "
"(enable R2 in Dashboard, then re-run provision.py)"
)
def main() -> None:
ap = argparse.ArgumentParser(description="Deploy Climperor web site to Cloudflare Pages")
ap.add_argument("--no-export", action="store_true", help="skip re-export, deploy existing dist")
@@ -441,6 +477,7 @@ def main() -> None:
print(f"account_id: {account_id}")
ensure_project(email, api_key, account_id, args.project_name)
check_player_bindings(email, api_key, account_id, args.project_name)
if not args.no_export:
run_export(args.ability_video_base, args.static_asset_base)