1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-31 21:17:23 +02:00

s/PUBLIC_HOSTNAME/PRIMARY_HOSTNAME/ throughout

This commit is contained in:
Joshua Tauberer
2014-06-30 09:15:36 -04:00
parent 573faa2bf5
commit fed5959288
9 changed files with 58 additions and 58 deletions

View File

@@ -17,15 +17,15 @@ def safe_domain_name(name):
return urllib.parse.quote(name, safe='')
def sort_domains(domain_names, env):
# Put domain names in a nice sorted order. For web_update, PUBLIC_HOSTNAME
# Put domain names in a nice sorted order. For web_update, PRIMARY_HOSTNAME
# must appear first so it becomes the nginx default server.
# First group PUBLIC_HOSTNAME and its subdomains, then parent domains of PUBLIC_HOSTNAME, then other domains.
# First group PRIMARY_HOSTNAME and its subdomains, then parent domains of PRIMARY_HOSTNAME, then other domains.
groups = ( [], [], [] )
for d in domain_names:
if d == env['PUBLIC_HOSTNAME'] or d.endswith("." + env['PUBLIC_HOSTNAME']):
if d == env['PRIMARY_HOSTNAME'] or d.endswith("." + env['PRIMARY_HOSTNAME']):
groups[0].append(d)
elif env['PUBLIC_HOSTNAME'].endswith("." + d):
elif env['PRIMARY_HOSTNAME'].endswith("." + d):
groups[1].append(d)
else:
groups[2].append(d)