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>
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
"""Print Pages deployment_configs keys relevant to bindings (no secrets)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import urllib.request
|
|
|
|
ACCT = "510534f7f6284344aadaf2f5a0794d48"
|
|
PROJ = "climperor-relations"
|
|
|
|
|
|
def main() -> int:
|
|
email = os.environ.get("CLOUDFLARE_EMAIL") or os.environ.get(
|
|
"KEYZOO_ASSET_META_USERNAME"
|
|
)
|
|
key = os.environ.get("CLOUDFLARE_API_KEY") or os.environ.get(
|
|
"KEYZOO_ASSET_SECRET_GLOBAL_API_KEY"
|
|
)
|
|
req = urllib.request.Request(
|
|
f"https://api.cloudflare.com/client/v4/accounts/{ACCT}/pages/projects/{PROJ}",
|
|
headers={"X-Auth-Email": email, "X-Auth-Key": key},
|
|
)
|
|
with urllib.request.urlopen(req, timeout=60) as resp:
|
|
data = json.load(resp)
|
|
dc = (data.get("result") or {}).get("deployment_configs") or {}
|
|
for env in ("production", "preview"):
|
|
cfg = dc.get(env) or {}
|
|
print(
|
|
env,
|
|
"fail_open=",
|
|
cfg.get("fail_open"),
|
|
"placement=",
|
|
cfg.get("placement"),
|
|
"d1=",
|
|
sorted((cfg.get("d1_databases") or {}).keys()),
|
|
"r2=",
|
|
sorted((cfg.get("r2_buckets") or {}).keys()),
|
|
"queues=",
|
|
sorted((cfg.get("queue_producers") or {}).keys()),
|
|
)
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|