fix: Stop duplicating A and TLSA records and fix alts
All checks were successful
Build Docker / Build SLDs Image (push) Successful in 19s
Build Docker / Build Main Image (push) Successful in 21s

This commit is contained in:
Nathan Woodburn 2023-12-12 14:51:38 +11:00
parent f68186314b
commit 3c6829826f
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

21
varo.py
View File

@ -204,7 +204,7 @@ def verify_ALIAS(domain):
"action": "getRecords",
"zone": zone,
"name": domain+"."+city_domain,
"type": "ALIAS",
"type": "A",
"content": ""
}
url = "https://reg.woodburn.au/api"
@ -281,16 +281,15 @@ def copy_to_alts(domain):
}
r = requests.post(url, headers=headers, json=data)
r = r.json()
if 'data' not in r:
continue
for record in r['data']:
data = {
"action": "deleteRecord",
"zone": alt_zone,
"record": record['uuid']
}
r = requests.post(url, headers=headers, json=data)
print(r.text)
if 'data' in r:
for record in r['data']:
data = {
"action": "deleteRecord",
"zone": alt_zone,
"record": record['uuid']
}
r = requests.post(url, headers=headers, json=data)
print(r.text)
# Add each record to each alt
for record in records: