Refactor -le=renew

This commit is contained in:
VirtuBox
2019-10-29 18:47:52 +01:00
parent 97103704eb
commit aa5f2eeb49
5 changed files with 67 additions and 27 deletions

View File

@@ -132,6 +132,17 @@ class WOAcme:
"ssl.conf")
return 0
def renew(self, domain):
"""Renew letsencrypt certificate with acme.sh"""
try:
WOShellExec.cmd_exec(
self, "{0} ".format(WOAcme.wo_acme_exec) +
"--renew -d {0} --ecc --force".format(domain))
except CommandExecutionError as e:
Log.debug(self, str(e))
Log.error(self, 'Unable to renew certificate')
return True
def check_dns(self, acme_domains):
"""Check if a list of domains point to the server IP"""
server_ip = requests.get('http://v4.wordops.eu/').text

View File

@@ -44,7 +44,7 @@ class Log:
"""
Logs debug messages into log file
"""
self.app.log.debug(Log.HEADER + msg + Log.ENDC + __name__)
self.app.log.debug(Log.HEADER + msg + Log.ENDC)
def wait(self, msg, end='\r', log=True):
"""