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

manage the nginx conf in the management daemon too so we can have nginx operate on all domains that we serve mail for

This commit is contained in:
Joshua Tauberer
2014-06-20 01:16:38 +00:00
parent a1a80b295e
commit 5faa1cae71
7 changed files with 133 additions and 22 deletions

View File

@@ -11,6 +11,11 @@ def load_env_vars_from_file(fn):
for line in open(fn): env.setdefault(*line.strip().split("=", 1))
return env
def safe_domain_name(name):
# Sanitize a domain name so it is safe to use as a file name on disk.
import urllib.parse
return urllib.parse.quote(name, safe='')
def exclusive_process(name):
# Ensure that a process named `name` does not execute multiple
# times concurrently.