Initial commit: Consolidated DevOps scripts and K8s manifests

This commit is contained in:
codex
2026-06-05 07:00:43 +00:00
commit 08fa407f57
16 changed files with 922 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
import urllib.request, json, sys
cf_token = "cfat_ub1jXkUJinoJDmhiUJJpwQni2rSVnLnysHzvcwwH351fdff8"
cf_account = "e3584bc80d5c6df89d93078172898d73"
pb_key = "pk1_6e51c25cc1f0ded78246f0a4cd4a3cef404c47308dcc2f8b66bf8065ec6350bf"
pb_secret = "sk1_7dc521cdfb1a987285af2b811333e2fed77ba1013559c6671e25f948305d4f29"
domains = ["makeanyplace.com", "makeanyplace.org"]
for domain in domains:
print(f"--- Routing {domain} ---")
# 1. Create Zone in Cloudflare
cf_req = urllib.request.Request(
'https://api.cloudflare.com/client/v4/zones',
data=json.dumps({"name": domain, "account": {"id": cf_account}, "type": "full"}).encode(),
headers={'Authorization': f'Bearer {cf_token}', 'Content-Type': 'application/json'}
)
try:
cf_resp = json.loads(urllib.request.urlopen(cf_req).read())
nameservers = cf_resp['result']['name_servers']
print(f"Cloudflare Zone Created for {domain}. Nameservers: {nameservers}")
except urllib.error.HTTPError as e:
err_body = e.read().decode()
if "already exists" in err_body or e.code == 400:
print(f"Zone {domain} already exists in Cloudflare. Fetching...")
cf_get = urllib.request.Request(
f'https://api.cloudflare.com/client/v4/zones?name={domain}',
headers={'Authorization': f'Bearer {cf_token}', 'Content-Type': 'application/json'}
)
cf_resp = json.loads(urllib.request.urlopen(cf_get).read())
nameservers = cf_resp['result'][0]['name_servers']
print(f"Fetched existing zone nameservers for {domain}: {nameservers}")
else:
print(f"CF Error for {domain}:", err_body)
continue
# 2. Update Porkbun Nameservers
pb_req = urllib.request.Request(
f'https://api.porkbun.com/api/json/v3/domain/updateNs/{domain}',
data=json.dumps({"apikey": pb_key, "secretapikey": pb_secret, "ns": nameservers}).encode(),
headers={'Content-Type': 'application/json'}
)
pb_resp = json.loads(urllib.request.urlopen(pb_req).read())
print(f"Porkbun Update Response for {domain}: {pb_resp}\n")
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
cd /home/antigravity/scratch/makeanyplace-backend
source venv/bin/activate
export DB_HOST=postgres.local
export REDIS_HOST=127.0.0.1
# Run the aggregator
python3 event_aggregator.py
# Copy the updated events file to the local development site frontend
cp live_events.json ../makeanyplace-web/src/live_events.json