letsencrypt testing

This commit is contained in:
VirtuBox
2019-03-16 01:12:32 +01:00
parent 5651d7072e
commit 09e7c7dbfd

View File

@@ -329,9 +329,10 @@ class WOSiteCreateController(CementBaseController):
dict(help="create wordpress single/multi site with redis cache", dict(help="create wordpress single/multi site with redis cache",
action='store_true')), action='store_true')),
(['-le', '--letsencrypt'], (['-le', '--letsencrypt'],
dict(help="configure letsencrypt ssl for the site", action='store_true')), dict(help="configure letsencrypt ssl for the site",
(['--subdomain'], action='store' or 'store_const',
dict(help="specify the site is a subdomain for letsencrypt", action='store_true')), choices=('on', 'off', 'subdomain', 'wildcard'),
const='on', nargs='?')),
(['--user'], (['--user'],
dict(help="provide user for wordpress site")), dict(help="provide user for wordpress site")),
(['--email'], (['--email'],
@@ -678,8 +679,7 @@ class WOSiteCreateController(CementBaseController):
Log.error(self, "Check the log for details: " Log.error(self, "Check the log for details: "
"`tail /var/log/wo/wordops.log` and please try again") "`tail /var/log/wo/wordops.log` and please try again")
if (self.app.pargs.letsencrypt and if self.app.pargs.letsencrypt == "on":
not pargs.letsencrypt == "wildcard"):
if stype in ['wpsubdomain']: if stype in ['wpsubdomain']:
Log.warn( Log.warn(
self, "Wildcard domains are not supported in Lets Encrypt.\nWP SUBDOMAIN site will get SSL for primary site only.") self, "Wildcard domains are not supported in Lets Encrypt.\nWP SUBDOMAIN site will get SSL for primary site only.")
@@ -707,7 +707,7 @@ class WOSiteCreateController(CementBaseController):
Log.info(self, "Not using Let\'s encrypt for Site " Log.info(self, "Not using Let\'s encrypt for Site "
" http://{0}".format(wo_domain)) " http://{0}".format(wo_domain))
if self.app.pargs.letsencrypt and self.app.pargs.subdomain: if self.app.pargs.letsencrypt == "subdomain":
data['letsencrypt'] = True data['letsencrypt'] = True
letsencrypt = True letsencrypt = True
@@ -1190,7 +1190,7 @@ class WOSiteUpdateController(CementBaseController):
" http://{0}".format(wo_domain)) " http://{0}".format(wo_domain))
return 0 return 0
if pargs.letsencrypt and (not pargs.subdomain): if pargs.letsencrypt == "on":
if data['letsencrypt'] is True: if data['letsencrypt'] is True:
if not os.path.isfile("{0}/conf/nginx/ssl.conf.disabled" if not os.path.isfile("{0}/conf/nginx/ssl.conf.disabled"
.format(wo_site_webroot)): .format(wo_site_webroot)):
@@ -1237,7 +1237,7 @@ class WOSiteUpdateController(CementBaseController):
Log.info(self, "Successfully Disabled SSl for Site " Log.info(self, "Successfully Disabled SSl for Site "
" http://{0}".format(wo_domain)) " http://{0}".format(wo_domain))
if pargs.letsencrypt and (pargs.subdomain): if pargs.letsencrypt == "subdomain":
if data['letsencrypt'] is True: if data['letsencrypt'] is True:
if not os.path.isfile("{0}/conf/nginx/ssl.conf.disabled" if not os.path.isfile("{0}/conf/nginx/ssl.conf.disabled"
.format(wo_site_webroot)): .format(wo_site_webroot)):