From 720db8e72a0a4c96bdcbe9e06b040ccb0c8993fa Mon Sep 17 00:00:00 2001 From: Pierre Jaury Date: Sun, 13 Nov 2016 18:19:01 +0100 Subject: [PATCH] Generate a certificate for the proper hostname --- admin/mailu/certbot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/admin/mailu/certbot.py b/admin/mailu/certbot.py index d8935be8..9902e5df 100644 --- a/admin/mailu/certbot.py +++ b/admin/mailu/certbot.py @@ -45,15 +45,14 @@ def certbot_install(domain): @scheduler.scheduled_job('cron', hour=2, minute=0) def generate_cert(): print("Generating TLS certificates using Certbot") - domain = app.config["DOMAIN"] - email = "{}@{}".format(app.config["POSTMASTER"], domain) + email = "{}@{}".format(app.config["POSTMASTER"], app.config["DOMAIN"]) result = certbot_command( "certonly", "--standalone", "--agree-tos", "--preferred-challenges", "http", "--email", email, - "-d", domain, + "-d", app.config["HOSTNAME"], # 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 # daemon handling certbot stuff