Initial commit: Consolidated DevOps scripts and K8s manifests
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import urllib.request, json
|
||||
|
||||
pb_key = "pk1_6e51c25cc1f0ded78246f0a4cd4a3cef404c47308dcc2f8b66bf8065ec6350bf"
|
||||
pb_secret = "sk1_7dc521cdfb1a987285af2b811333e2fed77ba1013559c6671e25f948305d4f29"
|
||||
domain = "makeanyplace.org"
|
||||
nameservers = ["adrian.ns.cloudflare.com", "buck.ns.cloudflare.com"]
|
||||
|
||||
print(f"Updating nameservers for {domain} on Porkbun...")
|
||||
|
||||
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'}
|
||||
)
|
||||
|
||||
try:
|
||||
pb_resp = json.loads(urllib.request.urlopen(pb_req).read())
|
||||
print(f"Success! Porkbun Response: {pb_resp}")
|
||||
except Exception as e:
|
||||
print(f"Failed to update Porkbun: {e}")
|
||||
Reference in New Issue
Block a user