Simplify letsencrypt

This commit is contained in:
VirtuBox
2019-08-05 00:20:09 +02:00
parent efd3766e65
commit e68434ec6f

View File

@@ -1382,6 +1382,8 @@ def setupLetsEncrypt(self, wo_domain_name, subdomain=False, wildcard=False,
else: else:
keylenght = "{0}".format(self.app.config.get('letsencrypt', keylenght = "{0}".format(self.app.config.get('letsencrypt',
'keylength')) 'keylength'))
wo_acme_exec = ("/etc/letsencrypt/acme.sh --config-home "
"'/etc/letsencrypt/config'")
if wo_dns: if wo_dns:
acme_mode = "--dns {0}".format(wo_acme_dns) acme_mode = "--dns {0}".format(wo_acme_dns)
validation_mode = "DNS with {0}".format(wo_acme_dns) validation_mode = "DNS with {0}".format(wo_acme_dns)
@@ -1394,9 +1396,7 @@ def setupLetsEncrypt(self, wo_domain_name, subdomain=False, wildcard=False,
if subdomain: if subdomain:
Log.info(self, "Issuing subdomain SSL cert with acme.sh") Log.info(self, "Issuing subdomain SSL cert with acme.sh")
Log.info(self, "Validation mode : {0}".format(validation_mode)) Log.info(self, "Validation mode : {0}".format(validation_mode))
ssl = WOShellExec.cmd_exec(self, "/etc/letsencrypt/acme.sh " ssl = WOShellExec.cmd_exec(self, "{0} ".format(wo_acme_exec) +
"--config-home "
"'/etc/letsencrypt/config' "
"--issue " "--issue "
"-d {0} {1} " "-d {0} {1} "
"-k {2} -f" "-k {2} -f"
@@ -1406,9 +1406,7 @@ def setupLetsEncrypt(self, wo_domain_name, subdomain=False, wildcard=False,
elif wildcard: elif wildcard:
Log.info(self, "Issuing Wildcard SSL cert with acme.sh") Log.info(self, "Issuing Wildcard SSL cert with acme.sh")
Log.info(self, "Validation mode : {0}".format(validation_mode)) Log.info(self, "Validation mode : {0}".format(validation_mode))
ssl = WOShellExec.cmd_exec(self, "/etc/letsencrypt/acme.sh " ssl = WOShellExec.cmd_exec(self, "{0} ".format(wo_acme_exec) +
"--config-home "
"'/etc/letsencrypt/config' "
"--issue " "--issue "
"-d {0} -d *.{0} --dns {1} " "-d {0} -d *.{0} --dns {1} "
"-k {2} -f" "-k {2} -f"
@@ -1418,9 +1416,7 @@ def setupLetsEncrypt(self, wo_domain_name, subdomain=False, wildcard=False,
else: else:
Log.info(self, "Issuing domain SSL cert with acme.sh") Log.info(self, "Issuing domain SSL cert with acme.sh")
Log.info(self, "Validation mode : {0}".format(validation_mode)) Log.info(self, "Validation mode : {0}".format(validation_mode))
ssl = WOShellExec.cmd_exec(self, "/etc/letsencrypt/acme.sh " ssl = WOShellExec.cmd_exec(self, "{0} ".format(wo_acme_exec) +
"--config-home "
"'/etc/letsencrypt/config' "
"--issue " "--issue "
"-d {0} -d www.{0} {1} " "-d {0} -d www.{0} {1} "
"-k {2} -f" "-k {2} -f"