Update bash-completion and add wildcard redirection
This commit is contained in:
@@ -22,7 +22,7 @@ _wo_complete()
|
|||||||
# HANDLE EVERYTHING AFTER THE SECOND LEVEL NAMESPACE
|
# HANDLE EVERYTHING AFTER THE SECOND LEVEL NAMESPACE
|
||||||
"clean")
|
"clean")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--memcache --opcache --fastcgi --redis --all" \
|
-W "--opcache --fastcgi --redis --all" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -79,12 +79,12 @@ _wo_complete()
|
|||||||
;;
|
;;
|
||||||
"upgrade" )
|
"upgrade" )
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--web --nginx --php --php73 --mysql --all --php56 --no-prompt --wpcli" \
|
-W "--web --nginx --php --php73 --mysql --all --netdata --no-prompt --wpcli" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
"start" | "stop" | "reload" | "restart" | "status")
|
"start" | "stop" | "reload" | "restart" | "status")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--nginx --php --php73 --mysql --memcache --redis --fail2ban --netdata" \
|
-W "--nginx --php --php73 --mysql --redis --fail2ban --netdata" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
"migrate")
|
"migrate")
|
||||||
@@ -159,13 +159,13 @@ _wo_complete()
|
|||||||
|
|
||||||
"create")
|
"create")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--user --pass --email --html --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --proxy= --wpredis --letsencrypt --letsencrypt=subdomain -le" \
|
-W "--user --pass --email --html --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --proxy= --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=wildcard --le --le=subdomain --le=wildcard --dns --dns=cf --dns=do" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"update")
|
"update")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--password --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=off --letsencrypt=renew" \
|
-W "--password --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=off --letsencrypt=renew --le --le=subdomain --le=wildcard --dns --dns=cf --dns=do" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
"delete")
|
"delete")
|
||||||
@@ -213,7 +213,7 @@ _wo_complete()
|
|||||||
if [ ${COMP_WORDS[2]} == "create" ]; then
|
if [ ${COMP_WORDS[2]} == "create" ]; then
|
||||||
retlist="--wp --wpsc --wpfc --user --email --pass --wpredis --letsencrypt --php73"
|
retlist="--wp --wpsc --wpfc --user --email --pass --wpredis --letsencrypt --php73"
|
||||||
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
||||||
retlist="--wp --wpfc --wpsc --php73 --php73=off --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=off --letsencrypt=renew --le --le=subdomain --le=off "
|
retlist="--wp --wpfc --wpsc --php73 --php73=off --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=off --letsencrypt=renew --le --le=subdomain --le=off --le=wildcard --dns --dns=cf --dns=do"
|
||||||
else
|
else
|
||||||
retlist=""
|
retlist=""
|
||||||
fi
|
fi
|
||||||
@@ -230,9 +230,9 @@ _wo_complete()
|
|||||||
"--wpsubdir" | "--wpsubdomain")
|
"--wpsubdir" | "--wpsubdomain")
|
||||||
if [ ${COMP_WORDS[1]} != "debug" ]; then
|
if [ ${COMP_WORDS[1]} != "debug" ]; then
|
||||||
if [ ${COMP_WORDS[2]} == "create" ]; then
|
if [ ${COMP_WORDS[2]} == "create" ]; then
|
||||||
retlist="--wpsc --wpfc --user --email --pass --wpredis --letsencrypt --letsencrypt=subdomain --php73"
|
retlist="--wpsc --wpfc --user --email --pass --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=wildcard --le --le=subdomain --le=wildcard --php73 --dns --dns=cf --dns=do"
|
||||||
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
||||||
retlist="--wpfc --wpsc --php73 --php73=off --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=off --letsencrypt=renew"
|
retlist="--wpfc --wpsc --php73 --php73=off --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=off --letsencrypt=renew --le --le=off --le=subdomain --le=wildcard --dns --dns=cf --dns=do"
|
||||||
else
|
else
|
||||||
retlist=""
|
retlist=""
|
||||||
fi
|
fi
|
||||||
@@ -248,7 +248,7 @@ _wo_complete()
|
|||||||
|
|
||||||
"--wpredis" | "--wpfc" | "--wpsc" | "--wpsubdir" | "--wpsubdomain" | "--user" | "--pass" | "--email" | "--wp")
|
"--wpredis" | "--wpfc" | "--wpsc" | "--wpsubdir" | "--wpsubdomain" | "--user" | "--pass" | "--email" | "--wp")
|
||||||
if [ ${COMP_WORDS[2]} == "create" ]; then
|
if [ ${COMP_WORDS[2]} == "create" ]; then
|
||||||
retlist="--user --pass --email --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --php73 --letsencrypt --letsencrypt=subdomain"
|
retlist="--user --pass --email --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --php73 --letsencrypt --letsencrypt=subdomain --le --le=subdomain --le=wildcard --dns --dns=cf --dns=do"
|
||||||
else
|
else
|
||||||
retlist=""
|
retlist=""
|
||||||
fi
|
fi
|
||||||
@@ -261,7 +261,7 @@ _wo_complete()
|
|||||||
|
|
||||||
"--wpredis" | "--wpfc")
|
"--wpredis" | "--wpfc")
|
||||||
if [ ${COMP_WORDS[2]} == "update" ]; then
|
if [ ${COMP_WORDS[2]} == "update" ]; then
|
||||||
retlist="--password --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=off --letsencrypt=renew"
|
retlist="--password --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=off --letsencrypt=renew --le --le=off --le=subdomain --le=wildcard --dns --dns=cf --dns=do"
|
||||||
else
|
else
|
||||||
retlist=""
|
retlist=""
|
||||||
fi
|
fi
|
||||||
@@ -272,11 +272,11 @@ _wo_complete()
|
|||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"--web" | "--admin" | "--nginx" | "--php" | "--php73" | "--mysql" | "--wpcli" | "--phpmyadmin" | "--adminer" | "--utils" | "--memcached" | "--redis | --phpredisadmin")
|
"--web" | "--admin" | "--nginx" | "--php" | "--php73" | "--mysql" | "--wpcli" | "--phpmyadmin" | "--adminer" | "--utils" | "--redis | --phpredisadmin | --netdata")
|
||||||
if [[ ${COMP_WORDS[2]} == "install" || ${COMP_WORDS[2]} == "purge" || ${COMP_WORDS[2]} == "remove" ]]; then
|
if [[ ${COMP_WORDS[2]} == "install" || ${COMP_WORDS[2]} == "purge" || ${COMP_WORDS[2]} == "remove" ]]; then
|
||||||
retlist="--web --admin --nginx --php --php73 --mysql--wpcli --phpmyadmin --adminer --utils --memcache --redis --phpredisadmin"
|
retlist="--web --admin --nginx --php --php73 --mysql --wpcli --phpmyadmin --adminer --utils --redis --phpredisadmin --netdata"
|
||||||
elif [[ ${COMP_WORDS[2]} == "start" || ${COMP_WORDS[2]} == "reload" || ${COMP_WORDS[2]} == "restart" || ${COMP_WORDS[2]} == "stop" ]]; then
|
elif [[ ${COMP_WORDS[2]} == "start" || ${COMP_WORDS[2]} == "reload" || ${COMP_WORDS[2]} == "restart" || ${COMP_WORDS[2]} == "stop" ]]; then
|
||||||
retlist="--nginx --php --php73 --mysql --memcache --redis"
|
retlist="--nginx --php --php73 --mysql --redis --netdata"
|
||||||
elif [[ ${COMP_WORDS[1]} == "debug" ]]; then
|
elif [[ ${COMP_WORDS[1]} == "debug" ]]; then
|
||||||
retlist="--start --nginx --php --php73 --fpm --fpm7 --mysql -i --interactive -stop --import-slow-log --import-slow-log-interval= -"
|
retlist="--start --nginx --php --php73 --fpm --fpm7 --mysql -i --interactive -stop --import-slow-log --import-slow-log-interval= -"
|
||||||
if [[ $prev == '--mysql' ]]; then
|
if [[ $prev == '--mysql' ]]; then
|
||||||
@@ -324,8 +324,8 @@ _wo_complete()
|
|||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"--memcached" | "--opcache" | "--fastcgi" | "--all" | "--redis")
|
"--opcache" | "--fastcgi" | "--all" | "--redis")
|
||||||
retlist="--memcached --opcache --fastcgi --redis --all"
|
retlist="--opcache --fastcgi --redis --all"
|
||||||
ret="${retlist[@]/$prev}"
|
ret="${retlist[@]/$prev}"
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "$(echo $ret)" \
|
-W "$(echo $ret)" \
|
||||||
@@ -363,7 +363,7 @@ _wo_complete()
|
|||||||
case "$mprev" in
|
case "$mprev" in
|
||||||
"--user" | "--email" | "--pass")
|
"--user" | "--email" | "--pass")
|
||||||
if [ ${COMP_WORDS[2]} == "create" ]; then
|
if [ ${COMP_WORDS[2]} == "create" ]; then
|
||||||
retlist="--user --pass --email --html --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --letsencrypt --letsencrypt=subdomain"
|
retlist="--user --pass --email --html --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --letsencrypt --letsencrypt=subdomain --letsencrypt=wildcard --le --le=subdomain --le=wildcard --dns --dns=cf --dns=do"
|
||||||
fi
|
fi
|
||||||
ret="${retlist[@]/$prev}"
|
ret="${retlist[@]/$prev}"
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
|
|||||||
@@ -737,12 +737,14 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
if data['letsencrypt'] is True:
|
if data['letsencrypt'] is True:
|
||||||
if self.app.pargs.letsencrypt == "on":
|
if self.app.pargs.letsencrypt == "on":
|
||||||
setupLetsEncrypt(self, wo_domain)
|
setupLetsEncrypt(self, wo_domain)
|
||||||
|
httpsRedirect(self, wo_domain)
|
||||||
elif self.app.pargs.letsencrypt == "subodmain":
|
elif self.app.pargs.letsencrypt == "subodmain":
|
||||||
setupLetsEncryptSubdomain(self, wo_domain)
|
setupLetsEncryptSubdomain(self, wo_domain)
|
||||||
|
httpsRedirect(self, wo_domain)
|
||||||
elif self.app.pargs.letsencrypt == "wildcard":
|
elif self.app.pargs.letsencrypt == "wildcard":
|
||||||
setupLetsEncryptWildcard(self, wo_domain)
|
setupLetsEncryptWildcard(self, wo_domain)
|
||||||
|
httpsRedirect(self, wo_domain, True, True)
|
||||||
|
|
||||||
httpsRedirect(self, wo_domain)
|
|
||||||
if self.app.pargs.hsts:
|
if self.app.pargs.hsts:
|
||||||
setupHsts(self, wo_domain)
|
setupHsts(self, wo_domain)
|
||||||
|
|
||||||
@@ -1269,18 +1271,19 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
.format(wo_site_webroot)):
|
.format(wo_site_webroot)):
|
||||||
if self.app.pargs.letsencrypt == "on":
|
if self.app.pargs.letsencrypt == "on":
|
||||||
setupLetsEncrypt(self, wo_domain)
|
setupLetsEncrypt(self, wo_domain)
|
||||||
|
httpsRedirect(self, wo_domain)
|
||||||
elif self.app.pargs.letsencrypt == "subodmain":
|
elif self.app.pargs.letsencrypt == "subodmain":
|
||||||
setupLetsEncryptSubdomain(self, wo_domain)
|
setupLetsEncryptSubdomain(self, wo_domain)
|
||||||
|
httpsRedirect(self, wo_domain)
|
||||||
elif self.app.pargs.letsencrypt == "wildcard":
|
elif self.app.pargs.letsencrypt == "wildcard":
|
||||||
setupLetsEncryptWildcard(self, wo_domain, dns_cf)
|
setupLetsEncryptWildcard(self, wo_domain, dns_cf)
|
||||||
|
httpsRedirect(self, wo_domain, True, True)
|
||||||
else:
|
else:
|
||||||
WOFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf.disabled"
|
WOFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf.disabled"
|
||||||
.format(wo_site_webroot),
|
.format(wo_site_webroot),
|
||||||
'{0}/conf/nginx/ssl.conf'
|
'{0}/conf/nginx/ssl.conf'
|
||||||
.format(wo_site_webroot))
|
.format(wo_site_webroot))
|
||||||
|
|
||||||
httpsRedirect(self, wo_domain)
|
|
||||||
|
|
||||||
if not WOService.reload_service(self, 'nginx'):
|
if not WOService.reload_service(self, 'nginx'):
|
||||||
Log.error(self, "service nginx reload failed. "
|
Log.error(self, "service nginx reload failed. "
|
||||||
"check issues with `nginx -t` command")
|
"check issues with `nginx -t` command")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user