Another fix for wildcard certificates

This commit is contained in:
VirtuBox
2024-06-11 23:18:27 +02:00
parent ff5d39211a
commit 00b3f99e5d

View File

@@ -11,6 +11,7 @@ from wo.core.shellexec import WOShellExec
from wo.core.variables import WOVar
from wo.cli.plugins.sitedb import (getAllsites)
from wo.core.template import WOTemplate
from wo.core.domainvalidate import WODomain
class WOStackMigrateController(CementBaseController):
@@ -118,13 +119,23 @@ class WOStackMigrateController(CementBaseController):
for site in allsites:
if not site:
pass
if (os.path.exists(f'/var/www/{site.sitename}/conf/nginx/ssl.conf') and
not os.path.islink(f'/var/www/{site.sitename}/conf/nginx/ssl.conf')):
data = dict(ssl_live_path=WOVar.wo_ssl_live,
domain=site.sitename, quic=True)
WOTemplate.deploy(
self, f'/var/www/{site.sitename}/conf/nginx/ssl.conf',
'ssl.mustache', data, overwrite=True)
if os.path.exists(f'/var/www/{site.sitename}/conf/nginx/ssl.conf'):
if not os.path.islink(f'/var/www/{site.sitename}/conf/nginx/ssl.conf'):
data = dict(ssl_live_path=WOVar.wo_ssl_live,
domain=site.sitename, quic=True)
WOTemplate.deploy(
self, f'/var/www/{site.sitename}/conf/nginx/ssl.conf',
'ssl.mustache', data, overwrite=True)
else:
(wo_domain_type, wo_root_domain) = WODomain.getlevel(
self, site.sitename)
if (site.sitename != wo_root_domain and
os.path.exists(f'/etc/letsencrypt/shared/{wo_root_domain}.conf')):
data = dict(ssl_live_path=WOVar.wo_ssl_live,
domain=wo_root_domain, quic=True)
WOTemplate.deploy(
self, f'/etc/letsencrypt/shared/{wo_root_domain}.conf',
'ssl.mustache', data, overwrite=True)
post_pref(self, WOVar.wo_nginx, [])
@expose(hide=True)