Cloudflare DNS: allow AAAA proxying + harden addDeleteDNSRecordsCloudFlare

- dnsManager.py: include AAAA in record types that get proxied flag on
  update (was only A, CNAME); fix HTTP 500 by hardening loadCFKeys and
  addDeleteDNSRecordsCloudFlare (safe file read, always pass
  domainsList/cfEmail/cfToken to template).
- dnsUtilities.py: A, AAAA and CNAME can be proxied in Cloudflare;
  set proxied only for those types; MX, TXT, etc. cannot be proxied.
This commit is contained in:
master3395
2026-02-17 02:16:22 +01:00
committed by KraoESPfan1n
parent be0d8a84b1
commit 28f9c6ceae
2 changed files with 58 additions and 36 deletions

View File

@@ -716,14 +716,14 @@ class DNS:
value = value.replace('\n\t', '')
value = value.replace('"', '')
# Only A and CNAME records can be proxied in CloudFlare
# Determine if proxy should be enabled (default: True for A/CNAME, except for mail domains)
if proxied is None and type in ['A', 'CNAME']:
# A, AAAA and CNAME records can be proxied in CloudFlare.
# Determine if proxy should be enabled (default: True, except for mail domains).
if proxied is None and type in ['A', 'AAAA', 'CNAME']:
# Check if this is a mail domain (starts with 'mail.' or contains 'mail.')
is_mail_domain = name.lower().startswith('mail.') or '.mail.' in name.lower()
proxied = not is_mail_domain
elif type not in ['A', 'CNAME']:
# AAAA, MX, TXT, etc. cannot be proxied
elif type not in ['A', 'AAAA', 'CNAME']:
# MX, TXT, etc. cannot be proxied
proxied = False
if ttl > 0:
@@ -731,8 +731,8 @@ class DNS:
else:
dns_record = {'name': name, 'type': type, 'content': value, 'priority': priority}
# Only add proxied parameter for A and CNAME records
if type in ['A', 'CNAME']:
# Only add proxied parameter for A, AAAA and CNAME records
if type in ['A', 'AAAA', 'CNAME']:
dns_record['proxied'] = proxied
cf.zones.dns_records.post(zone, data=dns_record)