Fix SSL certificate removal with WordOps backend

This commit is contained in:
VirtuBox
2019-08-29 16:43:25 +02:00
parent b5cdd172ef
commit 9b7291d04f
4 changed files with 36 additions and 10 deletions

View File

@@ -989,8 +989,6 @@ def display_cache_settings(self, data):
"page=nginx".format(data['site_name']))
def logwatch(self, logfiles):
import zlib
import base64
@@ -1012,8 +1010,8 @@ def logwatch(self, logfiles):
'caught exception rendering a new log line in %s'
% filename)
l = logwatch.LogWatcher(logfiles, callback)
l.loop()
logl = logwatch.LogWatcher(logfiles, callback)
logl.loop()
def detSitePar(opts):
@@ -1243,10 +1241,19 @@ def removeAcmeConf(self, domain):
.format(domain))
WOFileUtils.rm(self, '/etc/nginx/conf.d/force-ssl-{0}.conf.disabled'
.format(domain))
WOGit.add(self, ["/etc/letsencrypt"],
msg="Deleted {0} "
.format(domain))
if WOFileUtils.grepcheck(self, '/var/www/22222/conf/nginx/ssl.conf',
'{0}'.format(domain)):
Log.info(self, "Setting back default certificate for WordOps backend")
with open("/var/www/22222/conf/nginx/"
"ssl.conf", "w") as ssl_conf_file:
ssl_conf_file.write("ssl_certificate "
"/var/www/22222/cert/22222.crt;\n"
"ssl_certificate_key "
"/var/www/22222/cert/22222.key;\n")
WOGit.add(self, ["/etc/letsencrypt"],
msg="Deleted {0} "
.format(domain))
WOService.restart_service(self, "nginx")
def site_url_https(self, domain):

View File

@@ -460,9 +460,8 @@ def post_pref(self, apt_packages, packages, upgrade=False):
if not os.path.isfile('{0}22222/conf/nginx/ssl.conf'
.format(ngxroot)):
with open("/var/www/22222/conf/nginx/"
"ssl.conf", "a") as php_file:
"ssl.conf", "w") as php_file:
php_file.write("ssl_certificate "
"/var/www/22222/cert/22222.crt;\n"
"ssl_certificate_key "