From b1876c19353c1d8afc8dc15c1d923672764783c0 Mon Sep 17 00:00:00 2001 From: David Edwards Date: Sun, 10 Dec 2023 11:49:49 -0700 Subject: [PATCH] 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 53a4441..eafd69f 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 6b72d04..1bd782c 100644 --- a/wo/cli/plugins/site_create.py +++ b/wo/cli/plugins/site_create.py @@ -64,8 +64,8 @@ class WOSiteCreateController(CementBaseController): (['--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 @@ class WOSiteCreateController(CementBaseController): 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 @@ class WOSiteCreateController(CementBaseController): 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 @@ class WOSiteCreateController(CementBaseController): 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 @@ class WOSiteCreateController(CementBaseController): (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 a6ab1e2..070dcd3 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 3d5b32e..4adae96 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;