Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions infra/github-backup/bin/drain_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion infra/github-backup/worker/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down