changing name for clarity
This commit is contained in:
@@ -159,13 +159,13 @@ _wo_complete()
|
|||||||
|
|
||||||
"create")
|
"create")
|
||||||
COMPREPLY=( $(compgen \
|
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) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"update")
|
"update")
|
||||||
COMPREPLY=( $(compgen \
|
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) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
"delete")
|
"delete")
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
(['--alias'],
|
(['--alias'],
|
||||||
dict(help="domain name to redirect to",
|
dict(help="domain name to redirect to",
|
||||||
action='store', nargs='?')),
|
action='store', nargs='?')),
|
||||||
(['--subsite'],
|
(['--subsiteof'],
|
||||||
dict(help="parent multi-site name",
|
dict(help="create a subsite of a multisite install",
|
||||||
action='store', nargs='?')),
|
action='store', nargs='?')),
|
||||||
(['-le', '--letsencrypt'],
|
(['-le', '--letsencrypt'],
|
||||||
dict(help="configure letsencrypt ssl for the site",
|
dict(help="configure letsencrypt ssl for the site",
|
||||||
@@ -127,24 +127,24 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
proxyinfo = proxyinfo.split(':')
|
proxyinfo = proxyinfo.split(':')
|
||||||
host = proxyinfo[0].strip()
|
host = proxyinfo[0].strip()
|
||||||
port = '80' if len(proxyinfo) < 2 else proxyinfo[1].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'
|
stype, cache = 'html', 'basic'
|
||||||
elif stype is None and pargs.alias:
|
elif stype is None and pargs.alias:
|
||||||
stype, cache = 'alias', ''
|
stype, cache = 'alias', ''
|
||||||
alias_name = pargs.alias.strip()
|
alias_name = pargs.alias.strip()
|
||||||
if not alias_name:
|
if not alias_name:
|
||||||
Log.error(self, "Please provide 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', ''
|
stype, cache = 'subsite', ''
|
||||||
subsite_name = pargs.subsite.strip()
|
subsiteof_name = pargs.subsiteof.strip()
|
||||||
if not subsite_name:
|
if not subsiteof_name:
|
||||||
Log.error(self, "Please provide multisite parent name")
|
Log.error(self, "Please provide multisite parent name")
|
||||||
elif stype and pargs.proxy:
|
elif stype and pargs.proxy:
|
||||||
Log.error(self, "proxy should not be used with other site types")
|
Log.error(self, "proxy should not be used with other site types")
|
||||||
elif stype and pargs.alias:
|
elif stype and pargs.alias:
|
||||||
Log.error(self, "alias should not be used with other site types")
|
Log.error(self, "alias should not be used with other site types")
|
||||||
elif stype and pargs.subsite:
|
elif stype and pargs.subsiteof:
|
||||||
Log.error(self, "subsite should not be used with other site types")
|
Log.error(self, "subsiteof should not be used with other site types")
|
||||||
|
|
||||||
if not pargs.site_name:
|
if not pargs.site_name:
|
||||||
try:
|
try:
|
||||||
@@ -197,16 +197,16 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
|
|
||||||
if stype == 'subsite':
|
if stype == 'subsite':
|
||||||
# Get parent site data
|
# Get parent site data
|
||||||
parent_site_info = getSiteInfo(self, subsite_name)
|
parent_site_info = getSiteInfo(self, subsiteof_name)
|
||||||
if not parent_site_info:
|
if not parent_site_info:
|
||||||
Log.error(self, "Parent site {0} does not exist"
|
Log.error(self, "Parent site {0} does not exist"
|
||||||
.format(subsite_name))
|
.format(subsiteof_name))
|
||||||
if not parent_site_info.is_enabled:
|
if not parent_site_info.is_enabled:
|
||||||
Log.error(self, "Parent site {0} is not enabled"
|
Log.error(self, "Parent site {0} is not enabled"
|
||||||
.format(subsite_name))
|
.format(subsiteof_name))
|
||||||
if 'wp' not in parent_site_info.site_type:
|
if parent_site_info.site_type not in ['wpsubdomain', 'wpsubdir']:
|
||||||
Log.error(self, "Parent site {0} is not WordPress site"
|
Log.error(self, "Parent site {0} is not WordPress multisite"
|
||||||
.format(subsite_name))
|
.format(subsiteof_name))
|
||||||
|
|
||||||
data = dict(
|
data = dict(
|
||||||
site_name=wo_domain, www_domain=wo_www_domain,
|
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["wpsubdir"] = parent_site_info.site_type == 'wpsubdir'
|
||||||
data["wo_php"] = ("php" + parent_site_info.php_version).replace(".", "")
|
data["wo_php"] = ("php" + parent_site_info.php_version).replace(".", "")
|
||||||
data['subsite'] = True
|
data['subsite'] = True
|
||||||
data['subsite_name'] = subsite_name
|
data['subsiteof_name'] = subsiteof_name
|
||||||
data['subsite_webroot'] = parent_site_info.site_path
|
data['subsiteof_webroot'] = parent_site_info.site_path
|
||||||
|
|
||||||
|
|
||||||
if (pargs.php72 or pargs.php73 or pargs.php74 or
|
if (pargs.php72 or pargs.php73 or pargs.php74 or
|
||||||
@@ -296,7 +296,7 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
(not pargs.wprocket) and
|
(not pargs.wprocket) and
|
||||||
(not pargs.wpce) and
|
(not pargs.wpce) and
|
||||||
(not pargs.wpredis) and
|
(not pargs.wpredis) and
|
||||||
(not pargs.subsite)):
|
(not pargs.subsiteof)):
|
||||||
data['basic'] = True
|
data['basic'] = True
|
||||||
|
|
||||||
if (cache == 'wpredis'):
|
if (cache == 'wpredis'):
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ def setupdomain(self, data):
|
|||||||
wo_site_webroot = data['webroot']
|
wo_site_webroot = data['webroot']
|
||||||
|
|
||||||
if 'subsite' in data.keys() and data['subsite']:
|
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)
|
wo_parent_info = getSiteInfo(wo_parent_site)
|
||||||
data["webroot"] = wo_parent_info["webroot"]
|
data["webroot"] = wo_parent_info["webroot"]
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ server {
|
|||||||
{{/subsite}}
|
{{/subsite}}
|
||||||
|
|
||||||
{{#subsite}}
|
{{#subsite}}
|
||||||
root {{subsite_webroot}}/htdocs;
|
root {{subsiteof_webroot}}/htdocs;
|
||||||
{{/subsite}}
|
{{/subsite}}
|
||||||
|
|
||||||
index {{^static}}index.php{{/static}} index.html index.htm;
|
index {{^static}}index.php{{/static}} index.html index.htm;
|
||||||
|
|||||||
Reference in New Issue
Block a user