From 20d513f224bd2bd31858143bac1ccc4c22f71c4d Mon Sep 17 00:00:00 2001 From: David Edwards Date: Fri, 8 Dec 2023 15:06:30 -0700 Subject: [PATCH 1/8] stubbed out subsite --- config/bash_completion.d/wo_auto.rc | 4 +-- wo/cli/plugins/site_create.py | 40 +++++++++++++++++++++++++++++ wo/cli/plugins/site_functions.py | 2 +- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/config/bash_completion.d/wo_auto.rc b/config/bash_completion.d/wo_auto.rc index 6272fc08..53a44410 100644 --- a/config/bash_completion.d/wo_auto.rc +++ b/config/bash_completion.d/wo_auto.rc @@ -159,13 +159,13 @@ _wo_complete() "create") COMPREPLY=( $(compgen \ - -W "--user --pass --email --html --php --php72 --php73 --php74 --php80 --php81 --php82 --php83 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --proxy= --alias --wpredis --wprocket --wpce -le --letsencrypt --letsencrypt=wildcard -le=wildcard --dns --dns=dns_cf --dns=dns_dgon" \ + -W "--user --pass --email --html --php --php72 --php73 --php74 --php80 --php81 --php82 --php83 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --proxy= --alias --subsite --wpredis --wprocket --wpce -le --letsencrypt --letsencrypt=wildcard -le=wildcard --dns --dns=dns_cf --dns=dns_dgon" \ -- $cur) ) ;; "update") COMPREPLY=( $(compgen \ - -W "--password --php --php72 --php73 --php74 --php80 --php81 --php82 --php83 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --wprocket --wpce --alias -le -le=off --letsencrypt --letsencrypt=off --letsencrypt=clean -le=wildcard -le=clean --dns --dns=dns_cf --dns=dns_dgon --ngxblocker --ngxblocker=off" \ + -W "--password --php --php72 --php73 --php74 --php80 --php81 --php82 --php83 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --wprocket --wpce --alias --subsite -le -le=off --letsencrypt --letsencrypt=off --letsencrypt=clean -le=wildcard -le=clean --dns --dns=dns_cf --dns=dns_dgon --ngxblocker --ngxblocker=off" \ -- $cur) ) ;; "delete") diff --git a/wo/cli/plugins/site_create.py b/wo/cli/plugins/site_create.py index 71ac773f..8a922cf2 100644 --- a/wo/cli/plugins/site_create.py +++ b/wo/cli/plugins/site_create.py @@ -64,6 +64,9 @@ class Meta: (['--alias'], dict(help="domain name to redirect to", action='store', nargs='?')), + (['--subsite'], + dict(help="parent multi-site name", + action='store', nargs='?')), (['-le', '--letsencrypt'], dict(help="configure letsencrypt ssl for the site", action='store' or 'store_const', @@ -131,10 +134,17 @@ def default(self): alias_name = pargs.alias.strip() if not alias_name: Log.error(self, "Please provide alias name") + elif stype is None and pargs.subsite: + stype, cache = 'subsite', '' + subsite_name = pargs.subsite.strip() + if not subsite_name: + Log.error(self, "Please provide multisite parent name") elif stype and pargs.proxy: Log.error(self, "proxy should not be used with other site types") elif stype and pargs.alias: Log.error(self, "alias should not be used with other site types") + elif stype and pargs.subsite: + Log.error(self, "subsite should not be used with other site types") if not pargs.site_name: try: @@ -185,6 +195,16 @@ def default(self): data['alias_name'] = alias_name data['basic'] = True + if stype == 'subsite': + data = dict( + site_name=wo_domain, www_domain=wo_www_domain, + static=True, basic=False, wp=False, + wpfc=False, wpsc=False, wprocket=False, wpce=False, + multisite=False, wpsubdir=False, webroot=wo_site_webroot) + data['subsite'] = True + data['subsite_name'] = subsite_name + data['basic'] = True + if (pargs.php72 or pargs.php73 or pargs.php74 or pargs.php80 or pargs.php81 or pargs.php82 or pargs.php83): data = dict( @@ -332,6 +352,26 @@ def default(self): Log.info(self, "Successfully created site" " http://{0}".format(wo_domain)) + elif 'subsite' in data.keys() and data['subsite']: + addNewSite(self, wo_domain, stype, cache, wo_site_webroot) + # Service Nginx Reload + if not WOService.reload_service(self, 'nginx'): + Log.info(self, Log.FAIL + + "There was a serious error encountered...") + Log.info(self, Log.FAIL + "Cleaning up afterwards...") + doCleanupAction(self, domain=wo_domain) + deleteSiteInfo(self, wo_domain) + Log.error(self, "service nginx reload failed. " + "check issues with `nginx -t` command") + Log.error(self, "Check the log for details: " + "`tail /var/log/wo/wordops.log` " + "and please try again") + if wo_auth and len(wo_auth): + for msg in wo_auth: + Log.info(self, Log.ENDC + msg, log=False) + Log.info(self, "Successfully created site" + " http://{0}".format(wo_domain)) + else: addNewSite(self, wo_domain, stype, cache, wo_site_webroot, php_version=php_version) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index ecb18d7d..a32977fc 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -836,7 +836,7 @@ def site_package_check(self, stype): stack.app = self.app pargs = self.app.pargs if stype in ['html', 'proxy', 'php', 'php72', 'mysql', 'wp', 'wpsubdir', - 'wpsubdomain', 'php73', 'php74', 'php80', 'php81', 'php82', 'php83', 'alias']: + 'wpsubdomain', 'php73', 'php74', 'php80', 'php81', 'php82', 'php83', 'alias', 'subsite']: Log.debug(self, "Setting apt_packages variable for Nginx") # Check if server has nginx-custom package From 7a35419dd524927ada8f218161b957f2fb7cc6c6 Mon Sep 17 00:00:00 2001 From: David Edwards Date: Fri, 8 Dec 2023 16:11:19 -0700 Subject: [PATCH 2/8] loading parent data --- wo/cli/plugins/site_create.py | 8 ++++++-- wo/cli/plugins/site_functions.py | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/wo/cli/plugins/site_create.py b/wo/cli/plugins/site_create.py index 8a922cf2..03ecb8bc 100644 --- a/wo/cli/plugins/site_create.py +++ b/wo/cli/plugins/site_create.py @@ -7,7 +7,7 @@ doCleanupAction, setupdatabase, setupwordpress, setwebrootpermissions, display_cache_settings, copyWildcardCert) from wo.cli.plugins.sitedb import (addNewSite, deleteSiteInfo, - updateSiteInfo) + updateSiteInfo, getSiteInfo) from wo.core.acme import WOAcme from wo.core.domainvalidate import WODomain from wo.core.git import WOGit @@ -196,14 +196,18 @@ def default(self): data['basic'] = True if stype == 'subsite': + # Get parent site data + data = getSiteInfo(self, subsite_name) data = dict( site_name=wo_domain, www_domain=wo_www_domain, static=True, basic=False, wp=False, wpfc=False, wpsc=False, wprocket=False, wpce=False, multisite=False, wpsubdir=False, webroot=wo_site_webroot) + data["site_name"] = wo_domain + data["www_domain"] = wo_www_domain data['subsite'] = True data['subsite_name'] = subsite_name - data['basic'] = True + if (pargs.php72 or pargs.php73 or pargs.php74 or pargs.php80 or pargs.php81 or pargs.php82 or pargs.php83): diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index a32977fc..a6ab1e24 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -67,6 +67,11 @@ def setupdomain(self, data): wo_domain_name = data['site_name'] wo_site_webroot = data['webroot'] + if 'subsite' in data.keys() and data['subsite']: + wo_parent_site = data["subsite_name"] + wo_parent_info = getSiteInfo(wo_parent_site) + data["webroot"] = wo_parent_info["webroot"] + # Check if nginx configuration already exists # if os.path.isfile('/etc/nginx/sites-available/{0}' # .format(wo_domain_name)): From f3177a8e4aaad2f438d3c0dac7278c37edb82dcc Mon Sep 17 00:00:00 2001 From: David Edwards Date: Sat, 9 Dec 2023 14:15:39 -0700 Subject: [PATCH 3/8] Subsite Create working --- wo/cli/plugins/site_create.py | 33 ++++++++++++++++++++------- wo/cli/templates/virtualconf.mustache | 7 ++++++ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/wo/cli/plugins/site_create.py b/wo/cli/plugins/site_create.py index 03ecb8bc..6b72d04d 100644 --- a/wo/cli/plugins/site_create.py +++ b/wo/cli/plugins/site_create.py @@ -127,7 +127,7 @@ def default(self): proxyinfo = proxyinfo.split(':') host = proxyinfo[0].strip() port = '80' if len(proxyinfo) < 2 else proxyinfo[1].strip() - elif stype is None and not pargs.proxy and not pargs.alias: + elif stype is None and not pargs.proxy and not pargs.alias and not pargs.subsite: stype, cache = 'html', 'basic' elif stype is None and pargs.alias: stype, cache = 'alias', '' @@ -197,16 +197,32 @@ def default(self): if stype == 'subsite': # Get parent site data - data = getSiteInfo(self, subsite_name) + parent_site_info = getSiteInfo(self, subsite_name) + if not parent_site_info: + Log.error(self, "Parent site {0} does not exist" + .format(subsite_name)) + if not parent_site_info.is_enabled: + Log.error(self, "Parent site {0} is not enabled" + .format(subsite_name)) + if 'wp' not in parent_site_info.site_type: + Log.error(self, "Parent site {0} is not WordPress site" + .format(subsite_name)) + data = dict( site_name=wo_domain, www_domain=wo_www_domain, - static=True, basic=False, wp=False, - wpfc=False, wpsc=False, wprocket=False, wpce=False, - multisite=False, wpsubdir=False, webroot=wo_site_webroot) - data["site_name"] = wo_domain - data["www_domain"] = wo_www_domain + static=False, basic=False, multisite=False, webroot=wo_site_webroot) + + data["wp"] = parent_site_info.site_type == 'wp' + data["wpfc"] = parent_site_info.cache_type == 'wpfc' + data["wpsc"] = parent_site_info.cache_type == 'wpsc' + data["wprocket"] = parent_site_info.cache_type == 'wprocket' + data["wpce"] = parent_site_info.cache_type == 'wpce' + data["wpredis"] = parent_site_info.cache_type == 'wpredis' + data["wpsubdir"] = parent_site_info.site_type == 'wpsubdir' + data["wo_php"] = ("php" + parent_site_info.php_version).replace(".", "") data['subsite'] = True data['subsite_name'] = subsite_name + data['subsite_webroot'] = parent_site_info.site_path if (pargs.php72 or pargs.php73 or pargs.php74 or @@ -279,7 +295,8 @@ def default(self): if ((not pargs.wpfc) and (not pargs.wpsc) and (not pargs.wprocket) and (not pargs.wpce) and - (not pargs.wpredis)): + (not pargs.wpredis) and + (not pargs.subsite)): data['basic'] = True if (cache == 'wpredis'): diff --git a/wo/cli/templates/virtualconf.mustache b/wo/cli/templates/virtualconf.mustache index de65b9db..3d5b32e0 100644 --- a/wo/cli/templates/virtualconf.mustache +++ b/wo/cli/templates/virtualconf.mustache @@ -45,7 +45,14 @@ server { {{^proxy}} {{^alias}} + + {{^subsite}} root {{webroot}}/htdocs; + {{/subsite}} + + {{#subsite}} + root {{subsite_webroot}}/htdocs; + {{/subsite}} index {{^static}}index.php{{/static}} index.html index.htm; From b1876c19353c1d8afc8dc15c1d923672764783c0 Mon Sep 17 00:00:00 2001 From: David Edwards Date: Sun, 10 Dec 2023 11:49:49 -0700 Subject: [PATCH 4/8] changing name for clarity --- config/bash_completion.d/wo_auto.rc | 4 ++-- wo/cli/plugins/site_create.py | 34 +++++++++++++-------------- wo/cli/plugins/site_functions.py | 2 +- wo/cli/templates/virtualconf.mustache | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/config/bash_completion.d/wo_auto.rc b/config/bash_completion.d/wo_auto.rc index 53a44410..eafd69f9 100644 --- a/config/bash_completion.d/wo_auto.rc +++ b/config/bash_completion.d/wo_auto.rc @@ -159,13 +159,13 @@ _wo_complete() "create") COMPREPLY=( $(compgen \ - -W "--user --pass --email --html --php --php72 --php73 --php74 --php80 --php81 --php82 --php83 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --proxy= --alias --subsite --wpredis --wprocket --wpce -le --letsencrypt --letsencrypt=wildcard -le=wildcard --dns --dns=dns_cf --dns=dns_dgon" \ + -W "--user --pass --email --html --php --php72 --php73 --php74 --php80 --php81 --php82 --php83 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --proxy= --alias --subsiteof --wpredis --wprocket --wpce -le --letsencrypt --letsencrypt=wildcard -le=wildcard --dns --dns=dns_cf --dns=dns_dgon" \ -- $cur) ) ;; "update") COMPREPLY=( $(compgen \ - -W "--password --php --php72 --php73 --php74 --php80 --php81 --php82 --php83 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --wprocket --wpce --alias --subsite -le -le=off --letsencrypt --letsencrypt=off --letsencrypt=clean -le=wildcard -le=clean --dns --dns=dns_cf --dns=dns_dgon --ngxblocker --ngxblocker=off" \ + -W "--password --php --php72 --php73 --php74 --php80 --php81 --php82 --php83 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --wprocket --wpce --alias --subsiteof -le -le=off --letsencrypt --letsencrypt=off --letsencrypt=clean -le=wildcard -le=clean --dns --dns=dns_cf --dns=dns_dgon --ngxblocker --ngxblocker=off" \ -- $cur) ) ;; "delete") diff --git a/wo/cli/plugins/site_create.py b/wo/cli/plugins/site_create.py index 6b72d04d..1bd782c0 100644 --- a/wo/cli/plugins/site_create.py +++ b/wo/cli/plugins/site_create.py @@ -64,8 +64,8 @@ class Meta: (['--alias'], dict(help="domain name to redirect to", action='store', nargs='?')), - (['--subsite'], - dict(help="parent multi-site name", + (['--subsiteof'], + dict(help="create a subsite of a multisite install", action='store', nargs='?')), (['-le', '--letsencrypt'], dict(help="configure letsencrypt ssl for the site", @@ -127,24 +127,24 @@ def default(self): proxyinfo = proxyinfo.split(':') host = proxyinfo[0].strip() port = '80' if len(proxyinfo) < 2 else proxyinfo[1].strip() - elif stype is None and not pargs.proxy and not pargs.alias and not pargs.subsite: + elif stype is None and not pargs.proxy and not pargs.alias and not pargs.subsiteofof: stype, cache = 'html', 'basic' elif stype is None and pargs.alias: stype, cache = 'alias', '' alias_name = pargs.alias.strip() if not alias_name: Log.error(self, "Please provide alias name") - elif stype is None and pargs.subsite: + elif stype is None and pargs.subsiteof: stype, cache = 'subsite', '' - subsite_name = pargs.subsite.strip() - if not subsite_name: + subsiteof_name = pargs.subsiteof.strip() + if not subsiteof_name: Log.error(self, "Please provide multisite parent name") elif stype and pargs.proxy: Log.error(self, "proxy should not be used with other site types") elif stype and pargs.alias: Log.error(self, "alias should not be used with other site types") - elif stype and pargs.subsite: - Log.error(self, "subsite should not be used with other site types") + elif stype and pargs.subsiteof: + Log.error(self, "subsiteof should not be used with other site types") if not pargs.site_name: try: @@ -197,16 +197,16 @@ def default(self): if stype == 'subsite': # Get parent site data - parent_site_info = getSiteInfo(self, subsite_name) + parent_site_info = getSiteInfo(self, subsiteof_name) if not parent_site_info: Log.error(self, "Parent site {0} does not exist" - .format(subsite_name)) + .format(subsiteof_name)) if not parent_site_info.is_enabled: Log.error(self, "Parent site {0} is not enabled" - .format(subsite_name)) - if 'wp' not in parent_site_info.site_type: - Log.error(self, "Parent site {0} is not WordPress site" - .format(subsite_name)) + .format(subsiteof_name)) + if parent_site_info.site_type not in ['wpsubdomain', 'wpsubdir']: + Log.error(self, "Parent site {0} is not WordPress multisite" + .format(subsiteof_name)) data = dict( site_name=wo_domain, www_domain=wo_www_domain, @@ -221,8 +221,8 @@ def default(self): data["wpsubdir"] = parent_site_info.site_type == 'wpsubdir' data["wo_php"] = ("php" + parent_site_info.php_version).replace(".", "") data['subsite'] = True - data['subsite_name'] = subsite_name - data['subsite_webroot'] = parent_site_info.site_path + data['subsiteof_name'] = subsiteof_name + data['subsiteof_webroot'] = parent_site_info.site_path if (pargs.php72 or pargs.php73 or pargs.php74 or @@ -296,7 +296,7 @@ def default(self): (not pargs.wprocket) and (not pargs.wpce) and (not pargs.wpredis) and - (not pargs.subsite)): + (not pargs.subsiteof)): data['basic'] = True if (cache == 'wpredis'): diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index a6ab1e24..070dcd30 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -68,7 +68,7 @@ def setupdomain(self, data): wo_site_webroot = data['webroot'] if 'subsite' in data.keys() and data['subsite']: - wo_parent_site = data["subsite_name"] + wo_parent_site = data["subsiteof_name"] wo_parent_info = getSiteInfo(wo_parent_site) data["webroot"] = wo_parent_info["webroot"] diff --git a/wo/cli/templates/virtualconf.mustache b/wo/cli/templates/virtualconf.mustache index 3d5b32e0..4adae965 100644 --- a/wo/cli/templates/virtualconf.mustache +++ b/wo/cli/templates/virtualconf.mustache @@ -51,7 +51,7 @@ server { {{/subsite}} {{#subsite}} - root {{subsite_webroot}}/htdocs; + root {{subsiteof_webroot}}/htdocs; {{/subsite}} index {{^static}}index.php{{/static}} index.html index.htm; From 4e58a7d4f06913270fa6004ea16c08a14210e8c5 Mon Sep 17 00:00:00 2001 From: David Edwards Date: Sun, 10 Dec 2023 12:16:39 -0700 Subject: [PATCH 5/8] correcting mistaken code --- wo/cli/plugins/site_functions.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 070dcd30..a32977fc 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -67,11 +67,6 @@ def setupdomain(self, data): wo_domain_name = data['site_name'] wo_site_webroot = data['webroot'] - if 'subsite' in data.keys() and data['subsite']: - wo_parent_site = data["subsiteof_name"] - wo_parent_info = getSiteInfo(wo_parent_site) - data["webroot"] = wo_parent_info["webroot"] - # Check if nginx configuration already exists # if os.path.isfile('/etc/nginx/sites-available/{0}' # .format(wo_domain_name)): From ca57da12e5cf5ce2fd6abcf43cfc1be9cfeb1fb8 Mon Sep 17 00:00:00 2001 From: David Edwards Date: Sun, 10 Dec 2023 12:19:38 -0700 Subject: [PATCH 6/8] added ability to update to subsiteof --- wo/cli/plugins/site_update.py | 55 ++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/wo/cli/plugins/site_update.py b/wo/cli/plugins/site_update.py index 15ee1b7d..d9dd0379 100644 --- a/wo/cli/plugins/site_update.py +++ b/wo/cli/plugins/site_update.py @@ -64,6 +64,9 @@ class Meta: (['--alias'], dict(help="domain name to redirect to", action='store', nargs='?')), + (['--subsiteof'], + dict(help="create a subsite of a multisite install", + action='store', nargs='?')), (['-le', '--letsencrypt'], dict(help="configure letsencrypt ssl for the site", action='store' or 'store_const', @@ -155,11 +158,18 @@ def doupdatesite(self, pargs): alias_name = pargs.alias.strip() if not alias_name: Log.error(self, "Please provide alias name") + elif stype is None and pargs.subsiteof: + stype, cache = 'subsite', '' + subsiteof_name = pargs.subsiteof.strip() + if not subsiteof_name: + Log.error(self, "Please provide multisite parent name") elif stype is None and not (pargs.proxy or - pargs.letsencrypt or pargs.alias): + pargs.letsencrypt or + pargs.alias or + pargs.subsiteof): stype, cache = 'html', 'basic' - elif stype and (pargs.proxy or pargs.alias): - Log.error(self, "--proxy/alias can not be used with other site types") + elif stype and (pargs.proxy or pargs.alias or pargs.subsiteof): + Log.error(self, "--proxy/alias/subsiteof can not be used with other site types") if not pargs.site_name: try: @@ -293,6 +303,35 @@ def doupdatesite(self, pargs): data['alias'] = True data['alias_name'] = alias_name + if stype == 'subsite': + # Get parent site data + parent_site_info = getSiteInfo(self, subsiteof_name) + if not parent_site_info: + Log.error(self, "Parent site {0} does not exist" + .format(subsiteof_name)) + if not parent_site_info.is_enabled: + Log.error(self, "Parent site {0} is not enabled" + .format(subsiteof_name)) + if parent_site_info.site_type not in ['wpsubdomain', 'wpsubdir']: + Log.error(self, "Parent site {0} is not WordPress multisite" + .format(subsiteof_name)) + + data = dict( + site_name=wo_domain, www_domain=wo_www_domain, + static=False, basic=False, multisite=False, webroot=wo_site_webroot) + + data["wp"] = parent_site_info.site_type == 'wp' + data["wpfc"] = parent_site_info.cache_type == 'wpfc' + data["wpsc"] = parent_site_info.cache_type == 'wpsc' + data["wprocket"] = parent_site_info.cache_type == 'wprocket' + data["wpce"] = parent_site_info.cache_type == 'wpce' + data["wpredis"] = parent_site_info.cache_type == 'wpredis' + data["wpsubdir"] = parent_site_info.site_type == 'wpsubdir' + data["wo_php"] = ("php" + parent_site_info.php_version).replace(".", "") + data['subsite'] = True + data['subsiteof_name'] = subsiteof_name + data['subsiteof_webroot'] = parent_site_info.site_path + if stype == 'php': data = dict( site_name=wo_domain, www_domain=wo_www_domain, @@ -483,7 +522,8 @@ def doupdatesite(self, pargs): version in WOVar.wo_php_versions.items()) and (stype == oldsitetype and cache == oldcachetype and stype != 'alias' - and stype != 'proxy'): + and stype != 'proxy' + and stype != 'subsite'): Log.debug(self, "Nothing to update") return 1 @@ -547,6 +587,13 @@ def doupdatesite(self, pargs): Log.info(self, "Successfully updated site" " http://{0}".format(wo_domain)) return 0 + + if 'subsite' in data.keys() and data['subsite']: + updateSiteInfo(self, wo_domain, stype=stype, cache=cache, + ssl=(bool(check_site.is_ssl))) + Log.info(self, "Successfully updated site" + " http://{0}".format(wo_domain)) + return 0 if pargs.letsencrypt: if data['letsencrypt'] is True: From 401be08fe95f82786541c9b485b2edff3b029b8a Mon Sep 17 00:00:00 2001 From: David Edwards Date: Sun, 10 Dec 2023 14:58:16 -0700 Subject: [PATCH 7/8] fixed typo on variable. --- wo/cli/plugins/site_create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wo/cli/plugins/site_create.py b/wo/cli/plugins/site_create.py index 1bd782c0..6537134f 100644 --- a/wo/cli/plugins/site_create.py +++ b/wo/cli/plugins/site_create.py @@ -127,7 +127,7 @@ def default(self): proxyinfo = proxyinfo.split(':') host = proxyinfo[0].strip() port = '80' if len(proxyinfo) < 2 else proxyinfo[1].strip() - elif stype is None and not pargs.proxy and not pargs.alias and not pargs.subsiteofof: + elif stype is None and not pargs.proxy and not pargs.alias and not pargs.subsiteof: stype, cache = 'html', 'basic' elif stype is None and pargs.alias: stype, cache = 'alias', '' From 847614ed6e923286fb01cdf6969b98ee27c264c0 Mon Sep 17 00:00:00 2001 From: David Edwards Date: Sun, 10 Dec 2023 17:17:12 -0700 Subject: [PATCH 8/8] fixed trailing whitespace --- wo/cli/plugins/site_update.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wo/cli/plugins/site_update.py b/wo/cli/plugins/site_update.py index d9dd0379..65b23dd1 100644 --- a/wo/cli/plugins/site_update.py +++ b/wo/cli/plugins/site_update.py @@ -164,7 +164,7 @@ def doupdatesite(self, pargs): if not subsiteof_name: Log.error(self, "Please provide multisite parent name") elif stype is None and not (pargs.proxy or - pargs.letsencrypt or + pargs.letsencrypt or pargs.alias or pargs.subsiteof): stype, cache = 'html', 'basic' @@ -587,7 +587,7 @@ def doupdatesite(self, pargs): Log.info(self, "Successfully updated site" " http://{0}".format(wo_domain)) return 0 - + if 'subsite' in data.keys() and data['subsite']: updateSiteInfo(self, wo_domain, stype=stype, cache=cache, ssl=(bool(check_site.is_ssl)))