stubbed out subsite
This commit is contained in:
@@ -64,6 +64,9 @@ class WOSiteCreateController(CementBaseController):
|
||||
(['--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 @@ class WOSiteCreateController(CementBaseController):
|
||||
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 @@ class WOSiteCreateController(CementBaseController):
|
||||
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 @@ class WOSiteCreateController(CementBaseController):
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user