Generate a certificate for the proper hostname

master
Pierre Jaury 8 years ago
parent 3e85bb2d73
commit 720db8e72a

@ -45,15 +45,14 @@ def certbot_install(domain):
@scheduler.scheduled_job('cron', hour=2, minute=0) @scheduler.scheduled_job('cron', hour=2, minute=0)
def generate_cert(): def generate_cert():
print("Generating TLS certificates using Certbot") print("Generating TLS certificates using Certbot")
domain = app.config["DOMAIN"] email = "{}@{}".format(app.config["POSTMASTER"], app.config["DOMAIN"])
email = "{}@{}".format(app.config["POSTMASTER"], domain)
result = certbot_command( result = certbot_command(
"certonly", "certonly",
"--standalone", "--standalone",
"--agree-tos", "--agree-tos",
"--preferred-challenges", "http", "--preferred-challenges", "http",
"--email", email, "--email", email,
"-d", domain, "-d", app.config["HOSTNAME"],
# The port is hardcoded in the nginx image as well, we should find # The port is hardcoded in the nginx image as well, we should find
# a more suitable way to go but this will do until we have a proper # a more suitable way to go but this will do until we have a proper
# daemon handling certbot stuff # daemon handling certbot stuff

Loading…
Cancel
Save