This commit is contained in:
gauthiier 2018-11-28 09:54:47 +01:00
parent 6cc2f3e223
commit 2199d81f1e

View File

@ -70,10 +70,10 @@ def vhost_add(domain):
if re.match(re_domain, domain) is None: if re.match(re_domain, domain) is None:
print("Invalid domain name: " + domain + " -> pass") print("Invalid domain name: " + domain + " -> pass")
www = os.path.join(html_dir_path + domain) www = os.path.join(html_dir_path, domain)
os.makedirs(www, exist_ok=True) os.makedirs(www, exist_ok=True)
logs = os.path.join(logs_dir_path + domain) logs = os.path.join(logs_dir_path, domain)
os.makedirs(logs, exist_ok=True) os.makedirs(logs, exist_ok=True)
# debug: this file might not be here # debug: this file might not be here
@ -90,6 +90,12 @@ def vhost_add(domain):
with open(vhost_file, 'w+') as vhost_file_fp: with open(vhost_file, 'w+') as vhost_file_fp:
vhost_file_fp.write(vhost) vhost_file_fp.write(vhost)
# check is ssl cert exists
cert = os.path.join('/etc/letsencrypt/live', domain)
if not os.path.exists(cert):
print("SSL certificates do not exist for domain - " + domain)
print("Please make sure to place them in " + cert + "to allow secure https")
def vhost_remove(domain): def vhost_remove(domain):
print(" removing domain — " + domain) print(" removing domain — " + domain)