Commit 449a538e authored by Joshua Tauberer's avatar Joshua Tauberer

if a CNAME is set for a domain, don't create a website for that domain (just like A/AAAA records)

parent 3c50c9a1
...@@ -24,6 +24,7 @@ Web: ...@@ -24,6 +24,7 @@ Web:
* The nginx server no longer reports its version and OS for better privacy. * The nginx server no longer reports its version and OS for better privacy.
* The HTTP->HTTPS redirect is now more efficient. * The HTTP->HTTPS redirect is now more efficient.
* When serving a 'www.' domain, reuse the SSL certificate for the parent domain if it covers the 'www' subdomain too * When serving a 'www.' domain, reuse the SSL certificate for the parent domain if it covers the 'www' subdomain too
* If a custom DNS CNAME record is set on a domain, don't offer to put a website on that domain. (Same logic already applies to custom A/AAAA records.)
Control panel: Control panel:
......
...@@ -27,6 +27,7 @@ def get_web_domains(env): ...@@ -27,6 +27,7 @@ def get_web_domains(env):
for domain, value in dns.items(): for domain, value in dns.items():
if domain not in domains: continue if domain not in domains: continue
if (isinstance(value, str) and (value != "local")) \ if (isinstance(value, str) and (value != "local")) \
or (isinstance(value, dict) and ("CNAME" in value)) \
or (isinstance(value, dict) and ("A" in value) and (value["A"] != "local")) \ or (isinstance(value, dict) and ("A" in value) and (value["A"] != "local")) \
or (isinstance(value, dict) and ("AAAA" in value) and (value["AAAA"] != "local")): or (isinstance(value, dict) and ("AAAA" in value) and (value["AAAA"] != "local")):
domains.remove(domain) domains.remove(domain)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment