1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-12-01 22:41:53 +02:00

try to get LE certs for the new names

This commit is contained in:
Florent Daigniere
2022-03-10 12:31:01 +01:00
parent a3f9e2beee
commit 81b592f3cb
2 changed files with 9 additions and 3 deletions

View File

@@ -4,10 +4,16 @@ import os
import time
import subprocess
hostnames = list(set(os.environ['HOSTNAMES'].split(',')))
for hostname in hostnames:
if not hostname.startswith('autoconfig.'):
hostnames.append(f'autoconfig.{hostname}')
hostnames = ','.join(set(hostnames))
command = [
"certbot",
"-n", "--agree-tos", # non-interactive
"-d", os.environ["HOSTNAMES"],
"-d", hostnames, "--expand", "--allow-subset-of-names",
"-m", "{}@{}".format(os.environ["POSTMASTER"], os.environ["DOMAIN"]),
"certonly", "--standalone",
"--cert-name", "mailu",
@@ -20,7 +26,7 @@ command = [
command2 = [
"certbot",
"-n", "--agree-tos", # non-interactive
"-d", os.environ["HOSTNAMES"],
"-d", hostnames, "--expand", "--allow-subset-of-names",
"-m", "{}@{}".format(os.environ["POSTMASTER"], os.environ["DOMAIN"]),
"certonly", "--standalone",
"--cert-name", "mailu-ecdsa",