From 2657af9abbbc258a7d19fa59964b5235191ae1ab Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 13 Jul 2019 20:42:11 +0200 Subject: [PATCH] Add wildcard to update command --- wo/cli/plugins/site.py | 16 ++++++++++++++-- wo/cli/plugins/site_functions.py | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index 54818c6..5c7d20d 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -807,6 +807,11 @@ class WOSiteUpdateController(CementBaseController): action='store' or 'store_const', choices=('on', 'off', 'renew', 'subdomain', 'wildcard'), const='on', nargs='?')), + (['--dns'], + dict(help="choose dns provider api for letsencrypt", + action='store' or 'store_const', + choices=('cf', 'do'), + const='cf', nargs='?')), (['--hsts'], dict(help="configure hsts for the site", action='store' or 'store_const', @@ -1199,6 +1204,11 @@ class WOSiteUpdateController(CementBaseController): data['basic'] = False cache = 'wpredis' + if pargs.dns == "do": + dns_cf = False + else: + dns_cf = True + if (php73 is old_php73) and (stype == oldsitetype and cache == oldcachetype): return 1 @@ -1257,10 +1267,12 @@ class WOSiteUpdateController(CementBaseController): if data['letsencrypt'] is True: if not os.path.isfile("{0}/conf/nginx/ssl.conf.disabled" .format(wo_site_webroot)): - if not pargs.letsencrypt == "subdomain": + if self.app.pargs.letsencrypt == "on": setupLetsEncrypt(self, wo_domain) - else: + elif self.app.pargs.letsencrypt == "subodmain": setupLetsEncryptSubdomain(self, wo_domain) + elif self.app.pargs.letsencrypt == "wildcard": + setupLetsEncryptWildcard(self, wo_domain, dns_cf) else: WOFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf.disabled" .format(wo_site_webroot), diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 73f8a8a..9a491f5 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -1436,7 +1436,7 @@ def setupLetsEncryptSubdomain(self, wo_domain_name): # setup letsencrypt for domain + www.domain -def setupLetsEncryptWildcard(self, wo_domain_name): +def setupLetsEncryptWildcard(self, wo_domain_name, dns_cf=True): if os.path.isfile("/etc/letsencrypt/renewal/{0}_ecc/{0}.conf" .format(wo_domain_name)):