diff --git a/infra/github-backup/bin/drain_queue.py b/infra/github-backup/bin/drain_queue.py index 64e0bf889e..26d74cb4c6 100644 --- a/infra/github-backup/bin/drain_queue.py +++ b/infra/github-backup/bin/drain_queue.py @@ -28,6 +28,9 @@ def worker_req(path, payload=None): data = json.dumps(payload).encode() if payload is not None else None req = urllib.request.Request(url, data=data, method="POST" if data else "GET") req.add_header("Authorization", "Bearer " + os.environ["GHB_WORKER_BEARER"]) + # Cloudflare's edge bot-filters the default Python-urllib UA (403); + # a plain browser UA is required for this poller to reach the Worker. + req.add_header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36") if data: req.add_header("Content-Type", "application/json") with urllib.request.urlopen(req, timeout=60) as r: diff --git a/infra/github-backup/worker/wrangler.toml b/infra/github-backup/worker/wrangler.toml index d2a389079a..ed0b58f3f0 100644 --- a/infra/github-backup/worker/wrangler.toml +++ b/infra/github-backup/worker/wrangler.toml @@ -7,7 +7,7 @@ compatibility_date = "2024-11-01" # then paste the id here (ids are not secrets; they name the namespace). [[kv_namespaces]] binding = "GHB_EVENTS" -id = "REPLACE_WITH_KV_NAMESPACE_ID" +id = "46b1fe46e6434c5fa509556ed3a53ea2" # Secrets (never in this file): # wrangler secret put GITHUB_WEBHOOK_SECRET # same value as on the App