Merge pull request #26 from WordOps/updating-configuration
Preparation for stable release 3.9.5
This commit is contained in:
9
.editorconfig
Normal file
9
.editorconfig
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
insert_final_newline = false
|
||||||
90
.travis.yml
90
.travis.yml
@@ -12,7 +12,7 @@ before_script:
|
|||||||
- sudo rm -rf /etc/mysql/
|
- sudo rm -rf /etc/mysql/
|
||||||
- sudo bash -c 'echo example.com > /etc/hostname'
|
- sudo bash -c 'echo example.com > /etc/hostname'
|
||||||
- sudo apt-get -qq purge mysql* graphviz*
|
- sudo apt-get -qq purge mysql* graphviz*
|
||||||
- sudo apt-get -qq autoremove
|
- sudo apt-get -qq autoremove --purge
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
|
|
||||||
script:
|
script:
|
||||||
@@ -20,85 +20,55 @@ script:
|
|||||||
- unset LANG
|
- unset LANG
|
||||||
- sudo bash -c 'echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > /home/travis/.gitconfig'
|
- sudo bash -c 'echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > /home/travis/.gitconfig'
|
||||||
- sudo echo "Travis Banch = $TRAVIS_BRANCH"
|
- sudo echo "Travis Banch = $TRAVIS_BRANCH"
|
||||||
- sudo apt-get install -y --force-yes git python3-setuptools python3-dev python3-apt
|
- sudo apt-get install -y --force-yes git python3-setuptools python3-dev python3-apt ccze
|
||||||
- sudo bash install $TRAVIS_BRANCH
|
- sudo bash install $TRAVIS_BRANCH
|
||||||
- sudo wo --help
|
- sudo wo --help
|
||||||
- sudo wo stack install || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo stack install || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo stack install --web || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo stack install --web || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo stack install --admin || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo stack install --admin || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
|
||||||
- sudo wo site create html.net --html || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create html.net --html || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create php.com --php || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create php.com --php || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
|
||||||
- sudo wo site create mysql.com --mysql || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create mysql.com --mysql || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create site1.com --wp || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create mysql-php73.com --mysql --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
|
||||||
- sudo wo site create site2.net --wp --wpsc || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wp1.com --wp || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create site4.com --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wp-php73.com --wp --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create site4.net --wp --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site create site4.org --wpfc --wp || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site create site5.com --wpsubdir || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
- sudo wo site create site6.com --wpsubdir --wpsc || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wpsc1.net --wpsc || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create site8.com --wpsubdir --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wpfc1.com --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create site8.net --wpfc --wpsubdir || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site create site9.com --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
- sudo wo site create site10.org --wpsubdomain --wpsc || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wpsc-php73.net --wpsc --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create site12.org --wpsubdomain --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wpfc-php73.net --wpfc --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create site12.in --wpfc --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
- yes | sudo wo site create site.hhvm.pagespeed2.com --wpsc --hhvm || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wpredis.net --wpredis || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- yes | sudo wo site create site.hhvm.pagespeed4.com --wpfc --hhvm || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wpredis-php73.net --wpredis --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- yes | sudo wo site create site.hhvm.pagespeed5.com --wpsubdir --hhvm || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site create site.hhvm.pagespeed6.com --wpsubdir --wpsc --hhvm || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site create site.hhvm.pagespeed8.com --wpsubdir --wpfc --hhvm || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site create site.hhvm.pagespeed9.com --wpsubdomain --hhvm || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site create site.hhvm.pagespeed10.org --wpsubdomain --wpsc --hhvm || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site create site.hhvm.pagespeed12.in --wpfc --wpsubdomain --hhvm || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
- sudo wo site create site1.localtest.me --php --mysql || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wpsubdir1.com --wpsubdir || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create site2.localtest.me --mysql --html || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create wpsubdir-php73.com --wpsubdir --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create site3.localtest.me --php --html || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site create site4.localtest.me --wp --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site create site5.localtest.me --wp --wpsubdir --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site create site6.localtest.me --wpredis || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site create site7.localtest.me --wpsubdomain --wpredis || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site create site8.localtest.me --wpsubdir --wpredis || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
|
- sudo wo site create wpsubdirwpsc1.com --wpsubdir --wpsc || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
- sudo wo site create wpsubdirwpsc2.com --wpsubdir --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
|
||||||
|
- sudo wo site create wpsubdirwpsc1-php73.com --wpsubdir --wpsc --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
- sudo wo site create wpsubdirwpsc2-php73.com --wpsubdir --wpfc --php73|| sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
|
||||||
|
- sudo wo site create wpsubdomain1.com --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
- sudo wo site create wpsubdomain1-php73.com --wpsubdomain --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
|
||||||
|
- sudo wo site create wpsubdomainwpsc.org --wpsubdomain --wpsc || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
- sudo wo site create wpsubdomainwpfc.org --wpsubdomain --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
- sudo wo site create wpsubdomainwpfc2.in --wpfc --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
|
||||||
- sudo wo debug --all || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo debug --all=off || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo debug site12.net || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo debug site12.net --all=off || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site create 1.com --html || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create 1.com --html || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create 2.com --php || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create 2.com --php || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site create 3.com --mysql || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site create 3.com --mysql || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
|
||||||
- sudo wo site update 1.com --wp || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site update 1.com --wp || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site update 2.com --wpsubdir || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site update 2.com --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo site update 3.com --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo site update 3.com --php73 || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
|
||||||
- sudo wo site update site1.com --wp --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site update site1.com --wp --wpsc || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site update site1.com --wpredis || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
- sudo wo site update site5.com --wpsubdir --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site update site5.com --wpsubdir --wpsc || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
- sudo wo site update site9.com --wpsubdomain --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site update site9.com --wpsubdomain --wpsc || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site update site.hhvm.pagespeed12.in --hhvm=off || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- yes | sudo wo site update site9.com --hhvm || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site info site.hhvm.pagespeed12.in || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site info site9.com || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
- sudo wo site create www.site-1.com --wp || sudo tail -n50 /var/log/wo/wordops.log|| sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site create www.subsite.site-1.com --wpfc || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site update www.subsite.site-1.com --wp || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
- sudo wo site delete www.subsite.site-1.com --all --no-prompt || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
- sudo wo site delete site12.in --all --no-prompt || sudo tail -n50 /var/log/wo/wordops.log
|
|
||||||
|
|
||||||
- sudo ls /var/www/
|
- sudo ls /var/www/
|
||||||
- sudo wp --allow-root --info
|
- sudo wp --allow-root --info
|
||||||
- sudo bash -c 'cat /var/log/wo/wordops.log'
|
- sudo bash -c 'cat /var/log/wo/wordops.log | ccze -A'
|
||||||
|
|||||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -8,20 +8,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
|
|
||||||
- Updating Nginx fastcgi_cache template
|
- Updated Nginx fastcgi_cache templates
|
||||||
- Updating Nginx configuration for WordPress 5.0
|
- Updated Nginx redis_cache templates
|
||||||
|
- Updated Nginx wp-super-cache templates
|
||||||
|
- Updated Nginx configuration for WordPress 5.0
|
||||||
- remove --experimental args
|
- remove --experimental args
|
||||||
- MariaDB version bumped to 10.3
|
- MariaDB version bumped to 10.3
|
||||||
|
- Refactored Changelog
|
||||||
|
- Updated WO manual
|
||||||
|
- Updated WO bash_completion
|
||||||
|
- Refactored README.md
|
||||||
|
|
||||||
#### Added
|
#### Added
|
||||||
|
|
||||||
- Add WebP image support with Nginx mapping
|
- Add WebP image support with Nginx mapping
|
||||||
- Add PHP 7.3 support
|
- Add PHP 7.3 support
|
||||||
|
- WordPress $skip_cache variable mapping
|
||||||
|
|
||||||
#### Fixed
|
#### Fixed
|
||||||
|
|
||||||
- Nginx variable $webp_suffix on fresh install
|
- Nginx variable $webp_suffix on fresh install
|
||||||
- wo update command
|
- wo update command
|
||||||
|
- Fix php services management
|
||||||
|
- Fix WP-CLI install
|
||||||
|
|
||||||
|
|
||||||
### v3.9.2 - November 30, 2018
|
### v3.9.2 - November 30, 2018
|
||||||
|
|
||||||
|
|||||||
3
LICENSE
3
LICENSE
@@ -1,6 +1,7 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2018 WordOps
|
Copyright (c) 2018-2019 WordOps
|
||||||
|
Copyright (C) 2011-2017 EE Development Group (https://github.com/ee/ee/contributors)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="#key-features">Key Features</a> •
|
<a href="#key-features">Key Features</a> •
|
||||||
<a href="#requirements">Requirements</a> •
|
|
||||||
<a href="#getting-started">Getting Started</a> •
|
<a href="#getting-started">Getting Started</a> •
|
||||||
<a href="#usage">Usage</a> •
|
<a href="#usage">Usage</a> •
|
||||||
<a href="#cheatsheet">Cheatsheet</a> •
|
<a href="https://github.com/WordOps/WordOps/wiki/Roadmap">RoadMap</a> •
|
||||||
|
<a href="https://github.com/WordOps/WordOps/blob/master/CHANGELOG.md">Changelog</a> •
|
||||||
<a href="#credits">Credits</a> •
|
<a href="#credits">Credits</a> •
|
||||||
<a href="#license">License</a>
|
<a href="#license">License</a>
|
||||||
</p>
|
</p>
|
||||||
@@ -30,7 +30,8 @@
|
|||||||
|
|
||||||
- Easy Migration from EasyEngine v3 (migration script development in progress)
|
- Easy Migration from EasyEngine v3 (migration script development in progress)
|
||||||
- Automated WordPress, Nginx, PHP, MySQL & Redis installation
|
- Automated WordPress, Nginx, PHP, MySQL & Redis installation
|
||||||
- Optimized Nginx configuration with multiple cache backends support
|
- Up-to-date server stack with PHP 7.2 & 7.3, MariaDB 10.3 & Redis 5.0
|
||||||
|
- Optimized Nginx configurations with multiple cache backends support
|
||||||
- Let's Encrypt SSL certificates
|
- Let's Encrypt SSL certificates
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ _wo_complete()
|
|||||||
# IF YOU HAD ANOTHER CONTROLLER, YOU'D HANDLE THAT HERE
|
# IF YOU HAD ANOTHER CONTROLLER, YOU'D HANDLE THAT HERE
|
||||||
"debug")
|
"debug")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2> /dev/null) --nginx --php --php72 --fpm --fpm7 --mysql -i --interactive --all --import-slow-log --import-slow-log-interval= --nginx=off --php=off --php72=off --fpm=off --fpm7=off --mysql=off --all=off " \
|
-W "$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2> /dev/null) --nginx --php --php73 --fpm --fpm7 --mysql -i --interactive --all --import-slow-log --import-slow-log-interval= --nginx=off --php=off --php73=off --fpm=off --fpm7=off --mysql=off --all=off " \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -53,13 +53,13 @@ _wo_complete()
|
|||||||
|
|
||||||
"info")
|
"info")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--mysql --php --php72 --nginx" \
|
-W "--mysql --php --php73 --nginx" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"log")
|
"log")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "show reset gzip mail" \
|
-W "show reset gzip" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -74,17 +74,17 @@ _wo_complete()
|
|||||||
# HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE
|
# HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE
|
||||||
"install" | "purge" | "remove" )
|
"install" | "purge" | "remove" )
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--web --admin --nginx --php --php72 --mysql --wpcli --phpmyadmin --adminer --utils --all --hhvm --redis --phpredisadmin" \
|
-W "--web --admin --nginx --php --php73 --mysql --wpcli --phpmyadmin --adminer --utils --all --hhvm --redis --phpredisadmin" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
"upgrade" )
|
"upgrade" )
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--web --nginx --php --php72 --mysql --all --hhvm --php56 --no-prompt --wpcli" \
|
-W "--web --nginx --php --php73 --mysql --all --hhvm --php56 --no-prompt --wpcli" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
"start" | "stop" | "reload" | "restart" | "status")
|
"start" | "stop" | "reload" | "restart" | "status")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--nginx --php --php72 --mysql --memcache --redis" \
|
-W "--nginx --php --php73 --mysql --memcache --redis" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
"migrate")
|
"migrate")
|
||||||
@@ -136,7 +136,7 @@ _wo_complete()
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ ${COMP_WORDS[1]} == "debug" ] && ([ "$prev" != "--start" ] && [ "$prev" != "--nginx" ] && [ "$prev" != "--php" ] && [ "$prev" != "--php72" ] && [ "$prev" != "--fpm" ] && [ "$prev" != "--fpm7" ] && [ "$prev" != "--mysql" ] && [ "$prev" != "-i" ] && [ "$prev" != "--interactive" ] && [ "$prev" != "--import-slow-log" ] && [ "$prev" != "--stop" ]); then
|
if [ ${COMP_WORDS[1]} == "debug" ] && ([ "$prev" != "--start" ] && [ "$prev" != "--nginx" ] && [ "$prev" != "--php" ] && [ "$prev" != "--php73" ] && [ "$prev" != "--fpm" ] && [ "$prev" != "--fpm7" ] && [ "$prev" != "--mysql" ] && [ "$prev" != "-i" ] && [ "$prev" != "--interactive" ] && [ "$prev" != "--import-slow-log" ] && [ "$prev" != "--stop" ]); then
|
||||||
retlist="--all --wp --rewrite -i --all=off --wp=off --rewrite=off"
|
retlist="--all --wp --rewrite -i --all=off --wp=off --rewrite=off"
|
||||||
ret="${retlist[@]/$prev}"
|
ret="${retlist[@]/$prev}"
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
@@ -159,13 +159,13 @@ _wo_complete()
|
|||||||
|
|
||||||
"create")
|
"create")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--user --pass --email --html --php --php72 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --proxy= --wpredis --letsencrypt -le" \
|
-W "--user --pass --email --html --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --proxy= --wpredis --letsencrypt -le" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"update")
|
"update")
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
-W "--password --php --php72 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" \
|
-W "--password --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" \
|
||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
"delete")
|
"delete")
|
||||||
@@ -211,9 +211,9 @@ _wo_complete()
|
|||||||
"--wp")
|
"--wp")
|
||||||
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="--wp --wpsc --wpfc --hhvm --user --email --pass --wpredis --letsencrypt --php72"
|
retlist="--wp --wpsc --wpfc --hhvm --user --email --pass --wpredis --letsencrypt --php73"
|
||||||
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
||||||
retlist="--wp --wpfc --wpsc --php72 --php72=off --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew"
|
retlist="--wp --wpfc --wpsc --php73 --php73=off --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew"
|
||||||
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 --hhvm --user --email --pass --wpredis --letsencrypt --php72"
|
retlist="--wpsc --wpfc --hhvm --user --email --pass --wpredis --letsencrypt --php73"
|
||||||
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
||||||
retlist="--wpfc --wpsc --php72 --php72=off --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew"
|
retlist="--wpfc --wpsc --php73 --php73=off --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew"
|
||||||
else
|
else
|
||||||
retlist=""
|
retlist=""
|
||||||
fi
|
fi
|
||||||
@@ -248,7 +248,7 @@ _wo_complete()
|
|||||||
|
|
||||||
"--hhvm" | "--wpredis" | "--wpfc" | "--wpsc" | "--wpsubdir" | "--wpsubdomain" | "--user" | "--pass" | "--email" | "--wp")
|
"--hhvm" | "--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 --hhvm --experimenal --wpredis --php72 --letsencrypt "
|
retlist="--user --pass --email --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --wpredis --php73 --letsencrypt "
|
||||||
else
|
else
|
||||||
retlist=""
|
retlist=""
|
||||||
fi
|
fi
|
||||||
@@ -261,7 +261,7 @@ _wo_complete()
|
|||||||
|
|
||||||
"--hhvm" | "--wpredis" | "--wpfc")
|
"--hhvm" | "--wpredis" | "--wpfc")
|
||||||
if [ ${COMP_WORDS[2]} == "update" ]; then
|
if [ ${COMP_WORDS[2]} == "update" ]; then
|
||||||
retlist="--password --php --php72 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --hhvm=off --experimenal --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew"
|
retlist="--password --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew"
|
||||||
else
|
else
|
||||||
retlist=""
|
retlist=""
|
||||||
fi
|
fi
|
||||||
@@ -272,15 +272,15 @@ _wo_complete()
|
|||||||
-- $cur) )
|
-- $cur) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"--web" | "--admin" | "--nginx" | "--php" | "--php72" | "--mysql" | "--wpcli" | "--phpmyadmin" | "--adminer" | "--utils" | "--memcache" | "--redis | --phpredisadmin")
|
"--web" | "--admin" | "--nginx" | "--php" | "--php73" | "--mysql" | "--wpcli" | "--phpmyadmin" | "--adminer" | "--utils" | "--memcache" | "--redis | --phpredisadmin")
|
||||||
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 --php72 --mysql--wpcli --phpmyadmin --adminer --utils --memcache --redis --phpredisadmin"
|
retlist="--web --admin --nginx --php --php73 --mysql--wpcli --phpmyadmin --adminer --utils --memcache --redis --phpredisadmin"
|
||||||
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 --php72 --mysql --memcache --redis"
|
retlist="--nginx --php --php73 --mysql --memcache --redis"
|
||||||
elif [[ ${COMP_WORDS[1]} == "debug" ]]; then
|
elif [[ ${COMP_WORDS[1]} == "debug" ]]; then
|
||||||
retlist="--start --nginx --php --php72 --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
|
||||||
retlist="--start --nginx --php --php72 --fpm --fpm7 --mysql -i --interactive --stop --import-slow-log"
|
retlist="--start --nginx --php --php73 --fpm --fpm7 --mysql -i --interactive --stop --import-slow-log"
|
||||||
fi
|
fi
|
||||||
elif [[ ${COMP_WORDS[1]} == "log" ]]; then
|
elif [[ ${COMP_WORDS[1]} == "log" ]]; then
|
||||||
if [ ${COMP_WORDS[2]} == "show" ]; then
|
if [ ${COMP_WORDS[2]} == "show" ]; then
|
||||||
@@ -314,7 +314,7 @@ _wo_complete()
|
|||||||
elif [ ${COMP_WORDS[2]} == "delete" ]; then
|
elif [ ${COMP_WORDS[2]} == "delete" ]; then
|
||||||
retlist="--db --files --force"
|
retlist="--db --files --force"
|
||||||
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
elif [ ${COMP_WORDS[2]} == "update" ]; then
|
||||||
retlist="--password --php --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew"
|
retlist="--password --php --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew"
|
||||||
else
|
else
|
||||||
retlist=""
|
retlist=""
|
||||||
fi
|
fi
|
||||||
@@ -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 --php72 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --wpredis --letsencrypt"
|
retlist="--user --pass --email --html --php --php73 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --hhvm --wpredis --letsencrypt"
|
||||||
fi
|
fi
|
||||||
ret="${retlist[@]/$prev}"
|
ret="${retlist[@]/$prev}"
|
||||||
COMPREPLY=( $(compgen \
|
COMPREPLY=( $(compgen \
|
||||||
|
|||||||
32
docs/wo.8
32
docs/wo.8
@@ -5,15 +5,15 @@
|
|||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
wo [ --version | --help | info | stack | site | debug | update | clean | import_slow_log | log | secure | sync]
|
wo [ --version | --help | info | stack | site | debug | update | clean | import_slow_log | log | secure | sync]
|
||||||
.TP
|
.TP
|
||||||
wo stack [ install | remove | purge | migrate | upgrade] [ --web | --mail | --all | --nginx | --php | --php72 | --mysql | --admin | --postfix | --mailscanner | --adminer | --redis | --hhvm | --phpmyadmin | --phpredisadmin | --wpcli | --utils ]
|
wo stack [ install | remove | purge | migrate | upgrade] [ --web | --all | --nginx | --php | --php73 | --mysql | --admin | --adminer | --redis | --hhvm | --phpmyadmin | --phpredisadmin | --wpcli | --utils ]
|
||||||
.TP
|
.TP
|
||||||
wo stack [ status | start | stop | reload | restart ] [--all | --nginx | --php | --php72 |--mysql | --devcot | --web | --postfix | --memcache | --redis]
|
wo stack [ status | start | stop | reload | restart ] [--all | --nginx | --php | --php73 |--mysql | --web | --memcache | --redis]
|
||||||
.TP
|
.TP
|
||||||
wo site [ list | info | show | enable | disable | edit | cd | show ] [ example.com ]
|
wo site [ list | info | show | enable | disable | edit | cd | show ] [ example.com ]
|
||||||
.TP
|
.TP
|
||||||
wo site create example.com [ --html | --php | --php72 | --mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --letsencrypt/-le]]
|
wo site create example.com [ --html | --php | --php73 | --mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --wpfc | --wpredis | --hhvm | --letsencrypt/-le]]
|
||||||
.TP
|
.TP
|
||||||
wo site update example.com [ --php | --php72 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm ] [--password] [--letsencrypt=on/off/renew]]
|
wo site update example.com [ --php | --php73 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --wpfc | --wpredis | --hhvm ] [--password] [--letsencrypt=on/off/renew]]
|
||||||
.TP
|
.TP
|
||||||
wo site delete example.com [--db | --files | --all | --no-prompt | --force/-f ]
|
wo site delete example.com [--db | --files | --all | --no-prompt | --force/-f ]
|
||||||
.TP
|
.TP
|
||||||
@@ -46,19 +46,19 @@ Display WordOps (wo) help.
|
|||||||
.TP
|
.TP
|
||||||
.B stack
|
.B stack
|
||||||
.TP
|
.TP
|
||||||
.B install [ --all | --web | --mail | --nginx | --php | --php72 |--mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ]
|
.B install [ --all | --web | --nginx | --php | --php73 |--mysql | --redis | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ]
|
||||||
.br
|
.br
|
||||||
Install Nginx PHP5 MySQL Postfix stack Packages if not used with
|
Install Nginx PHP5 MySQL Postfix stack Packages if not used with
|
||||||
.br
|
.br
|
||||||
any options.Installs specific package if used with option.
|
any options.Installs specific package if used with option.
|
||||||
.TP
|
.TP
|
||||||
.B remove [ --all | --web | --mail | --nginx | --php | --php72 |--mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ]
|
.B remove [ --all | --web | --nginx | --php | --php73 |--mysql | --redis | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ]
|
||||||
.br
|
.br
|
||||||
Remove Nginx PHP5 MySQL Postfix stack Packages if not used with
|
Remove Nginx PHP5 MySQL Postfix stack Packages if not used with
|
||||||
.br
|
.br
|
||||||
any options. Remove specific package if used with option.
|
any options. Remove specific package if used with option.
|
||||||
.TP
|
.TP
|
||||||
.B purge [ --all | --web | --mail | --nginx | --php | --php72 |--mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ]
|
.B purge [ --all | --web | --nginx | --php | --php73 |--mysql | --redis | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ]
|
||||||
.br
|
.br
|
||||||
Purge Nginx PHP5 MySQL Postfix stack Packages if not used with any
|
Purge Nginx PHP5 MySQL Postfix stack Packages if not used with any
|
||||||
.br
|
.br
|
||||||
@@ -66,23 +66,23 @@ options.Purge specific package if used with option.
|
|||||||
.TP
|
.TP
|
||||||
.B status
|
.B status
|
||||||
.br
|
.br
|
||||||
Display status of NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server services.
|
Display status of NGINX, PHP7.2-FPM, MySQL, Redis-Server services.
|
||||||
.TP
|
.TP
|
||||||
.B start
|
.B start
|
||||||
.br
|
.br
|
||||||
Start services NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server.
|
Start services NGINX, PHP7.2-FPM, MySQL, Redis-Server.
|
||||||
.TP
|
.TP
|
||||||
.B stop
|
.B stop
|
||||||
.br
|
.br
|
||||||
Stop services NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server.
|
Stop services NGINX, PHP7.2-FPM, MySQL, Redis-Server.
|
||||||
.TP
|
.TP
|
||||||
.B reload
|
.B reload
|
||||||
.br
|
.br
|
||||||
Reload services NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server.
|
Reload services NGINX, PHP7.2-FPM, MySQL, Redis-Server.
|
||||||
.TP
|
.TP
|
||||||
.B restart
|
.B restart
|
||||||
.br
|
.br
|
||||||
Restart services NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server.
|
Restart services NGINX, PHP7.2-FPM, MySQL, Redis-Server.
|
||||||
.TP
|
.TP
|
||||||
.B site
|
.B site
|
||||||
.br
|
.br
|
||||||
@@ -129,13 +129,13 @@ Disable site by Destroying softlink with site file in
|
|||||||
.br
|
.br
|
||||||
Edit NGINX configuration of site.
|
Edit NGINX configuration of site.
|
||||||
.TP
|
.TP
|
||||||
.B create [ example.com ] [ --html | --php | --php72 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm ]]
|
.B create [ example.com ] [ --html | --php | --php73 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --wpfc | --wpredis | --hhvm ]]
|
||||||
.br
|
.br
|
||||||
Create new site according to given options. If no options provided
|
Create new site according to given options. If no options provided
|
||||||
.br
|
.br
|
||||||
create static site with html only.
|
create static site with html only.
|
||||||
.TP
|
.TP
|
||||||
.B update [ example.com ] [ --html | --php | --php72 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [ --wpsc | --w3tc | --wpfc | --wpredis | --hhvm ] [--password]]
|
.B update [ example.com ] [ --html | --php | --php73 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [ --wpsc | --wpfc | --wpredis | --hhvm ] [--password]]
|
||||||
.br
|
.br
|
||||||
Update site configuration according to specified options.
|
Update site configuration according to specified options.
|
||||||
.TP
|
.TP
|
||||||
@@ -143,7 +143,7 @@ Update site configuration according to specified options.
|
|||||||
.br
|
.br
|
||||||
Delete site i.e webroot, database, ad configuration permanently.
|
Delete site i.e webroot, database, ad configuration permanently.
|
||||||
.TP
|
.TP
|
||||||
.B debug [ -i | --nginx=on/off | --php=on/off | --php72=on/off | --mysql=on/off | --rewrite=on/off | --fpm=on/off | --fpm7=on/off ]
|
.B debug [ -i | --nginx=on/off | --php=on/off | --php73=on/off | --mysql=on/off | --rewrite=on/off | --fpm=on/off | --fpm7=on/off ]
|
||||||
.br
|
.br
|
||||||
Starts server level debugging. If this is used without arguments it will start debugging
|
Starts server level debugging. If this is used without arguments it will start debugging
|
||||||
.br
|
.br
|
||||||
@@ -182,7 +182,7 @@ used with wo debug command. used to start or stop nginx debugging.
|
|||||||
.br
|
.br
|
||||||
used with wo debug command. used to start or stop php debugging.
|
used with wo debug command. used to start or stop php debugging.
|
||||||
.TP
|
.TP
|
||||||
.B --php72=on/off
|
.B --php73=on/off
|
||||||
.br
|
.br
|
||||||
used with wo debug command. used to start or stop php72 debugging.
|
used with wo debug command. used to start or stop php72 debugging.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
191
install
191
install
@@ -7,7 +7,7 @@
|
|||||||
# Copyright (c) 2019 - WordOps
|
# Copyright (c) 2019 - WordOps
|
||||||
# This script is licensed under M.I.T
|
# This script is licensed under M.I.T
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# Version 3.9.3 - 2019-03-04
|
# Version 3.9.3 - 2019-03-05
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
readonly wo_version_old="2.2.3"
|
readonly wo_version_old="2.2.3"
|
||||||
readonly wo_version_new="3.9.3"
|
readonly wo_version_new="3.9.3"
|
||||||
@@ -27,7 +27,7 @@ TPUT_FAIL=$(tput setaf 1)
|
|||||||
|
|
||||||
wo_lib_echo () {
|
wo_lib_echo () {
|
||||||
TPUT_ECHO=$(tput setaf 4)
|
TPUT_ECHO=$(tput setaf 4)
|
||||||
echo "${TPUT_ECHO}${*}${TPUT_RESET}"
|
echo "${*}${TPUT_RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
wo_lib_echo_info()
|
wo_lib_echo_info()
|
||||||
@@ -82,7 +82,7 @@ fi
|
|||||||
###
|
###
|
||||||
# 1 - Define variables for later use
|
# 1 - Define variables for later use
|
||||||
###
|
###
|
||||||
wo_branch=$1
|
wo_branch="$1"
|
||||||
migration=0
|
migration=0
|
||||||
readonly wo_log_dir=/var/log/wo/
|
readonly wo_log_dir=/var/log/wo/
|
||||||
readonly wo_install_log=/var/log/wo/install.log
|
readonly wo_install_log=/var/log/wo/install.log
|
||||||
@@ -96,17 +96,13 @@ if [ "$wo_linux_distro" != "Ubuntu" ] && [ "$wo_linux_distro" != "Debian" ]; the
|
|||||||
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu and Debian at the moment."
|
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu and Debian at the moment."
|
||||||
wo_lib_echo_fail "If you are feeling adventurous, you are free to fork WordOps to support"
|
wo_lib_echo_fail "If you are feeling adventurous, you are free to fork WordOps to support"
|
||||||
wo_lib_echo_fail "other Linux distributions and perhaps even Unix deratives."
|
wo_lib_echo_fail "other Linux distributions and perhaps even Unix deratives."
|
||||||
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu 14.04/16.04/18.04, Debian 8.x and Debian 9.x"
|
|
||||||
exit 100
|
|
||||||
fi
|
|
||||||
|
|
||||||
###
|
|
||||||
# 1 - WordOps (wo) only supports Ubuntu/Debian versions that are eligible for support
|
|
||||||
###
|
|
||||||
lsb_release -d | grep -E "14.04|16.04|18.04|jessie|stretch" &>> /dev/null
|
|
||||||
if [ "$?" -ne "0" ]; then
|
|
||||||
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu 14.04/16.04/18.04, Debian 8.x and Debian 9.x"
|
|
||||||
exit 100
|
exit 100
|
||||||
|
else
|
||||||
|
check_wo_linux_distro=$(lsb_release -sc | grep -E "trusty|xenial|bionic|jessie|stretch")
|
||||||
|
if [ -z "$check_wo_linux_distro" ]; then
|
||||||
|
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu 14.04/16.04/18.04, Debian 8.x and Debian 9.x"
|
||||||
|
exit 100
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -127,16 +123,18 @@ fi
|
|||||||
####
|
####
|
||||||
wo_install_dep()
|
wo_install_dep()
|
||||||
{
|
{
|
||||||
echo -ne ' Installing dependencies [..]\r'
|
echo -ne "${TPUT_ECHO}Installing dependencies ${TPUT_RESET}[..]\r"
|
||||||
if {
|
if {
|
||||||
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
||||||
apt-get -y install build-essential curl gzip python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 > /dev/null 2>&1
|
apt-get -y install build-essential curl gzip python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
apt-get -y install build-essential curl gzip dirmngr python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 > /dev/null 2>&1
|
apt-get -y install build-essential curl gzip dirmngr python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
}; then echo -ne ' Installing dependencies [OK]\r'
|
}; then echo -ne "${TPUT_ECHO}Installing dependencies ${TPUT_RESET}[OK]\r"
|
||||||
|
echo -ne '\n'
|
||||||
else
|
else
|
||||||
echo -e " Installing dependencies [FAIL]"
|
echo -e "${TPUT_FAIL}Installing dependencies ${TPUT_RESET}[FAIL]"
|
||||||
|
echo -ne '\n'
|
||||||
fi
|
fi
|
||||||
locale-gen en &>> /dev/null
|
locale-gen en &>> /dev/null
|
||||||
|
|
||||||
@@ -150,34 +148,6 @@ wo_install_dep()
|
|||||||
sed -i 's/TLSv1 TLSv1.1 TLSv1.2;/TLSv1.2;/g' /etc/nginx/nginx.conf
|
sed -i 's/TLSv1 TLSv1.1 TLSv1.2;/TLSv1.2;/g' /etc/nginx/nginx.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
|
||||||
add-apt-repository -y 'ppa:ondrej/php'
|
|
||||||
wo_lib_echo "Updating the PHP repository for some neat PHP 7.2 support"
|
|
||||||
apt-get update &>> /dev/null
|
|
||||||
apt-get -y install php7.2-fpm php7.2-curl php7.2-gd php-memcached php7.2-imap php7.2-common php7.2-readline php-redis php7.2-mysql php7.2-cli php-imagick php7.2-mbstring php7.2-recode php7.2-bcmath php7.2-opcache php7.2-zip php7.2-xml php7.2-soap php-msgpack graphviz php-pear php-xdebug || wo_lib_error "Not all PHP packages could be installed. " 1
|
|
||||||
mkdir -p /var/log/php/7.2/
|
|
||||||
touch /var/log/php/7.2/slow.log /var/log/php/7.2/fpm.log
|
|
||||||
systemctl php7.2-fpm restart &>> /dev/null
|
|
||||||
|
|
||||||
elif [ "$wo_linux_distro" == "Debian" ]; then
|
|
||||||
apt-get install apt-transport-https lsb-release ca-certificates locales locales-all -y
|
|
||||||
export LC_ALL=en_US.UTF-8
|
|
||||||
export LANG=en_US.UTF-8
|
|
||||||
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
|
||||||
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
|
|
||||||
apt-get update &>> /dev/null
|
|
||||||
apt-get -y install php7.2-fpm php7.2-curl php7.2-gd php-memcached php7.2-imap php7.2-common php7.2-readlne php-redis php7.2-mysql php7.2-cli php-imagick php7.2-mbstring php7.2-recode php7.2-bcmath php7.2-opcache php7.2-zip php7.2-xml php7.2-soap php-msgpack graphviz php-pear php-xdebug || wo_lib_error "Not all PHP packages could be installed." 1
|
|
||||||
systemctl php7.2-fpm restart &>> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
###
|
|
||||||
# Webp mapping
|
|
||||||
###
|
|
||||||
[ ! -f /etc/nginx/conf.d/webp.conf ] && {
|
|
||||||
mkdir -p /etc/nginx/conf.d
|
|
||||||
echo -e 'map $http_accept $webp_suffix {\n default "";\n "~*webp" ".webp";\n}\n' > /etc/nginx/conf.d/webp.conf
|
|
||||||
}
|
|
||||||
|
|
||||||
# Let's Encrypt .well-known folder setup
|
# Let's Encrypt .well-known folder setup
|
||||||
if [ ! -d /var/www/html/.well-known/acme-challenge ]; then
|
if [ ! -d /var/www/html/.well-known/acme-challenge ]; then
|
||||||
mkdir -p /var/www/html/.well-known/acme-challenge
|
mkdir -p /var/www/html/.well-known/acme-challenge
|
||||||
@@ -389,20 +359,25 @@ wo_update_wp_cli()
|
|||||||
# Now, finally, let's install WordOps
|
# Now, finally, let's install WordOps
|
||||||
wo_install()
|
wo_install()
|
||||||
{
|
{
|
||||||
rm -rf /tmp/easyengine
|
if {
|
||||||
rm -rf /tmp/wordops
|
echo -ne "${TPUT_ECHO}Installing Wordops $wo_branch ${TPUT_RESET}[..]\r"
|
||||||
|
rm -rf /tmp/easyengine
|
||||||
|
rm -rf /tmp/wordops
|
||||||
|
|
||||||
wo_lib_echo "Downloading WordOps straight from GitHub - fresh and brewed with love. Hold your horses..."
|
[ -z "$wo_branch" ] && {
|
||||||
[ -z "$wo_branch" ] && {
|
wo_branch=master
|
||||||
wo_branch=master
|
}
|
||||||
}
|
|
||||||
|
|
||||||
git clone -b "$wo_branch" https://github.com/WordOps/WordOps.git /tmp/wordops --quiet > /dev/null \
|
git clone -b "$wo_branch" https://github.com/WordOps/WordOps.git /tmp/wordops --quiet > /dev/null 2>&1
|
||||||
|| wo_lib_error "An error was encountered during the download, exit status" $?
|
|
||||||
|
|
||||||
cd /tmp/wordops || exit 1
|
cd /tmp/wordops || exit 1
|
||||||
wo_lib_echo "The moment you've all been waiting for, time to install WordOps!"
|
python3 setup.py install > /dev/null 2>&1
|
||||||
python3 setup.py install || wo_lib_error "An error was encountered during the installation, exit status " $?
|
}; then echo -ne "${TPUT_ECHO}Installing Wordops $wo_branch ${TPUT_RESET}[OK]\r"
|
||||||
|
echo -ne '\n'
|
||||||
|
else
|
||||||
|
echo -e "${TPUT_FAIL}Installing Wordops $wo_branch ${TPUT_RESET}[FAIL]"
|
||||||
|
echo -ne '\n'
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
wo_update_latest()
|
wo_update_latest()
|
||||||
@@ -427,10 +402,10 @@ wo_update_latest()
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Move ~/.my.cnf to /etc/mysql/conf.d/my.cnf
|
# Move ~/.my.cnf to /etc/mysql/conf.d/my.cnf
|
||||||
if [ ! -f /etc/mysql/conf.d/my.cnf ]
|
if [ ! -f /etc/mysql/conf.d/my.cnf ]
|
||||||
then
|
then
|
||||||
#create conf.d folder if not exist
|
# create conf.d folder if not exist
|
||||||
if [ ! -d /etc/mysql/conf.d ]; then
|
if [ ! -d /etc/mysql/conf.d ]; then
|
||||||
mkdir -p /etc/mysql/conf.d
|
mkdir -p /etc/mysql/conf.d
|
||||||
chmod 755 /etc/mysql/conf.d
|
chmod 755 /etc/mysql/conf.d
|
||||||
@@ -475,11 +450,11 @@ wo_update_latest()
|
|||||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom nginx-ee
|
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom nginx-ee
|
||||||
service nginx restart &>> /dev/null
|
service nginx restart &>> /dev/null
|
||||||
fi
|
fi
|
||||||
dpkg --get-selections | grep -v deinstall | grep nginx-common
|
CHECK_NGINX_COMMON=$(dpkg --get-selections | grep -v deinstall | grep nginx-common)
|
||||||
if [ $? -eq 0 ]; then
|
if [ -n "$CHECK_NGINX_COMMON" ]; then
|
||||||
apt-get update
|
apt-get update
|
||||||
dpkg --get-selections | grep -v deinstall | grep nginx-mainline
|
CHECK_NGINX_MAILINE=$(dpkg --get-selections | grep -v deinstall | grep nginx-mainline)
|
||||||
if [ $? -eq 0 ]; then
|
if [ -n "$CHECK_NGINX_MAILINE" ]; then
|
||||||
apt-get remove -y nginx-mainline
|
apt-get remove -y nginx-mainline
|
||||||
fi
|
fi
|
||||||
service nginx stop &>> /dev/null
|
service nginx stop &>> /dev/null
|
||||||
@@ -503,11 +478,11 @@ wo_update_latest()
|
|||||||
apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom
|
apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom
|
||||||
systemctl restart nginx &>> /dev/null
|
systemctl restart nginx &>> /dev/null
|
||||||
fi
|
fi
|
||||||
dpkg --get-selections | grep -v deinstall | grep nginx-common
|
CHECK_NGINX_COMMON=$(dpkg --get-selections | grep -v deinstall | grep nginx-common)
|
||||||
if [ $? -eq 0 ]; then
|
if [ -n "$CHECK_NGINX_COMMON" ]; then
|
||||||
apt-get update
|
apt-get update
|
||||||
dpkg --get-selections | grep -v deinstall | grep nginx-mainline
|
CHECK_NGINX_MAILINE=$(dpkg --get-selections | grep -v deinstall | grep nginx-mainline)
|
||||||
if [ $? -eq 0 ]; then
|
if [ -n "$CHECK_NGINX_MAILINE" ]; then
|
||||||
apt-get remove -y nginx-mainline
|
apt-get remove -y nginx-mainline
|
||||||
fi
|
fi
|
||||||
systemctl stop nginx &>> /dev/null
|
systemctl stop nginx &>> /dev/null
|
||||||
@@ -525,8 +500,8 @@ wo_update_latest()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Fix HHVM autostart on reboot
|
# Fix HHVM autostart on reboot
|
||||||
dpkg --get-selections | grep -v deinstall | grep hhvm &>> /dev/null
|
CHECK_HHVM_INSTALL=$(dpkg --get-selections | grep -v deinstall | grep hhvm &>> /dev/null)
|
||||||
if [ $? -eq 0 ]; then
|
if [ -n "$CHECK_HHVM_INSTALL" ]; then
|
||||||
update-rc.d hhvm defaults &>> /dev/null
|
update-rc.d hhvm defaults &>> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -579,8 +554,8 @@ wo_update_latest()
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Fix Redis-server security issue
|
# Fix Redis-server security issue
|
||||||
#http://redis.io/topics/security
|
# http://redis.io/topics/security
|
||||||
if [ -f /etc/redis/redis.conf ]; then
|
if [ -f /etc/redis/redis.conf ]; then
|
||||||
grep -0 -v "#" /etc/redis/redis.confse | grep 'bind' &>> /dev/null
|
grep -0 -v "#" /etc/redis/redis.confse | grep 'bind' &>> /dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@@ -597,7 +572,7 @@ wo_update_latest()
|
|||||||
|
|
||||||
|
|
||||||
# Fix for 3.3.2 renamed nginx.conf
|
# Fix for 3.3.2 renamed nginx.conf
|
||||||
nginx -V 2>&1 &>>/dev/null
|
nginx -V &>>/dev/null 2>&1
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
nginx -t 2>&1 | grep 'open() "/etc/nginx/nginx.conf" failed' &>>/dev/null
|
nginx -t 2>&1 | grep 'open() "/etc/nginx/nginx.conf" failed' &>>/dev/null
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
@@ -634,27 +609,7 @@ wo_update_latest()
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
# Fix for SSL cert --all
|
||||||
add-apt-repository -y 'ppa:ondrej/php'
|
|
||||||
wo_lib_echo "Updating the PHP repository for some neat PHP 7.2 support"
|
|
||||||
apt-get update &>> /dev/null
|
|
||||||
apt-get -y install php7.2-fpm php7.2-curl php7.2-gd php7.2-imap php-memcached php7.2-common php7.2-readline php-redis php7.2-mysql php7.2-cli php-imagick php7.2-mbstring php7.2-recode php7.2-bcmath php7.2-opcache php7.2-zip php7.2-xml php7.2-soap php-msgpack graphviz php-pear php-xdebug || wo_lib_error "Not all PHP packages could be installed. " 1
|
|
||||||
mkdir -p /var/log/php/7.2/
|
|
||||||
touch /var/log/php/7.2/slow.log /var/log/php/7.2/fpm.log
|
|
||||||
systemctl php7.2-fpm restart &>> /dev/null
|
|
||||||
|
|
||||||
elif [ "$wo_linux_distro" == "Debian" ]; then
|
|
||||||
apt-get install apt-transport-https lsb-release ca-certificates locales locales-all -y
|
|
||||||
export LC_ALL=en_US.UTF-8
|
|
||||||
export LANG=en_US.UTF-8
|
|
||||||
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
|
||||||
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
|
|
||||||
apt-get update &>> /dev/null
|
|
||||||
apt-get -y install php7.2-fpm php7.2-curl php7.2-gd php7.2-imap php-memcached php7.2-common php7.2-readline php-redis php7.2-mysql php7.2-cli php-imagick php7.2-mbstring php7.2-recode php7.2-bcmath php7.2-opcache php7.2-zip php7.2-xml php7.2-soap php-msgpack graphviz php-pear php-xdebug || wo_lib_error "Not all PHP packages could be installed." 1
|
|
||||||
systemctl php7.2-fpm restart &>> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Fix for SSL cert --all
|
|
||||||
crontab -l | grep -q '\-\-min_expiry_limit'
|
crontab -l | grep -q '\-\-min_expiry_limit'
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
crontab -l > /var/spool/cron/cron-backup.txt #backup cron before editing
|
crontab -l > /var/spool/cron/cron-backup.txt #backup cron before editing
|
||||||
@@ -683,7 +638,7 @@ wo_git_init()
|
|||||||
git add -A .
|
git add -A .
|
||||||
git commit -am "Installed/Updated to WordOps" &>> /dev/null
|
git commit -am "Installed/Updated to WordOps" &>> /dev/null
|
||||||
|
|
||||||
#PHP under git version control
|
# PHP under git version control
|
||||||
[ -d /etc/php ] && {
|
[ -d /etc/php ] && {
|
||||||
cd /etc/php || exit 1
|
cd /etc/php || exit 1
|
||||||
if [ ! -d /etc/php/.git ]; then
|
if [ ! -d /etc/php/.git ]; then
|
||||||
@@ -694,24 +649,18 @@ wo_git_init()
|
|||||||
}> /dev/null
|
}> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ ! -x /usr/local/bin/ee ]; then
|
###
|
||||||
if [ ! -x /usr/local/bin/wo ]; then
|
# 4 - WO MAIN SETUP
|
||||||
wo_lib_echo "Installing depedencies" | tee -ai $wo_install_log
|
###
|
||||||
wo_install_dep | tee -ai $wo_install_log
|
|
||||||
wo_lib_echo "Installing WordOps $wo_branch" | tee -ai $wo_install_log
|
# 1 - WO already installed
|
||||||
wo_install | tee -ai $wo_install_log
|
if [ -x /usr/local/bin/wo ]; then
|
||||||
wo_lib_echo "Running post-install steps" | tee -ai $wo_install_log
|
|
||||||
secure_wo_db | tee -ai $EE_INSTALL_LOG
|
|
||||||
wo_git_init | tee -ai $wo_install_log
|
|
||||||
wo_update_wp_cli | tee -ai $wo_install_log
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
wo -v 2>&1 | grep $wo_version_new &>> /dev/null
|
wo -v 2>&1 | grep $wo_version_new &>> /dev/null
|
||||||
if [[ $? -ne 0 ]];then
|
if [[ $? -ne 0 ]];then
|
||||||
read -p "Update WordOps to $wo_version_new (y/n): " wo_ans
|
read -p "Update WordOps to $wo_version_new (y/n): " wo_ans
|
||||||
if [ "$wo_ans" = "y" ] || [ "$wo_ans" = "Y" ]; then
|
if [ "$wo_ans" = "y" ] || [ "$wo_ans" = "Y" ]; then
|
||||||
wo_install_dep | tee -ai $wo_install_log
|
wo_install_dep | tee -ai $wo_install_log
|
||||||
wo_sync_db 2&>>1 $EE_INSTALL_LOG
|
wo_sync_db >> $EE_INSTALL_LOG 2>&1
|
||||||
secure_wo_db | tee -ai $EE_INSTALL_LOG
|
secure_wo_db | tee -ai $EE_INSTALL_LOG
|
||||||
wo_upgrade_php | tee -ai $wo_install_log
|
wo_upgrade_php | tee -ai $wo_install_log
|
||||||
wo_install | tee -ai $wo_install_log
|
wo_install | tee -ai $wo_install_log
|
||||||
@@ -726,6 +675,38 @@ else
|
|||||||
else
|
else
|
||||||
wo_lib_error "You already have WordOps $wo_version_new, exit status = " 1
|
wo_lib_error "You already have WordOps $wo_version_new, exit status = " 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
# 2 - Migration from EEv3
|
||||||
|
if [ -x /usr/local/bin/ee ]; then
|
||||||
|
ee -v 2>&1 | grep $wo_version_new &>> /dev/null
|
||||||
|
if [[ $? -ne 0 ]];then
|
||||||
|
read -p "Update WordOps to $wo_version_new (y/n): " wo_ans
|
||||||
|
if [ "$wo_ans" = "y" ] || [ "$wo_ans" = "Y" ]; then
|
||||||
|
wo_install_dep | tee -ai $wo_install_log
|
||||||
|
wo_sync_db >> $EE_INSTALL_LOG 2>&1
|
||||||
|
secure_wo_db | tee -ai $EE_INSTALL_LOG
|
||||||
|
wo_upgrade_php | tee -ai $wo_install_log
|
||||||
|
wo_install | tee -ai $wo_install_log
|
||||||
|
wo_update_latest | tee -ai $wo_install_log
|
||||||
|
wo_git_init | tee -ai $wo_install_log
|
||||||
|
service nginx reload &>> /dev/null
|
||||||
|
service php7.2-fpm restart &>> /dev/null
|
||||||
|
wo_update_wp_cli | tee -ai $wo_install_log
|
||||||
|
else
|
||||||
|
wo_lib_error "Not updating WordOps to $wo_version_new, exit status = " 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
wo_lib_error "You already have WordOps $wo_version_new, exit status = " 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# 3 - Fresh WO setup
|
||||||
|
wo_install_dep | tee -ai $wo_install_log
|
||||||
|
wo_install | tee -ai $wo_install_log
|
||||||
|
wo_lib_echo "Running post-install steps" | tee -ai $wo_install_log
|
||||||
|
secure_wo_db | tee -ai $EE_INSTALL_LOG
|
||||||
|
wo_git_init | tee -ai $wo_install_log
|
||||||
|
wo_update_wp_cli | tee -ai $wo_install_log
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wo sync | tee -ai $WO_INSTALL_LOG
|
wo sync | tee -ai $WO_INSTALL_LOG
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ VERSION = WOVariables.wo_version
|
|||||||
|
|
||||||
BANNER = """
|
BANNER = """
|
||||||
WordOps v%s
|
WordOps v%s
|
||||||
Copyright (c) 2018 WordOps.
|
Copyright (c) 2019 WordOps.
|
||||||
""" % VERSION
|
""" % VERSION
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ class WOCleanController(CementBaseController):
|
|||||||
label = 'clean'
|
label = 'clean'
|
||||||
stacked_on = 'base'
|
stacked_on = 'base'
|
||||||
stacked_type = 'nested'
|
stacked_type = 'nested'
|
||||||
description = ('Clean NGINX FastCGI cache, Opcache, Memcache, Redis Cache')
|
description = ('Clean NGINX FastCGI cache, Opcache, Memcached, Redis Cache')
|
||||||
arguments = [
|
arguments = [
|
||||||
(['--all'],
|
(['--all'],
|
||||||
dict(help='Clean all cache', action='store_true')),
|
dict(help='Clean all cache', action='store_true')),
|
||||||
(['--fastcgi'],
|
(['--fastcgi'],
|
||||||
dict(help='Clean FastCGI cache', action='store_true')),
|
dict(help='Clean FastCGI cache', action='store_true')),
|
||||||
(['--memcache'],
|
(['--memcached'],
|
||||||
dict(help='Clean MemCache', action='store_true')),
|
dict(help='Clean MemCached', action='store_true')),
|
||||||
(['--opcache'],
|
(['--opcache'],
|
||||||
dict(help='Clean OpCache', action='store_true')),
|
dict(help='Clean OpCache', action='store_true')),
|
||||||
(['--redis'],
|
(['--redis'],
|
||||||
@@ -37,22 +37,23 @@ class WOCleanController(CementBaseController):
|
|||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def default(self):
|
def default(self):
|
||||||
if (not (self.app.pargs.all or self.app.pargs.fastcgi or
|
if (not (self.app.pargs.all or self.app.pargs.fastcgi or
|
||||||
self.app.pargs.memcache or self.app.pargs.opcache or
|
self.app.pargs.memcached or self.app.pargs.opcache or
|
||||||
self.app.pargs.redis)):
|
self.app.pargs.redis)):
|
||||||
self.clean_fastcgi()
|
self.clean_fastcgi()
|
||||||
if self.app.pargs.all:
|
if self.app.pargs.all:
|
||||||
self.clean_memcache()
|
self.clean_memcached()
|
||||||
self.clean_fastcgi()
|
self.clean_fastcgi()
|
||||||
self.clean_opcache()
|
self.clean_opcache()
|
||||||
self.clean_redis()
|
self.clean_redis()
|
||||||
if self.app.pargs.fastcgi:
|
if self.app.pargs.fastcgi:
|
||||||
self.clean_fastcgi()
|
self.clean_fastcgi()
|
||||||
if self.app.pargs.memcache:
|
if self.app.pargs.memcached:
|
||||||
self.clean_memcache()
|
self.clean_memcached()
|
||||||
if self.app.pargs.opcache:
|
if self.app.pargs.opcache:
|
||||||
self.clean_opcache()
|
self.clean_opcache()
|
||||||
if self.app.pargs.redis:
|
if self.app.pargs.redis:
|
||||||
self.clean_redis()
|
self.clean_redis()
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def clean_redis(self):
|
def clean_redis(self):
|
||||||
"""This function clears Redis cache"""
|
"""This function clears Redis cache"""
|
||||||
@@ -67,9 +68,9 @@ class WOCleanController(CementBaseController):
|
|||||||
try:
|
try:
|
||||||
if(WOAptGet.is_installed(self, "memcached")):
|
if(WOAptGet.is_installed(self, "memcached")):
|
||||||
WOService.restart_service(self, "memcached")
|
WOService.restart_service(self, "memcached")
|
||||||
Log.info(self, "Cleaning MemCache")
|
Log.info(self, "Cleaning MemCached")
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Memcache not installed")
|
Log.info(self, "Memcached not installed")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Log.debug(self, "{0}".format(e))
|
Log.debug(self, "{0}".format(e))
|
||||||
Log.error(self, "Unable to restart Memcached", False)
|
Log.error(self, "Unable to restart Memcached", False)
|
||||||
@@ -97,6 +98,7 @@ class WOCleanController(CementBaseController):
|
|||||||
" or install them with `wo stack install --admin`")
|
" or install them with `wo stack install --admin`")
|
||||||
Log.error(self, "Unable to clean opcache", False)
|
Log.error(self, "Unable to clean opcache", False)
|
||||||
|
|
||||||
|
|
||||||
def load(app):
|
def load(app):
|
||||||
# register the plugin class.. this only happens if the plugin is enabled
|
# register the plugin class.. this only happens if the plugin is enabled
|
||||||
handler.register(WOCleanController)
|
handler.register(WOCleanController)
|
||||||
|
|||||||
@@ -42,19 +42,19 @@ class WODebugController(CementBaseController):
|
|||||||
action='store' or 'store_const',
|
action='store' or 'store_const',
|
||||||
choices=('on', 'off'), const='on', nargs='?')),
|
choices=('on', 'off'), const='on', nargs='?')),
|
||||||
(['--php'],
|
(['--php'],
|
||||||
dict(help='start/stop debugging server PHP configuration',
|
dict(help='start/stop debugging server PHP 7.2 configuration',
|
||||||
action='store' or 'store_const',
|
action='store' or 'store_const',
|
||||||
choices=('on', 'off'), const='on', nargs='?')),
|
choices=('on', 'off'), const='on', nargs='?')),
|
||||||
(['--fpm'],
|
(['--fpm'],
|
||||||
dict(help='start/stop debugging fastcgi configuration',
|
dict(help='start/stop debugging fastcgi configuration',
|
||||||
action='store' or 'store_const',
|
action='store' or 'store_const',
|
||||||
choices=('on', 'off'), const='on', nargs='?')),
|
choices=('on', 'off'), const='on', nargs='?')),
|
||||||
(['--php72'],
|
(['--php73'],
|
||||||
dict(help='start/stop debugging server PHP 7.2 configuration',
|
dict(help='start/stop debugging server PHP 7.3 configuration',
|
||||||
action='store' or 'store_const',
|
action='store' or 'store_const',
|
||||||
choices=('on', 'off'), const='on', nargs='?')),
|
choices=('on', 'off'), const='on', nargs='?')),
|
||||||
(['--fpm7'],
|
(['--fpm73'],
|
||||||
dict(help='start/stop debugging fastcgi 7.2 configuration',
|
dict(help='start/stop debugging fastcgi 7.3 configuration',
|
||||||
action='store' or 'store_const',
|
action='store' or 'store_const',
|
||||||
choices=('on', 'off'), const='on', nargs='?')),
|
choices=('on', 'off'), const='on', nargs='?')),
|
||||||
(['--mysql'],
|
(['--mysql'],
|
||||||
@@ -80,7 +80,7 @@ class WODebugController(CementBaseController):
|
|||||||
action='store', dest='interval')),
|
action='store', dest='interval')),
|
||||||
(['site_name'],
|
(['site_name'],
|
||||||
dict(help='Website Name', nargs='?', default=None))
|
dict(help='Website Name', nargs='?', default=None))
|
||||||
]
|
]
|
||||||
usage = "wo debug [<site_name>] [options] "
|
usage = "wo debug [<site_name>] [options] "
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
@@ -100,7 +100,7 @@ class WODebugController(CementBaseController):
|
|||||||
|
|
||||||
for ip_addr in debug_address:
|
for ip_addr in debug_address:
|
||||||
if not ("debug_connection "+ip_addr in open('/etc/nginx/'
|
if not ("debug_connection "+ip_addr in open('/etc/nginx/'
|
||||||
'nginx.conf', encoding='utf-8').read()):
|
'nginx.conf', encoding='utf-8').read()):
|
||||||
Log.info(self, "Setting up Nginx debug connection"
|
Log.info(self, "Setting up Nginx debug connection"
|
||||||
" for "+ip_addr)
|
" for "+ip_addr)
|
||||||
WOShellExec.cmd_exec(self, "sed -i \"/events {{/a\\ \\ \\ "
|
WOShellExec.cmd_exec(self, "sed -i \"/events {{/a\\ \\ \\ "
|
||||||
@@ -187,26 +187,28 @@ class WODebugController(CementBaseController):
|
|||||||
# Change upstream.conf
|
# Change upstream.conf
|
||||||
nc = NginxConfig()
|
nc = NginxConfig()
|
||||||
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
||||||
nc.set([('upstream','php',), 'server'], '127.0.0.1:9001')
|
nc.set([('upstream', 'php',), 'server'], '127.0.0.1:9001')
|
||||||
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
||||||
nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:9001')
|
nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:9001')
|
||||||
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
||||||
|
|
||||||
# Enable xdebug
|
# Enable xdebug
|
||||||
WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5") +
|
WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5") +
|
||||||
"xdebug.ini",
|
"xdebug.ini",
|
||||||
";zend_extension",
|
";zend_extension",
|
||||||
"zend_extension")
|
"zend_extension")
|
||||||
|
|
||||||
# Fix slow log is not enabled default in PHP5.6
|
# Fix slow log is not enabled default in PHP5.6
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
|
||||||
config['debug']['slowlog'] = '/var/log/{0}/slow.log'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
|
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
||||||
|
config['debug']['slowlog'] = '/var/log/{0}/slow.log'.format("php/7.2" if (
|
||||||
|
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
|
||||||
config['debug']['request_slowlog_timeout'] = '10s'
|
config['debug']['request_slowlog_timeout'] = '10s'
|
||||||
with open('/etc/{0}/fpm/pool.d/debug.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
|
with open('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
|
||||||
encoding='utf-8', mode='w') as confifile:
|
encoding='utf-8', mode='w') as confifile:
|
||||||
Log.debug(self, "Writting debug.conf configuration into "
|
Log.debug(self, "Writting debug.conf configuration into "
|
||||||
"/etc/{0}/fpm/pool.d/debug.conf".format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
"/etc/{0}/fpm/pool.d/debug.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
||||||
config.write(confifile)
|
config.write(confifile)
|
||||||
|
|
||||||
self.trigger_php = True
|
self.trigger_php = True
|
||||||
@@ -214,7 +216,8 @@ class WODebugController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "PHP debug is already enabled")
|
Log.info(self, "PHP debug is already enabled")
|
||||||
|
|
||||||
self.msg = self.msg + ['/var/log/{0}/slow.log'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")]
|
self.msg = self.msg + ['/var/log/{0}/slow.log'.format("php/7.2" if (
|
||||||
|
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")]
|
||||||
|
|
||||||
# PHP global debug stop
|
# PHP global debug stop
|
||||||
elif (self.app.pargs.php == 'off' and not self.app.pargs.site_name):
|
elif (self.app.pargs.php == 'off' and not self.app.pargs.site_name):
|
||||||
@@ -226,13 +229,13 @@ class WODebugController(CementBaseController):
|
|||||||
# Change upstream.conf
|
# Change upstream.conf
|
||||||
nc = NginxConfig()
|
nc = NginxConfig()
|
||||||
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
||||||
nc.set([('upstream','php',), 'server'], '127.0.0.1:9000')
|
nc.set([('upstream', 'php',), 'server'], '127.0.0.1:9000')
|
||||||
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
||||||
nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:8000')
|
nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:8000')
|
||||||
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
||||||
|
|
||||||
# Disable xdebug
|
# Disable xdebug
|
||||||
WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5") +
|
WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5") +
|
||||||
"xdebug.ini",
|
"xdebug.ini",
|
||||||
"zend_extension",
|
"zend_extension",
|
||||||
";zend_extension")
|
";zend_extension")
|
||||||
@@ -248,38 +251,43 @@ class WODebugController(CementBaseController):
|
|||||||
# PHP5-FPM start global debug
|
# PHP5-FPM start global debug
|
||||||
if (self.app.pargs.fpm == 'on' and not self.app.pargs.site_name):
|
if (self.app.pargs.fpm == 'on' and not self.app.pargs.site_name):
|
||||||
if not WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
if not WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
||||||
"/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")):
|
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")):
|
||||||
Log.info(self, "Setting up PHP5-FPM log_level = debug")
|
Log.info(self, "Setting up PHP5-FPM log_level = debug")
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
|
||||||
|
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
||||||
config.remove_option('global', 'include')
|
config.remove_option('global', 'include')
|
||||||
config['global']['log_level'] = 'debug'
|
config['global']['log_level'] = 'debug'
|
||||||
config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
|
config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/7.2" if (
|
||||||
with open('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
|
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
|
||||||
|
with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
|
||||||
encoding='utf-8', mode='w') as configfile:
|
encoding='utf-8', mode='w') as configfile:
|
||||||
Log.debug(self, "Writting php5-FPM configuration into "
|
Log.debug(self, "Writting php5-FPM configuration into "
|
||||||
"/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
||||||
config.write(configfile)
|
config.write(configfile)
|
||||||
self.trigger_php = True
|
self.trigger_php = True
|
||||||
else:
|
else:
|
||||||
Log.info(self, "PHP5-FPM log_level = debug already setup")
|
Log.info(self, "PHP5-FPM log_level = debug already setup")
|
||||||
|
|
||||||
self.msg = self.msg + ['/var/log/{0}/fpm.log'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")]
|
self.msg = self.msg + ['/var/log/{0}/fpm.log'.format("php/7.2" if (
|
||||||
|
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")]
|
||||||
|
|
||||||
# PHP5-FPM stop global debug
|
# PHP5-FPM stop global debug
|
||||||
elif (self.app.pargs.fpm == 'off' and not self.app.pargs.site_name):
|
elif (self.app.pargs.fpm == 'off' and not self.app.pargs.site_name):
|
||||||
if WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
if WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
||||||
"/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")):
|
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")):
|
||||||
Log.info(self, "Disabling PHP5-FPM log_level = debug")
|
Log.info(self, "Disabling PHP5-FPM log_level = debug")
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
|
||||||
|
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
||||||
config.remove_option('global', 'include')
|
config.remove_option('global', 'include')
|
||||||
config['global']['log_level'] = 'notice'
|
config['global']['log_level'] = 'notice'
|
||||||
config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
|
config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/7.2" if (
|
||||||
with open('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
|
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
|
||||||
|
with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
|
||||||
encoding='utf-8', mode='w') as configfile:
|
encoding='utf-8', mode='w') as configfile:
|
||||||
Log.debug(self, "writting php5 configuration into "
|
Log.debug(self, "writting php5 configuration into "
|
||||||
"/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
||||||
config.write(configfile)
|
config.write(configfile)
|
||||||
|
|
||||||
self.trigger_php = True
|
self.trigger_php = True
|
||||||
@@ -287,43 +295,43 @@ class WODebugController(CementBaseController):
|
|||||||
Log.info(self, "PHP5-FPM log_level = debug already disabled")
|
Log.info(self, "PHP5-FPM log_level = debug already disabled")
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def debug_php72(self):
|
def debug_php73(self):
|
||||||
"""Start/Stop PHP debug"""
|
"""Start/Stop PHP debug"""
|
||||||
# PHP global debug start
|
# PHP global debug start
|
||||||
|
|
||||||
if (self.app.pargs.php72 == 'on' and not self.app.pargs.site_name):
|
if (self.app.pargs.php73 == 'on' and not self.app.pargs.site_name):
|
||||||
if (WOVariables.wo_platform_codename == 'wheezy' or WOVariables.wo_platform_codename == 'precise'):
|
if (WOVariables.wo_platform_codename == 'wheezy' or WOVariables.wo_platform_codename == 'precise'):
|
||||||
Log.error(self,"PHP 7.2 not supported.")
|
Log.error(self, "PHP 7.3 not supported.")
|
||||||
if not (WOShellExec.cmd_exec(self, "sed -n \"/upstream php7"
|
if not (WOShellExec.cmd_exec(self, "sed -n \"/upstream php73"
|
||||||
"{/,/}/p \" /etc/nginx/"
|
"{/,/}/p \" /etc/nginx/"
|
||||||
"conf.d/upstream.conf "
|
"conf.d/upstream.conf "
|
||||||
"| grep 9172")):
|
"| grep 9173")):
|
||||||
|
|
||||||
Log.info(self, "Enabling PHP 7.2 debug")
|
Log.info(self, "Enabling PHP 7.3 debug")
|
||||||
|
|
||||||
# Change upstream.conf
|
# Change upstream.conf
|
||||||
nc = NginxConfig()
|
nc = NginxConfig()
|
||||||
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
||||||
nc.set([('upstream','php72',), 'server'], '127.0.0.1:9172')
|
nc.set([('upstream', 'php73',), 'server'], '127.0.0.1:9173')
|
||||||
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
||||||
nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:9172')
|
nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:9173')
|
||||||
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
||||||
|
|
||||||
# Enable xdebug
|
# Enable xdebug
|
||||||
WOFileUtils.searchreplace(self, "/etc/php/7.2/mods-available/"
|
WOFileUtils.searchreplace(self, "/etc/php/7.3/mods-available/"
|
||||||
"xdebug.ini",
|
"xdebug.ini",
|
||||||
";zend_extension",
|
";zend_extension",
|
||||||
"zend_extension")
|
"zend_extension")
|
||||||
|
|
||||||
# Fix slow log is not enabled default in PHP5.6
|
# Fix slow log is not enabled default in PHP5.6
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('/etc/php/7.2/fpm/pool.d/debug.conf')
|
config.read('/etc/php/7.3/fpm/pool.d/debug.conf')
|
||||||
config['debug']['slowlog'] = '/var/log/php/7.2/slow.log'
|
config['debug']['slowlog'] = '/var/log/php/7.3/slow.log'
|
||||||
config['debug']['request_slowlog_timeout'] = '10s'
|
config['debug']['request_slowlog_timeout'] = '10s'
|
||||||
with open('/etc/php/7.2/fpm/pool.d/debug.conf',
|
with open('/etc/php/7.3/fpm/pool.d/debug.conf',
|
||||||
encoding='utf-8', mode='w') as confifile:
|
encoding='utf-8', mode='w') as confifile:
|
||||||
Log.debug(self, "Writting debug.conf configuration into "
|
Log.debug(self, "Writting debug.conf configuration into "
|
||||||
"/etc/php/7.2/fpm/pool.d/debug.conf")
|
"/etc/php/7.3/fpm/pool.d/debug.conf")
|
||||||
config.write(confifile)
|
config.write(confifile)
|
||||||
|
|
||||||
self.trigger_php = True
|
self.trigger_php = True
|
||||||
@@ -331,10 +339,10 @@ class WODebugController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "PHP debug is already enabled")
|
Log.info(self, "PHP debug is already enabled")
|
||||||
|
|
||||||
self.msg = self.msg + ['/var/log/php/7.2/slow.log']
|
self.msg = self.msg + ['/var/log/php/7.3/slow.log']
|
||||||
|
|
||||||
# PHP global debug stop
|
# PHP global debug stop
|
||||||
elif (self.app.pargs.php7 == 'off' and not self.app.pargs.site_name):
|
elif (self.app.pargs.php73 == 'off' and not self.app.pargs.site_name):
|
||||||
if WOShellExec.cmd_exec(self, " sed -n \"/upstream php72 {/,/}/p\" "
|
if WOShellExec.cmd_exec(self, " sed -n \"/upstream php72 {/,/}/p\" "
|
||||||
"/etc/nginx/conf.d/upstream.conf "
|
"/etc/nginx/conf.d/upstream.conf "
|
||||||
"| grep 9172"):
|
"| grep 9172"):
|
||||||
@@ -343,9 +351,9 @@ class WODebugController(CementBaseController):
|
|||||||
# Change upstream.conf
|
# Change upstream.conf
|
||||||
nc = NginxConfig()
|
nc = NginxConfig()
|
||||||
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
||||||
nc.set([('upstream','php72',), 'server'], '127.0.0.1:9072')
|
nc.set([('upstream', 'php72',), 'server'], 'unix:/var/run/php/php72-fpm.sock')
|
||||||
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
||||||
nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:8000')
|
nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:8000')
|
||||||
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
||||||
|
|
||||||
# Disable xdebug
|
# Disable xdebug
|
||||||
@@ -360,47 +368,47 @@ class WODebugController(CementBaseController):
|
|||||||
Log.info(self, "PHP 7.2 debug is already disabled")
|
Log.info(self, "PHP 7.2 debug is already disabled")
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def debug_fpm7(self):
|
def debug_fpm73(self):
|
||||||
"""Start/Stop PHP5-FPM debug"""
|
"""Start/Stop PHP5-FPM debug"""
|
||||||
# PHP5-FPM start global debug
|
# PHP5-FPM start global debug
|
||||||
if (self.app.pargs.fpm7 == 'on' and not self.app.pargs.site_name):
|
if (self.app.pargs.fpm73 == 'on' and not self.app.pargs.site_name):
|
||||||
if not WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
if not WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
||||||
"/etc/php/7.2/fpm/php-fpm.conf"):
|
"/etc/php/7.3/fpm/php-fpm.conf"):
|
||||||
Log.info(self, "Setting up PHP7.2-FPM log_level = debug")
|
Log.info(self, "Setting up PHP7.3-FPM log_level = debug")
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('/etc/php/7.2/fpm/php-fpm.conf')
|
config.read('/etc/php/7.3/fpm/php-fpm.conf')
|
||||||
config.remove_option('global', 'include')
|
config.remove_option('global', 'include')
|
||||||
config['global']['log_level'] = 'debug'
|
config['global']['log_level'] = 'debug'
|
||||||
config['global']['include'] = '/etc/php/7.2/fpm/pool.d/*.conf'
|
config['global']['include'] = '/etc/php/7.3/fpm/pool.d/*.conf'
|
||||||
with open('/etc/php/7.2/fpm/php-fpm.conf',
|
with open('/etc/php/7.3/fpm/php-fpm.conf',
|
||||||
encoding='utf-8', mode='w') as configfile:
|
encoding='utf-8', mode='w') as configfile:
|
||||||
Log.debug(self, "Writing the PHP configuration into "
|
Log.debug(self, "Writing the PHP configuration into "
|
||||||
"/etc/php/7.2/fpm/php-fpm.conf")
|
"/etc/php/7.3/fpm/php-fpm.conf")
|
||||||
config.write(configfile)
|
config.write(configfile)
|
||||||
self.trigger_php = True
|
self.trigger_php = True
|
||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.2-FPM log_level = debug already setup")
|
Log.info(self, "PHP7.3-FPM log_level = debug already setup")
|
||||||
|
|
||||||
self.msg = self.msg + ['/var/log/php/7.2/fpm.log']
|
self.msg = self.msg + ['/var/log/php/7.3/fpm.log']
|
||||||
|
|
||||||
# PHP5-FPM stop global debug
|
# PHP5-FPM stop global debug
|
||||||
elif (self.app.pargs.fpm7 == 'off' and not self.app.pargs.site_name):
|
elif (self.app.pargs.fpm73 == 'off' and not self.app.pargs.site_name):
|
||||||
if WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
if WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
||||||
"/etc/php/7.2/fpm/php-fpm.conf"):
|
"/etc/php/7.3/fpm/php-fpm.conf"):
|
||||||
Log.info(self, "Disabling PHP7.2-FPM log_level = debug")
|
Log.info(self, "Disabling PHP7.3-FPM log_level = debug")
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('/etc/php/7.2/fpm/php-fpm.conf')
|
config.read('/etc/php/7.3/fpm/php-fpm.conf')
|
||||||
config.remove_option('global', 'include')
|
config.remove_option('global', 'include')
|
||||||
config['global']['log_level'] = 'notice'
|
config['global']['log_level'] = 'notice'
|
||||||
config['global']['include'] = '/etc/php/7.2/fpm/pool.d/*.conf'
|
config['global']['include'] = '/etc/php/7.3/fpm/pool.d/*.conf'
|
||||||
with open('/etc/php/7.2/fpm/php-fpm.conf',
|
with open('/etc/php/7.3/fpm/php-fpm.conf',
|
||||||
encoding='utf-8', mode='w') as configfile:
|
encoding='utf-8', mode='w') as configfile:
|
||||||
Log.debug(self, "Writing the php7.2 configuration into "
|
Log.debug(self, "Writing the php7.3 configuration into "
|
||||||
"/etc/php/7.2/fpm/php-fpm.conf")
|
"/etc/php/7.3/fpm/php-fpm.conf")
|
||||||
config.write(configfile)
|
config.write(configfile)
|
||||||
self.trigger_php = True
|
self.trigger_php = True
|
||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.2-FPM log_level = debug already disabled")
|
Log.info(self, "PHP7.3-FPM log_level = debug already disabled")
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def debug_mysql(self):
|
def debug_mysql(self):
|
||||||
@@ -565,7 +573,7 @@ class WODebugController(CementBaseController):
|
|||||||
|
|
||||||
if ('{0}{1}/logs/error.log'.format(WOVariables.wo_webroot,
|
if ('{0}{1}/logs/error.log'.format(WOVariables.wo_webroot,
|
||||||
self.app.pargs.site_name)
|
self.app.pargs.site_name)
|
||||||
not in self.msg):
|
not in self.msg):
|
||||||
self.msg = self.msg + ['{0}{1}/logs/error.log'
|
self.msg = self.msg + ['{0}{1}/logs/error.log'
|
||||||
.format(WOVariables.wo_webroot,
|
.format(WOVariables.wo_webroot,
|
||||||
self.app.pargs.site_name)]
|
self.app.pargs.site_name)]
|
||||||
@@ -595,15 +603,15 @@ class WODebugController(CementBaseController):
|
|||||||
if self.app.pargs.php:
|
if self.app.pargs.php:
|
||||||
self.app.pargs.php = 'off'
|
self.app.pargs.php = 'off'
|
||||||
self.debug_php()
|
self.debug_php()
|
||||||
if self.app.pargs.php7:
|
if self.app.pargs.php73:
|
||||||
self.app.pargs.php7 = 'off'
|
self.app.pargs.php73 = 'off'
|
||||||
self.debug_php7()
|
self.debug_php73()
|
||||||
if self.app.pargs.fpm:
|
if self.app.pargs.fpm:
|
||||||
self.app.pargs.fpm = 'off'
|
self.app.pargs.fpm = 'off'
|
||||||
self.debug_fpm()
|
self.debug_fpm()
|
||||||
if self.app.pargs.fpm7:
|
if self.app.pargs.fpm73:
|
||||||
self.app.pargs.fpm7 = 'off'
|
self.app.pargs.fpm73 = 'off'
|
||||||
self.debug_fpm7()
|
self.debug_fpm73()
|
||||||
if self.app.pargs.mysql:
|
if self.app.pargs.mysql:
|
||||||
# MySQL debug will not work for remote MySQL
|
# MySQL debug will not work for remote MySQL
|
||||||
if WOVariables.wo_mysql_host is "localhost":
|
if WOVariables.wo_mysql_host is "localhost":
|
||||||
@@ -626,12 +634,12 @@ class WODebugController(CementBaseController):
|
|||||||
# Reload PHP
|
# Reload PHP
|
||||||
if self.trigger_php:
|
if self.trigger_php:
|
||||||
if WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic':
|
if WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic':
|
||||||
if WOAptGet.is_installed(self,'php5.6-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
WOService.reload_service(self, 'php5.6-fpm')
|
|
||||||
if WOAptGet.is_installed(self,'php7.2-fpm'):
|
|
||||||
WOService.reload_service(self, 'php7.2-fpm')
|
WOService.reload_service(self, 'php7.2-fpm')
|
||||||
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
WOService.reload_service(self, 'php7.3-fpm')
|
||||||
else:
|
else:
|
||||||
WOService.reload_service(self, 'php5-fpm')
|
WOService.reload_service(self, 'php7.2-fpm')
|
||||||
self.app.close(0)
|
self.app.close(0)
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
@@ -643,13 +651,13 @@ class WODebugController(CementBaseController):
|
|||||||
self.trigger_nginx = False
|
self.trigger_nginx = False
|
||||||
self.trigger_php = False
|
self.trigger_php = False
|
||||||
|
|
||||||
if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php7)
|
if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php73)
|
||||||
and (not self.app.pargs.fpm) and (not self.app.pargs.fpm7) and (not self.app.pargs.mysql)
|
and (not self.app.pargs.fpm) and (not self.app.pargs.fpm73) and (not self.app.pargs.mysql)
|
||||||
and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
|
and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
|
||||||
and (not self.app.pargs.all)
|
and (not self.app.pargs.all)
|
||||||
and (not self.app.pargs.site_name)
|
and (not self.app.pargs.site_name)
|
||||||
and (not self.app.pargs.import_slow_log)
|
and (not self.app.pargs.import_slow_log)
|
||||||
and (not self.app.pargs.interval)):
|
and (not self.app.pargs.interval)):
|
||||||
if self.app.pargs.stop or self.app.pargs.start:
|
if self.app.pargs.stop or self.app.pargs.start:
|
||||||
print("--start/stop option is deprecated since ee v3.0.5")
|
print("--start/stop option is deprecated since ee v3.0.5")
|
||||||
self.app.args.print_help()
|
self.app.args.print_help()
|
||||||
@@ -716,9 +724,9 @@ class WODebugController(CementBaseController):
|
|||||||
self.app.pargs.nginx = 'on'
|
self.app.pargs.nginx = 'on'
|
||||||
self.app.pargs.php = 'on'
|
self.app.pargs.php = 'on'
|
||||||
self.app.pargs.fpm = 'on'
|
self.app.pargs.fpm = 'on'
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') and WOAptGet.is_installed(self,'php7.2-fpm'):
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') and WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
self.app.pargs.php7 = 'on'
|
self.app.pargs.php73 = 'on'
|
||||||
self.app.pargs.fpm7 = 'on'
|
self.app.pargs.fpm73 = 'on'
|
||||||
self.app.pargs.mysql = 'on'
|
self.app.pargs.mysql = 'on'
|
||||||
self.app.pargs.rewrite = 'on'
|
self.app.pargs.rewrite = 'on'
|
||||||
|
|
||||||
@@ -728,16 +736,16 @@ class WODebugController(CementBaseController):
|
|||||||
self.app.pargs.nginx = 'off'
|
self.app.pargs.nginx = 'off'
|
||||||
self.app.pargs.php = 'off'
|
self.app.pargs.php = 'off'
|
||||||
self.app.pargs.fpm = 'off'
|
self.app.pargs.fpm = 'off'
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') and WOAptGet.is_installed(self,'php7.2-fpm'):
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') and WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
self.app.pargs.php7 = 'off'
|
self.app.pargs.php73 = 'off'
|
||||||
self.app.pargs.fpm7 = 'off'
|
self.app.pargs.fpm73 = 'off'
|
||||||
self.app.pargs.mysql = 'off'
|
self.app.pargs.mysql = 'off'
|
||||||
self.app.pargs.rewrite = 'off'
|
self.app.pargs.rewrite = 'off'
|
||||||
|
|
||||||
if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php7)
|
if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php73)
|
||||||
and (not self.app.pargs.fpm) and (not self.app.pargs.fpm7) and (not self.app.pargs.mysql)
|
and (not self.app.pargs.fpm) and (not self.app.pargs.fpm73) and (not self.app.pargs.mysql)
|
||||||
and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
|
and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
|
||||||
and self.app.pargs.site_name):
|
and self.app.pargs.site_name):
|
||||||
self.app.args.print_help()
|
self.app.args.print_help()
|
||||||
# self.app.pargs.nginx = 'on'
|
# self.app.pargs.nginx = 'on'
|
||||||
# self.app.pargs.wp = 'on'
|
# self.app.pargs.wp = 'on'
|
||||||
@@ -749,10 +757,10 @@ class WODebugController(CementBaseController):
|
|||||||
self.debug_php()
|
self.debug_php()
|
||||||
if self.app.pargs.fpm:
|
if self.app.pargs.fpm:
|
||||||
self.debug_fpm()
|
self.debug_fpm()
|
||||||
if self.app.pargs.php7:
|
if self.app.pargs.php73:
|
||||||
self.debug_php7()
|
self.debug_php73()
|
||||||
if self.app.pargs.fpm7:
|
if self.app.pargs.fpm73:
|
||||||
self.debug_fpm7()
|
self.debug_fpm73()
|
||||||
if self.app.pargs.mysql:
|
if self.app.pargs.mysql:
|
||||||
# MySQL debug will not work for remote MySQL
|
# MySQL debug will not work for remote MySQL
|
||||||
if WOVariables.wo_mysql_host is "localhost":
|
if WOVariables.wo_mysql_host is "localhost":
|
||||||
@@ -774,12 +782,12 @@ class WODebugController(CementBaseController):
|
|||||||
# Reload PHP
|
# Reload PHP
|
||||||
if self.trigger_php:
|
if self.trigger_php:
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||||
if WOAptGet.is_installed(self,'php5.6-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
WOService.restart_service(self, 'php5.6-fpm')
|
|
||||||
if WOAptGet.is_installed(self,'php7.2-fpm'):
|
|
||||||
WOService.restart_service(self, 'php7.2-fpm')
|
WOService.restart_service(self, 'php7.2-fpm')
|
||||||
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
WOService.restart_service(self, 'php7.3-fpm')
|
||||||
else:
|
else:
|
||||||
WOService.restart_service(self, 'php5-fpm')
|
WOService.restart_service(self, 'php7.2-fpm')
|
||||||
if WOVariables.wo_platform_codename == 'jessie':
|
if WOVariables.wo_platform_codename == 'jessie':
|
||||||
WOService.restart_service(self, 'php7.2-fpm')
|
WOService.restart_service(self, 'php7.2-fpm')
|
||||||
|
|
||||||
|
|||||||
@@ -27,15 +27,15 @@ class WOInfoController(CementBaseController):
|
|||||||
dict(help='Get MySQL configuration information',
|
dict(help='Get MySQL configuration information',
|
||||||
action='store_true')),
|
action='store_true')),
|
||||||
(['--php'],
|
(['--php'],
|
||||||
dict(help='Get PHP configuration information',
|
|
||||||
action='store_true')),
|
|
||||||
(['--php72'],
|
|
||||||
dict(help='Get PHP 7.2 configuration information',
|
dict(help='Get PHP 7.2 configuration information',
|
||||||
action='store_true')),
|
action='store_true')),
|
||||||
|
(['--php73'],
|
||||||
|
dict(help='Get PHP 7.3 configuration information',
|
||||||
|
action='store_true')),
|
||||||
(['--nginx'],
|
(['--nginx'],
|
||||||
dict(help='Get Nginx configuration information',
|
dict(help='Get Nginx configuration information',
|
||||||
action='store_true')),
|
action='store_true')),
|
||||||
]
|
]
|
||||||
usage = "wo info [options]"
|
usage = "wo info [options]"
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
@@ -66,17 +66,17 @@ class WOInfoController(CementBaseController):
|
|||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def info_php(self):
|
def info_php(self):
|
||||||
"""Display PHP information"""
|
"""Display PHP information"""
|
||||||
version = os.popen("{0} -v 2>/dev/null | head -n1 | cut -d' ' -f2 |".format("php5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php") +
|
version = os.popen("php7.2 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |"
|
||||||
" cut -d'+' -f1 | tr -d '\n'").read
|
" cut -d'+' -f1 | tr -d '\n'").read
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('/etc/{0}/fpm/php.ini'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
config.read('/etc/{0}/fpm/php.ini'.format("php/7.2"))
|
||||||
expose_php = config['PHP']['expose_php']
|
expose_php = config['PHP']['expose_php']
|
||||||
memory_limit = config['PHP']['memory_limit']
|
memory_limit = config['PHP']['memory_limit']
|
||||||
post_max_size = config['PHP']['post_max_size']
|
post_max_size = config['PHP']['post_max_size']
|
||||||
upload_max_filesize = config['PHP']['upload_max_filesize']
|
upload_max_filesize = config['PHP']['upload_max_filesize']
|
||||||
max_execution_time = config['PHP']['max_execution_time']
|
max_execution_time = config['PHP']['max_execution_time']
|
||||||
|
|
||||||
config.read('/etc/{0}/fpm/pool.d/www.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
config.read('/etc/{0}/fpm/pool.d/www.conf'.format("php/7.2"))
|
||||||
www_listen = config['www']['listen']
|
www_listen = config['www']['listen']
|
||||||
www_ping_path = config['www']['ping.path']
|
www_ping_path = config['www']['ping.path']
|
||||||
www_pm_status_path = config['www']['pm.status_path']
|
www_pm_status_path = config['www']['pm.status_path']
|
||||||
@@ -94,7 +94,7 @@ class WOInfoController(CementBaseController):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
www_xdebug = 'off'
|
www_xdebug = 'off'
|
||||||
|
|
||||||
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/5.6" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2"))
|
||||||
debug_listen = config['debug']['listen']
|
debug_listen = config['debug']['listen']
|
||||||
debug_ping_path = config['debug']['ping.path']
|
debug_ping_path = config['debug']['ping.path']
|
||||||
debug_pm_status_path = config['debug']['pm.status_path']
|
debug_pm_status_path = config['debug']['pm.status_path']
|
||||||
@@ -138,19 +138,19 @@ class WOInfoController(CementBaseController):
|
|||||||
self.app.render((data), 'info_php.mustache')
|
self.app.render((data), 'info_php.mustache')
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def info_php72(self):
|
def info_php73(self):
|
||||||
"""Display PHP information"""
|
"""Display PHP information"""
|
||||||
version = os.popen("php7.2 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |"
|
version = os.popen("php7.3 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |"
|
||||||
" cut -d'+' -f1 | tr -d '\n'").read
|
" cut -d'+' -f1 | tr -d '\n'").read
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('/etc/php/7.2/fpm/php.ini')
|
config.read('/etc/php/7.3/fpm/php.ini')
|
||||||
expose_php = config['PHP']['expose_php']
|
expose_php = config['PHP']['expose_php']
|
||||||
memory_limit = config['PHP']['memory_limit']
|
memory_limit = config['PHP']['memory_limit']
|
||||||
post_max_size = config['PHP']['post_max_size']
|
post_max_size = config['PHP']['post_max_size']
|
||||||
upload_max_filesize = config['PHP']['upload_max_filesize']
|
upload_max_filesize = config['PHP']['upload_max_filesize']
|
||||||
max_execution_time = config['PHP']['max_execution_time']
|
max_execution_time = config['PHP']['max_execution_time']
|
||||||
|
|
||||||
config.read('/etc/php/7.2/fpm/pool.d/www.conf')
|
config.read('/etc/php/7.3/fpm/pool.d/www.conf')
|
||||||
www_listen = config['www']['listen']
|
www_listen = config['www']['listen']
|
||||||
www_ping_path = config['www']['ping.path']
|
www_ping_path = config['www']['ping.path']
|
||||||
www_pm_status_path = config['www']['pm.status_path']
|
www_pm_status_path = config['www']['pm.status_path']
|
||||||
@@ -168,7 +168,7 @@ class WOInfoController(CementBaseController):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
www_xdebug = 'off'
|
www_xdebug = 'off'
|
||||||
|
|
||||||
config.read('/etc/php/7.2/fpm/pool.d/debug.conf')
|
config.read('/etc/php/7.3/fpm/pool.d/debug.conf')
|
||||||
debug_listen = config['debug']['listen']
|
debug_listen = config['debug']['listen']
|
||||||
debug_ping_path = config['debug']['ping.path']
|
debug_ping_path = config['debug']['ping.path']
|
||||||
debug_pm_status_path = config['debug']['pm.status_path']
|
debug_pm_status_path = config['debug']['pm.status_path']
|
||||||
@@ -243,12 +243,12 @@ class WOInfoController(CementBaseController):
|
|||||||
def default(self):
|
def default(self):
|
||||||
"""default function for info"""
|
"""default function for info"""
|
||||||
if (not self.app.pargs.nginx and not self.app.pargs.php
|
if (not self.app.pargs.nginx and not self.app.pargs.php
|
||||||
and not self.app.pargs.mysql and not self.app.pargs.php72):
|
and not self.app.pargs.mysql and not self.app.pargs.php73):
|
||||||
self.app.pargs.nginx = True
|
self.app.pargs.nginx = True
|
||||||
self.app.pargs.php = True
|
self.app.pargs.php = True
|
||||||
self.app.pargs.mysql = True
|
self.app.pargs.mysql = True
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
self.app.pargs.php = True
|
self.app.pargs.php73 = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if self.app.pargs.nginx:
|
||||||
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-common'):
|
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-common'):
|
||||||
@@ -257,23 +257,17 @@ class WOInfoController(CementBaseController):
|
|||||||
Log.error(self, "Nginx is not installed")
|
Log.error(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if self.app.pargs.php:
|
||||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
|
||||||
if WOAptGet.is_installed(self, 'php5-fpm'):
|
|
||||||
self.info_php()
|
|
||||||
else:
|
|
||||||
Log.error(self, "PHP5 is not installed")
|
|
||||||
else:
|
|
||||||
if WOAptGet.is_installed(self, 'php5.6-fpm'):
|
|
||||||
self.info_php()
|
|
||||||
else:
|
|
||||||
Log.error(self, "PHP5.6 is not installed")
|
|
||||||
|
|
||||||
if self.app.pargs.php72:
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
self.info_php72()
|
self.info_php()
|
||||||
else:
|
else:
|
||||||
Log.error(self, "PHP 7.2 is not installed")
|
Log.error(self, "PHP 7.2 is not installed")
|
||||||
|
|
||||||
|
if self.app.pargs.php73:
|
||||||
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
self.info_php73()
|
||||||
|
else:
|
||||||
|
Log.error(self, "PHP 7.3 is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if self.app.pargs.mysql:
|
||||||
if WOShellExec.cmd_exec(self, "mysqladmin ping"):
|
if WOShellExec.cmd_exec(self, "mysqladmin ping"):
|
||||||
self.info_mysql()
|
self.info_mysql()
|
||||||
|
|||||||
@@ -444,9 +444,9 @@ class WOLogMailController(CementBaseController):
|
|||||||
(['--nginx'],
|
(['--nginx'],
|
||||||
dict(help='Mail Nginx Error logs file', action='store_true')),
|
dict(help='Mail Nginx Error logs file', action='store_true')),
|
||||||
(['--php'],
|
(['--php'],
|
||||||
dict(help='Mail PHP Error logs file', action='store_true')),
|
dict(help='Mail PHP 7.2 Error logs file', action='store_true')),
|
||||||
(['--fpm'],
|
(['--fpm'],
|
||||||
dict(help='Mail PHP5-fpm slow logs file',
|
dict(help='Mail PHP 7.2-fpm slow logs file',
|
||||||
action='store_true')),
|
action='store_true')),
|
||||||
(['--mysql'],
|
(['--mysql'],
|
||||||
dict(help='Mail MySQL logs file', action='store_true')),
|
dict(help='Mail MySQL logs file', action='store_true')),
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class WOSiteController(CementBaseController):
|
|||||||
arguments = [
|
arguments = [
|
||||||
(['site_name'],
|
(['site_name'],
|
||||||
dict(help='Website name', nargs='?')),
|
dict(help='Website name', nargs='?')),
|
||||||
]
|
]
|
||||||
usage = "wo site (command) <site_name> [options]"
|
usage = "wo site (command) <site_name> [options]"
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
@@ -160,15 +160,15 @@ class WOSiteController(CementBaseController):
|
|||||||
ssl = ("enabled" if siteinfo.is_ssl else "disabled")
|
ssl = ("enabled" if siteinfo.is_ssl else "disabled")
|
||||||
if (ssl == "enabled"):
|
if (ssl == "enabled"):
|
||||||
sslprovider = "Lets Encrypt"
|
sslprovider = "Lets Encrypt"
|
||||||
sslexpiry = str(SSL.getExpirationDate(self,wo_domain))
|
sslexpiry = str(SSL.getExpirationDate(self, wo_domain))
|
||||||
else:
|
else:
|
||||||
sslprovider = ''
|
sslprovider = ''
|
||||||
sslexpiry = ''
|
sslexpiry = ''
|
||||||
data = dict(domain=wo_domain, webroot=wo_site_webroot,
|
data = dict(domain=wo_domain, webroot=wo_site_webroot,
|
||||||
accesslog=access_log, errorlog=error_log,
|
accesslog=access_log, errorlog=error_log,
|
||||||
dbname=wo_db_name, dbuser=wo_db_user,php_version=php_version,
|
dbname=wo_db_name, dbuser=wo_db_user, php_version=php_version,
|
||||||
dbpass=wo_db_pass, hhvm=hhvm,
|
dbpass=wo_db_pass, hhvm=hhvm,
|
||||||
ssl=ssl, sslprovider=sslprovider, sslexpiry= sslexpiry,
|
ssl=ssl, sslprovider=sslprovider, sslexpiry=sslexpiry,
|
||||||
type=sitetype + " " + cachetype + " ({0})"
|
type=sitetype + " " + cachetype + " ({0})"
|
||||||
.format("enabled" if siteinfo.is_enabled else
|
.format("enabled" if siteinfo.is_enabled else
|
||||||
"disabled"))
|
"disabled"))
|
||||||
@@ -254,7 +254,7 @@ class WOSiteEditController(CementBaseController):
|
|||||||
(['site_name'],
|
(['site_name'],
|
||||||
dict(help='domain name for the site',
|
dict(help='domain name for the site',
|
||||||
nargs='?')),
|
nargs='?')),
|
||||||
]
|
]
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def default(self):
|
def default(self):
|
||||||
@@ -282,7 +282,7 @@ class WOSiteEditController(CementBaseController):
|
|||||||
except CommandExecutionError as e:
|
except CommandExecutionError as e:
|
||||||
Log.error(self, "Failed invoke editor")
|
Log.error(self, "Failed invoke editor")
|
||||||
if (WOGit.checkfilestatus(self, "/etc/nginx",
|
if (WOGit.checkfilestatus(self, "/etc/nginx",
|
||||||
'/etc/nginx/sites-available/{0}'.format(wo_domain))):
|
'/etc/nginx/sites-available/{0}'.format(wo_domain))):
|
||||||
WOGit.add(self, ["/etc/nginx"], msg="Edit website: {0}"
|
WOGit.add(self, ["/etc/nginx"], msg="Edit website: {0}"
|
||||||
.format(wo_domain))
|
.format(wo_domain))
|
||||||
# Reload NGINX
|
# Reload NGINX
|
||||||
@@ -308,9 +308,9 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
(['--html'],
|
(['--html'],
|
||||||
dict(help="create html site", action='store_true')),
|
dict(help="create html site", action='store_true')),
|
||||||
(['--php'],
|
(['--php'],
|
||||||
dict(help="create php site", action='store_true')),
|
|
||||||
(['--php72'],
|
|
||||||
dict(help="create php 7.2 site", action='store_true')),
|
dict(help="create php 7.2 site", action='store_true')),
|
||||||
|
(['--php73'],
|
||||||
|
dict(help="create php 7.3 site", action='store_true')),
|
||||||
(['--mysql'],
|
(['--mysql'],
|
||||||
dict(help="create mysql site", action='store_true')),
|
dict(help="create mysql site", action='store_true')),
|
||||||
(['--wp'],
|
(['--wp'],
|
||||||
@@ -333,7 +333,7 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
action='store_true')),
|
action='store_true')),
|
||||||
(['--hhvm'],
|
(['--hhvm'],
|
||||||
dict(help="create HHVM site", action='store_true')),
|
dict(help="create HHVM site", action='store_true')),
|
||||||
(['-le','--letsencrypt'],
|
(['-le', '--letsencrypt'],
|
||||||
dict(help="configure letsencrypt ssl for the site", action='store_true')),
|
dict(help="configure letsencrypt ssl for the site", action='store_true')),
|
||||||
(['--user'],
|
(['--user'],
|
||||||
dict(help="provide user for wordpress site")),
|
dict(help="provide user for wordpress site")),
|
||||||
@@ -347,7 +347,7 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
(['--experimental'],
|
(['--experimental'],
|
||||||
dict(help="Enable Experimenal packages without prompt",
|
dict(help="Enable Experimenal packages without prompt",
|
||||||
action='store_true')),
|
action='store_true')),
|
||||||
]
|
]
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def default(self):
|
def default(self):
|
||||||
@@ -410,16 +410,16 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
data['port'] = port
|
data['port'] = port
|
||||||
wo_site_webroot = ""
|
wo_site_webroot = ""
|
||||||
|
|
||||||
if self.app.pargs.php72:
|
if self.app.pargs.php73:
|
||||||
data = dict(site_name=wo_domain, www_domain=wo_www_domain,
|
data = dict(site_name=wo_domain, www_domain=wo_www_domain,
|
||||||
static=False, basic=False, php72=True, wp=False,
|
static=False, basic=False, php73=True, wp=False,
|
||||||
wpfc=False, wpsc=False, multisite=False,
|
wpfc=False, wpsc=False, multisite=False,
|
||||||
wpsubdir=False, webroot=wo_site_webroot)
|
wpsubdir=False, webroot=wo_site_webroot)
|
||||||
data['basic'] = True
|
data['basic'] = True
|
||||||
|
|
||||||
if stype in ['html', 'php' ]:
|
if stype in ['html', 'php']:
|
||||||
data = dict(site_name=wo_domain, www_domain=wo_www_domain,
|
data = dict(site_name=wo_domain, www_domain=wo_www_domain,
|
||||||
static=True, basic=False, php72=False, wp=False,
|
static=True, basic=False, php73=False, wp=False,
|
||||||
wpfc=False, wpsc=False, multisite=False,
|
wpfc=False, wpsc=False, multisite=False,
|
||||||
wpsubdir=False, webroot=wo_site_webroot)
|
wpsubdir=False, webroot=wo_site_webroot)
|
||||||
|
|
||||||
@@ -453,27 +453,28 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
if stype == "html" and self.app.pargs.hhvm:
|
if stype == "html" and self.app.pargs.hhvm:
|
||||||
Log.error(self, "Can not create HTML site with HHVM")
|
Log.error(self, "Can not create HTML site with HHVM")
|
||||||
|
|
||||||
if data and self.app.pargs.php72:
|
if data and self.app.pargs.php73:
|
||||||
if (not self.app.pargs.experimental):
|
if (self.app.pargs.experimental):
|
||||||
Log.info(self, "Do you wish to install PHP 7.2 now for {0}?".format(wo_domain))
|
Log.info(
|
||||||
|
self, "Do you wish to install PHP 7.3 now for {0}?".format(wo_domain))
|
||||||
|
|
||||||
# Check prompt
|
# Check prompt
|
||||||
check_prompt = input("Type \"y\" to continue [n]:")
|
check_prompt = input("Type \"y\" to continue [n]:")
|
||||||
if check_prompt != "Y" and check_prompt != "y":
|
if check_prompt != "Y" and check_prompt != "y":
|
||||||
Log.info(self, "Not using PHP 7.2 for site.")
|
Log.info(self, "Not using PHP 7.2 for site.")
|
||||||
data['php72'] = False
|
data['php73'] = True
|
||||||
data['basic'] = True
|
data['basic'] = True
|
||||||
php72 = 0
|
php73 = 1
|
||||||
self.app.pargs.php72 = False
|
self.app.pargs.php73 = True
|
||||||
else:
|
else:
|
||||||
data['php72'] = True
|
data['php73'] = True
|
||||||
php72 = 1
|
php73 = 1
|
||||||
else:
|
else:
|
||||||
data['php72'] = True
|
data['php73'] = True
|
||||||
php72 = 1
|
php73 = 1
|
||||||
elif data:
|
elif data:
|
||||||
data['php72'] = False
|
data['php73'] = False
|
||||||
php72 = 0
|
php73 = 0
|
||||||
|
|
||||||
if (not self.app.pargs.wpfc) and (not self.app.pargs.wpsc) and (not self.app.pargs.wpredis) and (not self.app.pargs.hhvm):
|
if (not self.app.pargs.wpfc) and (not self.app.pargs.wpsc) and (not self.app.pargs.wpredis) and (not self.app.pargs.hhvm):
|
||||||
data['basic'] = True
|
data['basic'] = True
|
||||||
@@ -503,13 +504,13 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
data['hhvm'] = False
|
data['hhvm'] = False
|
||||||
hhvm = 0
|
hhvm = 0
|
||||||
|
|
||||||
if (cache == 'wpredis' and (not self.app.pargs.experimental)):
|
if (cache == 'wpredis' and (self.app.pargs.experimental)):
|
||||||
Log.info(self, "Redis is experimental feature and it may not "
|
Log.info(self, "Redis is experimental feature and it may not "
|
||||||
"work with all CSS/JS/Cache of your site.\nYou can "
|
"work with all CSS/JS/Cache of your site.\nYou can "
|
||||||
"disable it by changing cache later.\nDo you wish"
|
"disable it by changing cache later.\nDo you wish"
|
||||||
" to enable Redis now for {0}?".format(wo_domain))
|
" to enable Redis now for {0}?".format(wo_domain))
|
||||||
|
|
||||||
# Check prompt
|
# Check prompt
|
||||||
check_prompt = input("Type \"y\" to continue [n]:")
|
check_prompt = input("Type \"y\" to continue [n]:")
|
||||||
if check_prompt != "Y" and check_prompt != "y":
|
if check_prompt != "Y" and check_prompt != "y":
|
||||||
Log.error(self, "Not using Redis for site")
|
Log.error(self, "Not using Redis for site")
|
||||||
@@ -536,7 +537,8 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
hashbucket(self)
|
hashbucket(self)
|
||||||
except SiteError as e:
|
except SiteError as e:
|
||||||
# call cleanup actions on failure
|
# call cleanup actions on failure
|
||||||
Log.info(self, Log.FAIL + "There was a serious error encountered...")
|
Log.info(self, Log.FAIL +
|
||||||
|
"There was a serious error encountered...")
|
||||||
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
||||||
doCleanupAction(self, domain=wo_domain,
|
doCleanupAction(self, domain=wo_domain,
|
||||||
webroot=data['webroot'])
|
webroot=data['webroot'])
|
||||||
@@ -548,7 +550,8 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
addNewSite(self, wo_domain, stype, cache, wo_site_webroot)
|
addNewSite(self, wo_domain, stype, cache, wo_site_webroot)
|
||||||
# Service Nginx Reload
|
# Service Nginx Reload
|
||||||
if not WOService.reload_service(self, 'nginx'):
|
if not WOService.reload_service(self, 'nginx'):
|
||||||
Log.info(self, Log.FAIL + "There was a serious error encountered...")
|
Log.info(self, Log.FAIL +
|
||||||
|
"There was a serious error encountered...")
|
||||||
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
||||||
doCleanupAction(self, domain=wo_domain)
|
doCleanupAction(self, domain=wo_domain)
|
||||||
deleteSiteInfo(self, wo_domain)
|
deleteSiteInfo(self, wo_domain)
|
||||||
@@ -563,12 +566,11 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
" http://{0}".format(wo_domain))
|
" http://{0}".format(wo_domain))
|
||||||
return
|
return
|
||||||
|
|
||||||
if data['php72']:
|
if data['php73']:
|
||||||
php_version = "7.2"
|
php_version = "7.3"
|
||||||
else:
|
else:
|
||||||
php_version = "7.2"
|
php_version = "7.2"
|
||||||
|
|
||||||
|
|
||||||
addNewSite(self, wo_domain, stype, cache, wo_site_webroot,
|
addNewSite(self, wo_domain, stype, cache, wo_site_webroot,
|
||||||
hhvm=hhvm, php_version=php_version)
|
hhvm=hhvm, php_version=php_version)
|
||||||
|
|
||||||
@@ -584,7 +586,8 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
except SiteError as e:
|
except SiteError as e:
|
||||||
# call cleanup actions on failure
|
# call cleanup actions on failure
|
||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
Log.info(self, Log.FAIL + "There was a serious error encountered...")
|
Log.info(self, Log.FAIL +
|
||||||
|
"There was a serious error encountered...")
|
||||||
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
||||||
doCleanupAction(self, domain=wo_domain,
|
doCleanupAction(self, domain=wo_domain,
|
||||||
webroot=data['webroot'],
|
webroot=data['webroot'],
|
||||||
@@ -613,7 +616,8 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
Log.debug(self, "Error occured while generating "
|
Log.debug(self, "Error occured while generating "
|
||||||
"wo-config.php")
|
"wo-config.php")
|
||||||
Log.info(self, Log.FAIL + "There was a serious error encountered...")
|
Log.info(self, Log.FAIL +
|
||||||
|
"There was a serious error encountered...")
|
||||||
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
||||||
doCleanupAction(self, domain=wo_domain,
|
doCleanupAction(self, domain=wo_domain,
|
||||||
webroot=data['webroot'],
|
webroot=data['webroot'],
|
||||||
@@ -636,7 +640,8 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
except SiteError as e:
|
except SiteError as e:
|
||||||
# call cleanup actions on failure
|
# call cleanup actions on failure
|
||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
Log.info(self, Log.FAIL + "There was a serious error encountered...")
|
Log.info(self, Log.FAIL +
|
||||||
|
"There was a serious error encountered...")
|
||||||
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
||||||
doCleanupAction(self, domain=wo_domain,
|
doCleanupAction(self, domain=wo_domain,
|
||||||
webroot=data['webroot'],
|
webroot=data['webroot'],
|
||||||
@@ -649,7 +654,8 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
|
|
||||||
# Service Nginx Reload call cleanup if failed to reload nginx
|
# Service Nginx Reload call cleanup if failed to reload nginx
|
||||||
if not WOService.reload_service(self, 'nginx'):
|
if not WOService.reload_service(self, 'nginx'):
|
||||||
Log.info(self, Log.FAIL + "There was a serious error encountered...")
|
Log.info(self, Log.FAIL +
|
||||||
|
"There was a serious error encountered...")
|
||||||
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
||||||
doCleanupAction(self, domain=wo_domain,
|
doCleanupAction(self, domain=wo_domain,
|
||||||
webroot=data['webroot'])
|
webroot=data['webroot'])
|
||||||
@@ -672,7 +678,8 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
setwebrootpermissions(self, data['webroot'])
|
setwebrootpermissions(self, data['webroot'])
|
||||||
except SiteError as e:
|
except SiteError as e:
|
||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
Log.info(self, Log.FAIL + "There was a serious error encountered...")
|
Log.info(self, Log.FAIL +
|
||||||
|
"There was a serious error encountered...")
|
||||||
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
Log.info(self, Log.FAIL + "Cleaning up afterwards...")
|
||||||
doCleanupAction(self, domain=wo_domain,
|
doCleanupAction(self, domain=wo_domain,
|
||||||
webroot=data['webroot'])
|
webroot=data['webroot'])
|
||||||
@@ -704,14 +711,15 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
Log.error(self, "Check the log for details: "
|
Log.error(self, "Check the log for details: "
|
||||||
"`tail /var/log/wo/wordops.log` and please try again")
|
"`tail /var/log/wo/wordops.log` and please try again")
|
||||||
|
|
||||||
if self.app.pargs.letsencrypt :
|
if self.app.pargs.letsencrypt:
|
||||||
if (not self.app.pargs.experimental):
|
if (self.app.pargs.experimental):
|
||||||
if stype in ['wpsubdomain']:
|
if stype in ['wpsubdomain']:
|
||||||
Log.warn(self, "Wildcard domains are not supported in Lets Encrypt.\nWP SUBDOMAIN site will get SSL for primary site only.")
|
Log.warn(
|
||||||
|
self, "Wildcard domains are not supported in Lets Encrypt.\nWP SUBDOMAIN site will get SSL for primary site only.")
|
||||||
|
|
||||||
Log.info(self, "Letsencrypt is currently in beta phase."
|
Log.info(self, "Letsencrypt is currently in beta phase."
|
||||||
" \nDo you wish"
|
" \nDo you wish"
|
||||||
" to enable SSl now for {0}?".format(wo_domain))
|
" to enable SSl now for {0}?".format(wo_domain))
|
||||||
|
|
||||||
# Check prompt
|
# Check prompt
|
||||||
check_prompt = input("Type \"y\" to continue [n]:")
|
check_prompt = input("Type \"y\" to continue [n]:")
|
||||||
@@ -722,41 +730,41 @@ class WOSiteCreateController(CementBaseController):
|
|||||||
data['letsencrypt'] = True
|
data['letsencrypt'] = True
|
||||||
letsencrypt = True
|
letsencrypt = True
|
||||||
else:
|
else:
|
||||||
data['letsencrypt'] = True
|
data['letsencrypt'] = True
|
||||||
letsencrypt = True
|
letsencrypt = True
|
||||||
|
|
||||||
if data['letsencrypt'] is True:
|
if data['letsencrypt'] is True:
|
||||||
setupLetsEncrypt(self, wo_domain)
|
setupLetsEncrypt(self, wo_domain)
|
||||||
httpsRedirect(self,wo_domain)
|
httpsRedirect(self, wo_domain)
|
||||||
Log.info(self,"Creating Cron Job for cert auto-renewal")
|
Log.info(self, "Creating Cron Job for cert auto-renewal")
|
||||||
WOCron.setcron_weekly(self,'wo site update --le=renew --all 2> /dev/null'.format(wo_domain),'Renew all'
|
WOCron.setcron_weekly(self, 'wo site update --le=renew --all 2> /dev/null'.format(wo_domain), 'Renew all'
|
||||||
' letsencrypt SSL cert. Set by WordOps')
|
' letsencrypt SSL cert. Set by WordOps')
|
||||||
|
|
||||||
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")
|
||||||
|
|
||||||
Log.info(self, "Congratulations! Successfully Configured SSl for Site "
|
Log.info(self, "Congratulations! Successfully Configured SSl for Site "
|
||||||
" https://{0}".format(wo_domain))
|
" https://{0}".format(wo_domain))
|
||||||
|
|
||||||
if (SSL.getExpirationDays(self,wo_domain)>0):
|
if (SSL.getExpirationDays(self, wo_domain) > 0):
|
||||||
Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,wo_domain)) + " days.")
|
Log.info(self, "Your cert will expire within " +
|
||||||
else:
|
str(SSL.getExpirationDays(self, wo_domain)) + " days.")
|
||||||
Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ")
|
else:
|
||||||
|
Log.warn(
|
||||||
|
self, "Your cert already EXPIRED ! .PLEASE renew soon . ")
|
||||||
|
|
||||||
# Add nginx conf folder into GIT
|
# Add nginx conf folder into GIT
|
||||||
WOGit.add(self, ["{0}/conf/nginx".format(wo_site_webroot)],
|
WOGit.add(self, ["{0}/conf/nginx".format(wo_site_webroot)],
|
||||||
msg="Adding letsencrypts config of site: {0}"
|
msg="Adding letsencrypts config of site: {0}"
|
||||||
.format(wo_domain))
|
.format(wo_domain))
|
||||||
updateSiteInfo(self, wo_domain, ssl=letsencrypt)
|
updateSiteInfo(self, wo_domain, ssl=letsencrypt)
|
||||||
|
|
||||||
elif data['letsencrypt'] is False:
|
elif data['letsencrypt'] is False:
|
||||||
Log.info(self, "Not using Let\'s encrypt for Site "
|
Log.info(self, "Not using Let\'s encrypt for Site "
|
||||||
" http://{0}".format(wo_domain))
|
" http://{0}".format(wo_domain))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class WOSiteUpdateController(CementBaseController):
|
class WOSiteUpdateController(CementBaseController):
|
||||||
class Meta:
|
class Meta:
|
||||||
label = 'update'
|
label = 'update'
|
||||||
@@ -775,8 +783,8 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
dict(help="update to html site", action='store_true')),
|
dict(help="update to html site", action='store_true')),
|
||||||
(['--php'],
|
(['--php'],
|
||||||
dict(help="update to php site", action='store_true')),
|
dict(help="update to php site", action='store_true')),
|
||||||
(['--php72'],
|
(['--php73'],
|
||||||
dict(help="update to php7 site",
|
dict(help="update to php73 site",
|
||||||
action='store' or 'store_const',
|
action='store' or 'store_const',
|
||||||
choices=('on', 'off'), const='on', nargs='?')),
|
choices=('on', 'off'), const='on', nargs='?')),
|
||||||
(['--mysql'],
|
(['--mysql'],
|
||||||
@@ -798,7 +806,7 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
dict(help='Use HHVM for site',
|
dict(help='Use HHVM for site',
|
||||||
action='store' or 'store_const',
|
action='store' or 'store_const',
|
||||||
choices=('on', 'off'), const='on', nargs='?')),
|
choices=('on', 'off'), const='on', nargs='?')),
|
||||||
(['-le','--letsencrypt'],
|
(['-le', '--letsencrypt'],
|
||||||
dict(help="configure letsencrypt ssl for the site",
|
dict(help="configure letsencrypt ssl for the site",
|
||||||
action='store' or 'store_const',
|
action='store' or 'store_const',
|
||||||
choices=('on', 'off', 'renew'), const='on', nargs='?')),
|
choices=('on', 'off', 'renew'), const='on', nargs='?')),
|
||||||
@@ -809,7 +817,7 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
action='store_true')),
|
action='store_true')),
|
||||||
(['--all'],
|
(['--all'],
|
||||||
dict(help="update all sites", action='store_true')),
|
dict(help="update all sites", action='store_true')),
|
||||||
]
|
]
|
||||||
|
|
||||||
@expose(help="Update site type or cache")
|
@expose(help="Update site type or cache")
|
||||||
def default(self):
|
def default(self):
|
||||||
@@ -822,7 +830,7 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
if pargs.html:
|
if pargs.html:
|
||||||
Log.error(self, "No site can be updated to html")
|
Log.error(self, "No site can be updated to html")
|
||||||
|
|
||||||
if not (pargs.php or pargs.php72 or
|
if not (pargs.php or pargs.php73 or
|
||||||
pargs.mysql or pargs.wp or pargs.wpsubdir or
|
pargs.mysql or pargs.wp or pargs.wpsubdir or
|
||||||
pargs.wpsubdomain or pargs.wpfc or pargs.wpsc or
|
pargs.wpsubdomain or pargs.wpfc or pargs.wpsc or
|
||||||
pargs.hhvm or pargs.wpredis or pargs.letsencrypt):
|
pargs.hhvm or pargs.wpredis or pargs.letsencrypt):
|
||||||
@@ -850,8 +858,7 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
def doupdatesite(self, pargs):
|
def doupdatesite(self, pargs):
|
||||||
hhvm = None
|
hhvm = None
|
||||||
letsencrypt = False
|
letsencrypt = False
|
||||||
php72 = None
|
php73 = None
|
||||||
|
|
||||||
|
|
||||||
data = dict()
|
data = dict()
|
||||||
try:
|
try:
|
||||||
@@ -899,15 +906,15 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
check_ssl = check_site.is_ssl
|
check_ssl = check_site.is_ssl
|
||||||
check_php_version = check_site.php_version
|
check_php_version = check_site.php_version
|
||||||
|
|
||||||
if check_php_version == "7.2":
|
if check_php_version == "7.3":
|
||||||
old_php72 = True
|
old_php73 = True
|
||||||
else:
|
else:
|
||||||
old_php72 = False
|
old_php73 = False
|
||||||
|
|
||||||
if (pargs.password and not (pargs.html or
|
if (pargs.password and not (pargs.html or
|
||||||
pargs.php or pargs.php72 or pargs.mysql or
|
pargs.php or pargs.php73 or pargs.mysql or
|
||||||
pargs.wp or pargs.wpfc or pargs.wpsc or
|
pargs.wp or pargs.wpfc or pargs.wpsc or
|
||||||
pargs.wpsubdir or pargs.wpsubdomain)):
|
pargs.wpsubdir or pargs.wpsubdomain)):
|
||||||
try:
|
try:
|
||||||
updatewpuserpassword(self, wo_domain, wo_site_webroot)
|
updatewpuserpassword(self, wo_domain, wo_site_webroot)
|
||||||
except SiteError as e:
|
except SiteError as e:
|
||||||
@@ -917,24 +924,24 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
|
|
||||||
if ((stype == "proxy" and stype == oldsitetype and self.app.pargs.hhvm)
|
if ((stype == "proxy" and stype == oldsitetype and self.app.pargs.hhvm)
|
||||||
or (stype == "proxy" and
|
or (stype == "proxy" and
|
||||||
stype == oldsitetype )):
|
stype == oldsitetype)):
|
||||||
Log.info(self, Log.FAIL +
|
Log.info(self, Log.FAIL +
|
||||||
"Can not update proxy site to HHVM")
|
"Can not update proxy site to HHVM")
|
||||||
return 1
|
return 1
|
||||||
if stype == "html" and stype == oldsitetype and self.app.pargs.hhvm:
|
if stype == "html" and stype == oldsitetype and self.app.pargs.hhvm:
|
||||||
Log.info(self, Log.FAIL + "Can not update HTML site to HHVM")
|
Log.info(self, Log.FAIL + "Can not update HTML site to HHVM")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if ((stype == 'php' and oldsitetype not in ['html', 'proxy', 'php72']) or
|
if ((stype == 'php' and oldsitetype not in ['html', 'proxy', 'php73']) or
|
||||||
# (stype == 'php72' and oldsitetype not in ['html', 'mysql', 'php', 'php72', 'wp', 'wpsubdir', 'wpsubdomain', ]) or
|
# (stype == 'php73' and oldsitetype not in ['html', 'mysql', 'php', 'php73', 'wp', 'wpsubdir', 'wpsubdomain', ]) or
|
||||||
(stype == 'mysql' and oldsitetype not in ['html', 'php',
|
(stype == 'mysql' and oldsitetype not in ['html', 'php',
|
||||||
'proxy','php72']) or
|
'proxy', 'php73']) or
|
||||||
(stype == 'wp' and oldsitetype not in ['html', 'php', 'mysql',
|
(stype == 'wp' and oldsitetype not in ['html', 'php', 'mysql',
|
||||||
'proxy', 'wp', 'php72']) or
|
'proxy', 'wp', 'php73']) or
|
||||||
(stype == 'wpsubdir' and oldsitetype in ['wpsubdomain']) or
|
(stype == 'wpsubdir' and oldsitetype in ['wpsubdomain']) or
|
||||||
(stype == 'wpsubdomain' and oldsitetype in ['wpsubdir']) or
|
(stype == 'wpsubdomain' and oldsitetype in ['wpsubdir']) or
|
||||||
(stype == oldsitetype and cache == oldcachetype) and
|
(stype == oldsitetype and cache == oldcachetype) and
|
||||||
not pargs.php72):
|
not pargs.php73):
|
||||||
Log.info(self, Log.FAIL + "can not update {0} {1} to {2} {3}".
|
Log.info(self, Log.FAIL + "can not update {0} {1} to {2} {3}".
|
||||||
format(oldsitetype, oldcachetype, stype, cache))
|
format(oldsitetype, oldcachetype, stype, cache))
|
||||||
return 1
|
return 1
|
||||||
@@ -976,7 +983,7 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
if stype == 'wpsubdir':
|
if stype == 'wpsubdir':
|
||||||
data['wpsubdir'] = True
|
data['wpsubdir'] = True
|
||||||
|
|
||||||
if pargs.hhvm or pargs.php72:
|
if pargs.hhvm or pargs.php73:
|
||||||
if not data:
|
if not data:
|
||||||
data = dict(site_name=wo_domain, www_domain=wo_www_domain,
|
data = dict(site_name=wo_domain, www_domain=wo_www_domain,
|
||||||
currsitetype=oldsitetype,
|
currsitetype=oldsitetype,
|
||||||
@@ -1038,83 +1045,92 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
data['hhvm'] = False
|
data['hhvm'] = False
|
||||||
hhvm = False
|
hhvm = False
|
||||||
|
|
||||||
if pargs.php72 == 'on' :
|
if pargs.php73 == 'on':
|
||||||
data['php72'] = True
|
data['php73'] = True
|
||||||
php72 = True
|
php73 = True
|
||||||
check_php_version= '7.2'
|
check_php_version = '7.3'
|
||||||
elif pargs.php72 == 'off':
|
elif pargs.php73 == 'off':
|
||||||
data['php72'] = False
|
data['php73'] = False
|
||||||
php72 = False
|
php73 = False
|
||||||
check_php_version = '5.6'
|
check_php_version = '7.2'
|
||||||
|
|
||||||
if pargs.php72:
|
if pargs.php73:
|
||||||
if php72 is old_php72:
|
if php73 is old_php73:
|
||||||
if php72 is False:
|
if php73 is False:
|
||||||
Log.info(self, "PHP 7.2 is already disabled for given "
|
Log.info(self, "PHP 7.3 is already disabled for given "
|
||||||
"site")
|
"site")
|
||||||
elif php72 is True:
|
elif php73 is True:
|
||||||
Log.info(self, "PHP 7.2 is already enabled for given "
|
Log.info(self, "PHP 7.3 is already enabled for given "
|
||||||
"site")
|
"site")
|
||||||
pargs.php72 = False
|
pargs.php73 = False
|
||||||
|
|
||||||
#--letsencrypt=renew code goes here
|
# --letsencrypt=renew code goes here
|
||||||
if pargs.letsencrypt == "renew" and not pargs.all:
|
if pargs.letsencrypt == "renew" and not pargs.all:
|
||||||
expiry_days = SSL.getExpirationDays(self,wo_domain)
|
expiry_days = SSL.getExpirationDays(self, wo_domain)
|
||||||
min_expiry_days = 30
|
min_expiry_days = 30
|
||||||
if check_ssl:
|
if check_ssl:
|
||||||
if (expiry_days <= min_expiry_days):
|
if (expiry_days <= min_expiry_days):
|
||||||
renewLetsEncrypt(self,wo_domain)
|
renewLetsEncrypt(self, wo_domain)
|
||||||
else:
|
else:
|
||||||
Log.error(self,"You have more than 30 days with the current certificate - refusing to run.")
|
Log.error(
|
||||||
|
self, "You have more than 30 days with the current certificate - refusing to run.")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
Log.error(self,"Cannot renew - HTTPS is not configured for the given site. Install LE first...")
|
Log.error(
|
||||||
|
self, "Cannot renew - HTTPS is not configured for the given site. Install LE first...")
|
||||||
|
|
||||||
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")
|
||||||
Log.info(self, "SUCCESS: Certificate was successfully renewed For"
|
Log.info(self, "SUCCESS: Certificate was successfully renewed For"
|
||||||
" https://{0}".format(wo_domain))
|
" https://{0}".format(wo_domain))
|
||||||
if (SSL.getExpirationDays(self,wo_domain)>0):
|
if (SSL.getExpirationDays(self, wo_domain) > 0):
|
||||||
Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,wo_domain)) + " days.")
|
Log.info(self, "Your cert will expire within " +
|
||||||
Log.info(self, "Expiration date: " + str(SSL.getExpirationDate(self,wo_domain)))
|
str(SSL.getExpirationDays(self, wo_domain)) + " days.")
|
||||||
|
Log.info(self, "Expiration date: " +
|
||||||
|
str(SSL.getExpirationDate(self, wo_domain)))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
Log.warn(self, "The certificate seems to be already expired. Please renew it as soon as possible...")
|
Log.warn(
|
||||||
|
self, "The certificate seems to be already expired. Please renew it as soon as possible...")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if pargs.all and pargs.letsencrypt == "renew":
|
if pargs.all and pargs.letsencrypt == "renew":
|
||||||
|
|
||||||
if check_ssl:
|
if check_ssl:
|
||||||
expiry_days = SSL.getExpirationDays(self,wo_domain,True)
|
expiry_days = SSL.getExpirationDays(self, wo_domain, True)
|
||||||
if expiry_days < 0:
|
if expiry_days < 0:
|
||||||
return 0
|
return 0
|
||||||
min_expiry_days = 30
|
min_expiry_days = 30
|
||||||
if (expiry_days <= min_expiry_days):
|
if (expiry_days <= min_expiry_days):
|
||||||
renewLetsEncrypt(self,wo_domain)
|
renewLetsEncrypt(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")
|
||||||
Log.info(self, "SUCCESS: Certificate was successfully renewed For"
|
Log.info(self, "SUCCESS: Certificate was successfully renewed For"
|
||||||
" https://{0}".format(wo_domain))
|
" https://{0}".format(wo_domain))
|
||||||
else:
|
else:
|
||||||
Log.info(self,"You have more than 30 days with the current certificate - refusing to run.\n")
|
Log.info(
|
||||||
|
self, "You have more than 30 days with the current certificate - refusing to run.\n")
|
||||||
|
|
||||||
if (SSL.getExpirationDays(self,wo_domain)>0):
|
if (SSL.getExpirationDays(self, wo_domain) > 0):
|
||||||
Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,wo_domain)) + " days.")
|
Log.info(self, "Your cert will expire within " +
|
||||||
Log.info(self, "Expiration date: \n\n" + str(SSL.getExpirationDate(self,wo_domain)))
|
str(SSL.getExpirationDays(self, wo_domain)) + " days.")
|
||||||
|
Log.info(self, "Expiration date: \n\n" +
|
||||||
|
str(SSL.getExpirationDate(self, wo_domain)))
|
||||||
return 0
|
return 0
|
||||||
#else:
|
# else:
|
||||||
# Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ")
|
# Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ")
|
||||||
else:
|
else:
|
||||||
Log.info(self,"SSL not configured for site http://{0}".format(wo_domain))
|
Log.info(
|
||||||
|
self, "SSL not configured for site http://{0}".format(wo_domain))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if pargs.all and pargs.letsencrypt == "off":
|
if pargs.all and pargs.letsencrypt == "off":
|
||||||
if letsencrypt is check_ssl:
|
if letsencrypt is check_ssl:
|
||||||
if letsencrypt is False:
|
if letsencrypt is False:
|
||||||
Log.error(self, "HTTPS is not configured for given "
|
Log.error(self, "HTTPS is not configured for given "
|
||||||
"site",False)
|
"site", False)
|
||||||
return 0
|
return 0
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -1129,10 +1145,10 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
if letsencrypt is check_ssl:
|
if letsencrypt is check_ssl:
|
||||||
if letsencrypt is False:
|
if letsencrypt is False:
|
||||||
Log.error(self, "SSl is not configured for given "
|
Log.error(self, "SSl is not configured for given "
|
||||||
"site")
|
"site")
|
||||||
elif letsencrypt is True:
|
elif letsencrypt is True:
|
||||||
Log.error(self, "SSl is already configured for given "
|
Log.error(self, "SSl is already configured for given "
|
||||||
"site")
|
"site")
|
||||||
pargs.letsencrypt = False
|
pargs.letsencrypt = False
|
||||||
|
|
||||||
if pargs.hhvm:
|
if pargs.hhvm:
|
||||||
@@ -1154,33 +1170,34 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
data['hhvm'] = False
|
data['hhvm'] = False
|
||||||
hhvm = False
|
hhvm = False
|
||||||
|
|
||||||
if data and (not pargs.php72):
|
if data and (not pargs.php73):
|
||||||
if old_php72 is True:
|
if old_php73 is True:
|
||||||
data['php72'] = True
|
data['php73'] = True
|
||||||
php72 = True
|
php73 = True
|
||||||
else:
|
else:
|
||||||
data['php72'] = False
|
data['php73'] = False
|
||||||
php72 = False
|
php73 = False
|
||||||
|
|
||||||
if pargs.hhvm=="on" or pargs.letsencrypt=="on" or pargs.php72=="on":
|
if pargs.hhvm == "on" or pargs.letsencrypt == "on" or pargs.php73 == "on":
|
||||||
if pargs.php72 == "on":
|
if pargs.php73 == "on":
|
||||||
if (not pargs.experimental):
|
if pargs.experimental:
|
||||||
Log.info(self, "Do you wish to enable PHP 7.2 now for {0}?".format(wo_domain))
|
Log.info(
|
||||||
|
self, "Do you wish to enable PHP 7.3 now for {0}?".format(wo_domain))
|
||||||
|
|
||||||
check_prompt = input("Type \"y\" to continue [n]:")
|
check_prompt = input("Type \"y\" to continue [n]:")
|
||||||
if check_prompt != "Y" and check_prompt != "y":
|
if check_prompt != "Y" and check_prompt != "y":
|
||||||
Log.info(self, "Not using PHP 7.2 for site")
|
Log.info(self, "Not using PHP 7.3 for site")
|
||||||
data['php72'] = False
|
data['php73'] = False
|
||||||
php72 = False
|
php73 = False
|
||||||
else:
|
else:
|
||||||
data['php72'] = True
|
data['php73'] = True
|
||||||
php72 = True
|
php73 = True
|
||||||
else:
|
else:
|
||||||
data['php72'] = True
|
data['php73'] = True
|
||||||
php72 = True
|
php73 = True
|
||||||
|
|
||||||
if pargs.hhvm == "on":
|
if pargs.hhvm == "on":
|
||||||
if (not pargs.experimental):
|
if pargs.experimental:
|
||||||
Log.info(self, "HHVM is experimental feature and it may not"
|
Log.info(self, "HHVM is experimental feature and it may not"
|
||||||
" work with all plugins of your site.\nYou can "
|
" work with all plugins of your site.\nYou can "
|
||||||
"disable it by passing --hhvm=off later.\nDo you wish"
|
"disable it by passing --hhvm=off later.\nDo you wish"
|
||||||
@@ -1201,10 +1218,11 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
|
|
||||||
if pargs.letsencrypt == "on":
|
if pargs.letsencrypt == "on":
|
||||||
|
|
||||||
if (not pargs.experimental):
|
if pargs.experimental:
|
||||||
|
|
||||||
if oldsitetype in ['wpsubdomain']:
|
if oldsitetype in ['wpsubdomain']:
|
||||||
Log.warn(self, "Wildcard domains are not supported in Lets Encrypt.\nWP SUBDOMAIN site will get SSL for primary site only.")
|
Log.warn(
|
||||||
|
self, "Wildcard domains are not supported in Lets Encrypt.\nWP SUBDOMAIN site will get SSL for primary site only.")
|
||||||
|
|
||||||
Log.info(self, "Letsencrypt is currently in beta phase."
|
Log.info(self, "Letsencrypt is currently in beta phase."
|
||||||
" \nDo you wish"
|
" \nDo you wish"
|
||||||
@@ -1222,10 +1240,8 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
data['letsencrypt'] = True
|
data['letsencrypt'] = True
|
||||||
letsencrypt = True
|
letsencrypt = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if pargs.wpredis and data['currcachetype'] != 'wpredis':
|
if pargs.wpredis and data['currcachetype'] != 'wpredis':
|
||||||
if (not pargs.experimental):
|
if pargs.experimental:
|
||||||
Log.info(self, "Redis is experimental feature and it may not"
|
Log.info(self, "Redis is experimental feature and it may not"
|
||||||
" work with all plugins of your site.\nYou can "
|
" work with all plugins of your site.\nYou can "
|
||||||
"disable it by changing cache type later.\nDo you wish"
|
"disable it by changing cache type later.\nDo you wish"
|
||||||
@@ -1239,8 +1255,8 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
data['basic'] = True
|
data['basic'] = True
|
||||||
cache = 'basic'
|
cache = 'basic'
|
||||||
|
|
||||||
if ((hhvm is old_hhvm) and (php72 is old_php72) and
|
if ((hhvm is old_hhvm) and (php73 is old_php73) and
|
||||||
(stype == oldsitetype and cache == oldcachetype)):
|
(stype == oldsitetype and cache == oldcachetype)):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if not data:
|
if not data:
|
||||||
@@ -1265,7 +1281,7 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
Log.info(self, Log.FAIL + "Check the log for details: "
|
Log.info(self, Log.FAIL + "Check the log for details: "
|
||||||
"`tail /var/log/wo/wordops.log` and please try again")
|
"`tail /var/log/wo/wordops.log` and please try again")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# setup NGINX configuration, and webroot
|
# setup NGINX configuration, and webroot
|
||||||
@@ -1274,13 +1290,13 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
except SiteError as e:
|
except SiteError as e:
|
||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
Log.info(self, Log.FAIL + "Update site failed."
|
Log.info(self, Log.FAIL + "Update site failed."
|
||||||
"Check the log for details:"
|
"Check the log for details:"
|
||||||
"`tail /var/log/wo/wordops.log` and please try again")
|
"`tail /var/log/wo/wordops.log` and please try again")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if 'proxy' in data.keys() and data['proxy']:
|
if 'proxy' in data.keys() and data['proxy']:
|
||||||
updateSiteInfo(self, wo_domain, stype=stype, cache=cache,
|
updateSiteInfo(self, wo_domain, stype=stype, cache=cache,
|
||||||
hhvm=hhvm,ssl=True if check_site.is_ssl else False)
|
hhvm=hhvm, ssl=True if check_site.is_ssl else False)
|
||||||
Log.info(self, "Successfully updated site"
|
Log.info(self, "Successfully updated site"
|
||||||
" http://{0}".format(wo_domain))
|
" http://{0}".format(wo_domain))
|
||||||
return 0
|
return 0
|
||||||
@@ -1288,54 +1304,55 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
if pargs.letsencrypt:
|
if pargs.letsencrypt:
|
||||||
if data['letsencrypt'] is True:
|
if data['letsencrypt'] is True:
|
||||||
if not os.path.isfile("{0}/conf/nginx/ssl.conf.disabled"
|
if not os.path.isfile("{0}/conf/nginx/ssl.conf.disabled"
|
||||||
.format(wo_site_webroot)):
|
.format(wo_site_webroot)):
|
||||||
setupLetsEncrypt(self, wo_domain)
|
setupLetsEncrypt(self, wo_domain)
|
||||||
|
|
||||||
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)
|
httpsRedirect(self, wo_domain)
|
||||||
Log.info(self,"Creating Cron Job for cert auto-renewal")
|
Log.info(self, "Creating Cron Job for cert auto-renewal")
|
||||||
WOCron.setcron_weekly(self,'wo site update --le=renew --all 2> /dev/null'.format(wo_domain),'Renew all'
|
WOCron.setcron_weekly(self, 'wo site update --le=renew --all 2> /dev/null'.format(wo_domain), 'Renew all'
|
||||||
' letsencrypt SSL cert. Set by WordOps')
|
' letsencrypt SSL cert. Set by WordOps')
|
||||||
|
|
||||||
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")
|
||||||
|
|
||||||
Log.info(self, "Congratulations! Successfully Configured SSl for Site "
|
Log.info(self, "Congratulations! Successfully Configured SSl for Site "
|
||||||
" https://{0}".format(wo_domain))
|
" https://{0}".format(wo_domain))
|
||||||
|
|
||||||
if (SSL.getExpirationDays(self,wo_domain)>0):
|
if (SSL.getExpirationDays(self, wo_domain) > 0):
|
||||||
Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,wo_domain)) + " days.")
|
Log.info(self, "Your cert will expire within " +
|
||||||
|
str(SSL.getExpirationDays(self, wo_domain)) + " days.")
|
||||||
else:
|
else:
|
||||||
Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ")
|
Log.warn(
|
||||||
|
self, "Your cert already EXPIRED ! .PLEASE renew soon . ")
|
||||||
|
|
||||||
elif data['letsencrypt'] is False:
|
elif data['letsencrypt'] is False:
|
||||||
if os.path.isfile("{0}/conf/nginx/ssl.conf"
|
if os.path.isfile("{0}/conf/nginx/ssl.conf"
|
||||||
.format(wo_site_webroot)):
|
.format(wo_site_webroot)):
|
||||||
Log.info(self,'Setting Nginx configuration')
|
Log.info(self, 'Setting Nginx configuration')
|
||||||
WOFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf"
|
WOFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf"
|
||||||
.format(wo_site_webroot),
|
.format(wo_site_webroot),
|
||||||
'{0}/conf/nginx/ssl.conf.disabled'
|
'{0}/conf/nginx/ssl.conf.disabled'
|
||||||
.format(wo_site_webroot))
|
.format(wo_site_webroot))
|
||||||
httpsRedirect(self,wo_domain,False)
|
httpsRedirect(self, wo_domain, False)
|
||||||
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")
|
||||||
#Log.info(self,"Removing Cron Job set for cert auto-renewal")
|
# Log.info(self,"Removing Cron Job set for cert auto-renewal")
|
||||||
#WOCron.remove_cron(self,'wo site update {0} --le=renew --min_expiry_limit 30 2> \/dev\/null'.format(wo_domain))
|
# WOCron.remove_cron(self,'wo site update {0} --le=renew --min_expiry_limit 30 2> \/dev\/null'.format(wo_domain))
|
||||||
Log.info(self, "Successfully Disabled SSl for Site "
|
Log.info(self, "Successfully Disabled SSl for Site "
|
||||||
" http://{0}".format(wo_domain))
|
" http://{0}".format(wo_domain))
|
||||||
|
|
||||||
|
|
||||||
# Add nginx conf folder into GIT
|
# Add nginx conf folder into GIT
|
||||||
WOGit.add(self, ["{0}/conf/nginx".format(wo_site_webroot)],
|
WOGit.add(self, ["{0}/conf/nginx".format(wo_site_webroot)],
|
||||||
msg="Adding letsencrypts config of site: {0}"
|
msg="Adding letsencrypts config of site: {0}"
|
||||||
.format(wo_domain))
|
.format(wo_domain))
|
||||||
updateSiteInfo(self, wo_domain, ssl=letsencrypt)
|
updateSiteInfo(self, wo_domain, ssl=letsencrypt)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -1353,7 +1370,7 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
" http://{0}".format(wo_domain))
|
" http://{0}".format(wo_domain))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
#if data['wo_db_name'] and not data['wp']:
|
# if data['wo_db_name'] and not data['wp']:
|
||||||
if 'wo_db_name' in data.keys() and not data['wp']:
|
if 'wo_db_name' in data.keys() and not data['wp']:
|
||||||
try:
|
try:
|
||||||
data = setupdatabase(self, data)
|
data = setupdatabase(self, data)
|
||||||
@@ -1409,10 +1426,11 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
if ((oldcachetype in ['wpsc', 'basic', 'wpredis'] and
|
if ((oldcachetype in ['wpsc', 'basic', 'wpredis'] and
|
||||||
(data['wpfc'])) or (oldsitetype == 'wp' and data['multisite'] and data['wpfc'])):
|
(data['wpfc'])) or (oldsitetype == 'wp' and data['multisite'] and data['wpfc'])):
|
||||||
try:
|
try:
|
||||||
plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":1,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_fastcgi","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}'
|
plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":1,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_fastcgi","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}'
|
||||||
setupwp_plugin(self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data)
|
setupwp_plugin(
|
||||||
|
self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data)
|
||||||
except SiteError as e:
|
except SiteError as e:
|
||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
Log.info(self, Log.FAIL + "Update nginx-helper settings failed. "
|
Log.info(self, Log.FAIL + "Update nginx-helper settings failed. "
|
||||||
@@ -1421,10 +1439,11 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
elif ((oldcachetype in ['wpsc', 'basic', 'wpfc'] and
|
elif ((oldcachetype in ['wpsc', 'basic', 'wpfc'] and
|
||||||
(data['wpredis'])) or (oldsitetype == 'wp' and data['multisite'] and data['wpredis'])):
|
(data['wpredis'])) or (oldsitetype == 'wp' and data['multisite'] and data['wpredis'])):
|
||||||
try:
|
try:
|
||||||
plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":1,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_redis","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}'
|
plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":1,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_redis","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}'
|
||||||
setupwp_plugin(self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data)
|
setupwp_plugin(
|
||||||
|
self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data)
|
||||||
except SiteError as e:
|
except SiteError as e:
|
||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
Log.info(self, Log.FAIL + "Update nginx-helper settings failed. "
|
Log.info(self, Log.FAIL + "Update nginx-helper settings failed. "
|
||||||
@@ -1434,7 +1453,8 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":0,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_redis","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}'
|
plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":0,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_redis","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}'
|
||||||
setupwp_plugin(self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data)
|
setupwp_plugin(
|
||||||
|
self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data)
|
||||||
except SiteError as e:
|
except SiteError as e:
|
||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
Log.info(self, Log.FAIL + "Update nginx-helper settings failed. "
|
Log.info(self, Log.FAIL + "Update nginx-helper settings failed. "
|
||||||
@@ -1475,14 +1495,18 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
if oldcachetype != 'wpredis' and data['wpredis']:
|
if oldcachetype != 'wpredis' and data['wpredis']:
|
||||||
try:
|
try:
|
||||||
if installwp_plugin(self, 'redis-cache', data):
|
if installwp_plugin(self, 'redis-cache', data):
|
||||||
#search for wp-config.php
|
# search for wp-config.php
|
||||||
if WOFileUtils.isexist(self,"{0}/wp-config.php".format(wo_site_webroot)):
|
if WOFileUtils.isexist(self, "{0}/wp-config.php".format(wo_site_webroot)):
|
||||||
config_path = '{0}/wp-config.php'.format(wo_site_webroot)
|
config_path = '{0}/wp-config.php'.format(
|
||||||
elif WOFileUtils.isexist(self,"{0}/htdocs/wp-config.php".format(wo_site_webroot)):
|
wo_site_webroot)
|
||||||
config_path = '{0}/htdocs/wp-config.php'.format(wo_site_webroot)
|
elif WOFileUtils.isexist(self, "{0}/htdocs/wp-config.php".format(wo_site_webroot)):
|
||||||
|
config_path = '{0}/htdocs/wp-config.php'.format(
|
||||||
|
wo_site_webroot)
|
||||||
else:
|
else:
|
||||||
Log.debug(self, "Updating wp-config.php failed. File could not be located.")
|
Log.debug(
|
||||||
Log.error(self,"wp-config.php could not be located !!")
|
self, "Updating wp-config.php failed. File could not be located.")
|
||||||
|
Log.error(
|
||||||
|
self, "wp-config.php could not be located !!")
|
||||||
raise SiteError
|
raise SiteError
|
||||||
|
|
||||||
if WOShellExec.cmd_exec(self, "grep -q \"WP_CACHE_KEY_SALT\" {0}"
|
if WOShellExec.cmd_exec(self, "grep -q \"WP_CACHE_KEY_SALT\" {0}"
|
||||||
@@ -1491,7 +1515,7 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
wpconfig = open("{0}".format(config_path),
|
wpconfig = open("{0}".format(config_path),
|
||||||
encoding='utf-8', mode='a')
|
encoding='utf-8', mode='a')
|
||||||
wpconfig.write("\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );"
|
wpconfig.write("\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );"
|
||||||
.format(wo_domain))
|
.format(wo_domain))
|
||||||
wpconfig.close()
|
wpconfig.close()
|
||||||
@@ -1543,10 +1567,10 @@ class WOSiteUpdateController(CementBaseController):
|
|||||||
db_user=data['wo_db_user'],
|
db_user=data['wo_db_user'],
|
||||||
db_password=data['wo_db_pass'],
|
db_password=data['wo_db_pass'],
|
||||||
db_host=data['wo_db_host'], hhvm=hhvm,
|
db_host=data['wo_db_host'], hhvm=hhvm,
|
||||||
ssl=True if check_site.is_ssl else False,php_version=check_php_version)
|
ssl=True if check_site.is_ssl else False, php_version=check_php_version)
|
||||||
else:
|
else:
|
||||||
updateSiteInfo(self, wo_domain, stype=stype, cache=cache,
|
updateSiteInfo(self, wo_domain, stype=stype, cache=cache,
|
||||||
hhvm=hhvm, ssl=True if check_site.is_ssl else False,php_version=check_php_version)
|
hhvm=hhvm, ssl=True if check_site.is_ssl else False, php_version=check_php_version)
|
||||||
Log.info(self, "Successfully updated site"
|
Log.info(self, "Successfully updated site"
|
||||||
" http://{0}".format(wo_domain))
|
" http://{0}".format(wo_domain))
|
||||||
return 0
|
return 0
|
||||||
@@ -1564,7 +1588,7 @@ class WOSiteDeleteController(CementBaseController):
|
|||||||
(['--no-prompt'],
|
(['--no-prompt'],
|
||||||
dict(help="doesnt ask permission for delete",
|
dict(help="doesnt ask permission for delete",
|
||||||
action='store_true')),
|
action='store_true')),
|
||||||
(['-f','--force'],
|
(['-f', '--force'],
|
||||||
dict(help="forcefully delete site and configuration",
|
dict(help="forcefully delete site and configuration",
|
||||||
action='store_true')),
|
action='store_true')),
|
||||||
(['--all'],
|
(['--all'],
|
||||||
@@ -1573,7 +1597,7 @@ class WOSiteDeleteController(CementBaseController):
|
|||||||
dict(help="delete db only", action='store_true')),
|
dict(help="delete db only", action='store_true')),
|
||||||
(['--files'],
|
(['--files'],
|
||||||
dict(help="delete webroot only", action='store_true')),
|
dict(help="delete webroot only", action='store_true')),
|
||||||
]
|
]
|
||||||
|
|
||||||
@expose(help="Delete website configuration and files")
|
@expose(help="Delete website configuration and files")
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
@@ -1599,7 +1623,7 @@ class WOSiteDeleteController(CementBaseController):
|
|||||||
Log.error(self, "site {0} does not exist".format(wo_domain))
|
Log.error(self, "site {0} does not exist".format(wo_domain))
|
||||||
|
|
||||||
if ((not self.app.pargs.db) and (not self.app.pargs.files) and
|
if ((not self.app.pargs.db) and (not self.app.pargs.files) and
|
||||||
(not self.app.pargs.all)):
|
(not self.app.pargs.all)):
|
||||||
self.app.pargs.all = True
|
self.app.pargs.all = True
|
||||||
|
|
||||||
# Gather information from wo-db for wo_domain
|
# Gather information from wo-db for wo_domain
|
||||||
@@ -1636,7 +1660,8 @@ class WOSiteDeleteController(CementBaseController):
|
|||||||
mark_db_delete_prompt = True
|
mark_db_delete_prompt = True
|
||||||
Log.info(self, "Deleting Database, {0}, user {1}"
|
Log.info(self, "Deleting Database, {0}, user {1}"
|
||||||
.format(wo_db_name, wo_db_user))
|
.format(wo_db_name, wo_db_user))
|
||||||
deleteDB(self, wo_db_name, wo_db_user, wo_mysql_grant_host, False)
|
deleteDB(self, wo_db_name, wo_db_user,
|
||||||
|
wo_mysql_grant_host, False)
|
||||||
updateSiteInfo(self, wo_domain,
|
updateSiteInfo(self, wo_domain,
|
||||||
db_name='deleted',
|
db_name='deleted',
|
||||||
db_user='deleted',
|
db_user='deleted',
|
||||||
@@ -1676,7 +1701,7 @@ class WOSiteDeleteController(CementBaseController):
|
|||||||
removeNginxConf(self, wo_domain)
|
removeNginxConf(self, wo_domain)
|
||||||
deleteSiteInfo(self, wo_domain)
|
deleteSiteInfo(self, wo_domain)
|
||||||
Log.info(self, "Deleted site {0}".format(wo_domain))
|
Log.info(self, "Deleted site {0}".format(wo_domain))
|
||||||
# else:
|
# else:
|
||||||
# Log.error(self, " site {0} does not exists".format(wo_domain))
|
# Log.error(self, " site {0} does not exists".format(wo_domain))
|
||||||
else:
|
else:
|
||||||
if (mark_db_delete_prompt or mark_webroot_delete_prompt or (mark_webroot_deleted and mark_db_deleted)):
|
if (mark_db_delete_prompt or mark_webroot_delete_prompt or (mark_webroot_deleted and mark_db_deleted)):
|
||||||
@@ -1697,25 +1722,25 @@ class WOSiteListController(CementBaseController):
|
|||||||
dict(help='List enabled websites', action='store_true')),
|
dict(help='List enabled websites', action='store_true')),
|
||||||
(['--disabled'],
|
(['--disabled'],
|
||||||
dict(help="List disabled websites", action='store_true')),
|
dict(help="List disabled websites", action='store_true')),
|
||||||
]
|
]
|
||||||
|
|
||||||
@expose(help="Lists websites")
|
@expose(help="Lists websites")
|
||||||
def default(self):
|
def default(self):
|
||||||
sites = getAllsites(self)
|
sites = getAllsites(self)
|
||||||
if not sites:
|
if not sites:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if self.app.pargs.enabled:
|
if self.app.pargs.enabled:
|
||||||
for site in sites:
|
for site in sites:
|
||||||
if site.is_enabled:
|
if site.is_enabled:
|
||||||
Log.info(self, "{0}".format(site.sitename))
|
Log.info(self, "{0}".format(site.sitename))
|
||||||
elif self.app.pargs.disabled:
|
elif self.app.pargs.disabled:
|
||||||
for site in sites:
|
for site in sites:
|
||||||
if not site.is_enabled:
|
if not site.is_enabled:
|
||||||
Log.info(self, "{0}".format(site.sitename))
|
Log.info(self, "{0}".format(site.sitename))
|
||||||
else:
|
else:
|
||||||
for site in sites:
|
for site in sites:
|
||||||
Log.info(self, "{0}".format(site.sitename))
|
Log.info(self, "{0}".format(site.sitename))
|
||||||
|
|
||||||
|
|
||||||
def load(app):
|
def load(app):
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ def check_domain_exists(self, domain):
|
|||||||
|
|
||||||
def setupdomain(self, data):
|
def setupdomain(self, data):
|
||||||
|
|
||||||
#for debug purpose
|
# for debug purpose
|
||||||
# for key, value in data.items() :
|
# for key, value in data.items() :
|
||||||
# print (key, value)
|
# print (key, value)
|
||||||
|
|
||||||
wo_domain_name = data['site_name']
|
wo_domain_name = data['site_name']
|
||||||
wo_site_webroot = data['webroot'] if 'webroot' in data.keys() else ''
|
wo_site_webroot = data['webroot'] if 'webroot' in data.keys() else ''
|
||||||
@@ -72,7 +72,7 @@ def setupdomain(self, data):
|
|||||||
wo_site_nginx_conf = open('/etc/nginx/sites-available/{0}'
|
wo_site_nginx_conf = open('/etc/nginx/sites-available/{0}'
|
||||||
.format(wo_domain_name), encoding='utf-8',
|
.format(wo_domain_name), encoding='utf-8',
|
||||||
mode='w')
|
mode='w')
|
||||||
if not data['php72']:
|
if not data['php73']:
|
||||||
self.app.render((data), 'virtualconf.mustache',
|
self.app.render((data), 'virtualconf.mustache',
|
||||||
out=wo_site_nginx_conf)
|
out=wo_site_nginx_conf)
|
||||||
else:
|
else:
|
||||||
@@ -100,7 +100,6 @@ def setupdomain(self, data):
|
|||||||
raise SiteError("created nginx configuration failed for site."
|
raise SiteError("created nginx configuration failed for site."
|
||||||
" check with `nginx -t`")
|
" check with `nginx -t`")
|
||||||
|
|
||||||
|
|
||||||
# create symbolic link for
|
# create symbolic link for
|
||||||
WOFileUtils.create_symlink(self, ['/etc/nginx/sites-available/{0}'
|
WOFileUtils.create_symlink(self, ['/etc/nginx/sites-available/{0}'
|
||||||
.format(wo_domain_name),
|
.format(wo_domain_name),
|
||||||
@@ -302,30 +301,30 @@ def setupwordpress(self, data):
|
|||||||
"--dbhost=\'{3}\' "
|
"--dbhost=\'{3}\' "
|
||||||
.format(data['wo_db_name'], wo_wp_prefix,
|
.format(data['wo_db_name'], wo_wp_prefix,
|
||||||
data['wo_db_user'], data['wo_db_host'])
|
data['wo_db_user'], data['wo_db_host'])
|
||||||
+ "--dbpass= "
|
+ "--dbpass=\'{0}\' "
|
||||||
"--extra-php<<PHP \n {1}\nPHP\""
|
"--extra-php<<PHP \n {1}\nPHP\""
|
||||||
.format(data['wo_db_pass'],
|
.format(data['wo_db_pass'],
|
||||||
"\n\ndefine(\'WP_DEBUG\', false);"))
|
"\n\ndefine(\'WP_DEBUG\', false);"))
|
||||||
try:
|
try:
|
||||||
if WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root"
|
if WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root"
|
||||||
.format(WOVariables.wo_wpcli_path)
|
.format(WOVariables.wo_wpcli_path)
|
||||||
+ " core config "
|
+ " core config "
|
||||||
+ "--dbname=\'{0}\' --dbprefix=\'{1}\' "
|
+ "--dbname=\'{0}\' --dbprefix=\'{1}\' "
|
||||||
"--dbuser=\'{2}\' --dbhost=\'{3}\' "
|
"--dbuser=\'{2}\' --dbhost=\'{3}\' "
|
||||||
.format(data['wo_db_name'], wo_wp_prefix,
|
.format(data['wo_db_name'], wo_wp_prefix,
|
||||||
data['wo_db_user'], data['wo_db_host']
|
data['wo_db_user'], data['wo_db_host']
|
||||||
)
|
)
|
||||||
+ "--dbpass=\'{0}\' "
|
+ "--dbpass=\'{0}\' "
|
||||||
"--extra-php<<PHP \n {1} {redissalt}\nPHP\""
|
"--extra-php<<PHP \n {1} {redissalt}\nPHP\""
|
||||||
.format(data['wo_db_pass'],
|
.format(data['wo_db_pass'],
|
||||||
"\n\ndefine(\'WP_DEBUG\', false);",
|
"\n\ndefine(\'WP_DEBUG\', false);",
|
||||||
redissalt="\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );"
|
redissalt="\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );"
|
||||||
.format(wo_domain_name) if data['wpredis']
|
.format(wo_domain_name) if data['wpredis']
|
||||||
else ''),
|
else ''),
|
||||||
log=False
|
log=False
|
||||||
):
|
):
|
||||||
pass
|
pass
|
||||||
else :
|
else:
|
||||||
raise SiteError("generate wp-config failed for wp single site")
|
raise SiteError("generate wp-config failed for wp single site")
|
||||||
except CommandExecutionError as e:
|
except CommandExecutionError as e:
|
||||||
raise SiteError("generate wp-config failed for wp single site")
|
raise SiteError("generate wp-config failed for wp single site")
|
||||||
@@ -336,56 +335,51 @@ def setupwordpress(self, data):
|
|||||||
+ "core config "
|
+ "core config "
|
||||||
+ "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' "
|
+ "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' "
|
||||||
.format(data['wo_db_name'], wo_wp_prefix, data['wo_db_host'])
|
.format(data['wo_db_name'], wo_wp_prefix, data['wo_db_host'])
|
||||||
+ "--dbuser=\'{0}\' --dbpass= "
|
+ "--dbuser=\'{0}\' --dbpass=\'{1}\' "
|
||||||
"--extra-php<<PHP \n {2} {3} {4}\nPHP\""
|
"--extra-php<<PHP \n {2} {3} \nPHP\""
|
||||||
.format(data['wo_db_user'], data['wo_db_pass'],
|
.format(data['wo_db_user'], data['wo_db_pass'],
|
||||||
"\ndefine(\'WP_ALLOW_MULTISITE\', "
|
|
||||||
"true);",
|
|
||||||
"\ndefine(\'WPMU_ACCEL_REDIRECT\',"
|
"\ndefine(\'WPMU_ACCEL_REDIRECT\',"
|
||||||
" true);",
|
" true);",
|
||||||
"\n\ndefine(\'WP_DEBUG\', false);"))
|
"\n\ndefine(\'WP_DEBUG\', false);"))
|
||||||
try:
|
try:
|
||||||
if WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root"
|
if WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root"
|
||||||
.format(WOVariables.wo_wpcli_path)
|
.format(WOVariables.wo_wpcli_path)
|
||||||
+ " core config "
|
+ " core config "
|
||||||
+ "--dbname=\'{0}\' --dbprefix=\'{1}\' "
|
+ "--dbname=\'{0}\' --dbprefix=\'{1}\' "
|
||||||
"--dbhost=\'{2}\' "
|
"--dbhost=\'{2}\' "
|
||||||
.format(data['wo_db_name'], wo_wp_prefix,
|
.format(data['wo_db_name'], wo_wp_prefix,
|
||||||
data['wo_db_host'])
|
data['wo_db_host'])
|
||||||
+ "--dbuser=\'{0}\' --dbpass=\'{1}\' "
|
+ "--dbuser=\'{0}\' --dbpass=\'{1}\' "
|
||||||
"--extra-php<<PHP \n {2} {3} {4} {redissalt}\nPHP\""
|
"--extra-php<<PHP \n {2} {3} {redissalt}\nPHP\""
|
||||||
.format(data['wo_db_user'],
|
.format(data['wo_db_user'],
|
||||||
data['wo_db_pass'],
|
data['wo_db_pass'],
|
||||||
"\ndefine(\'WP_ALLOW_MULTISITE\', "
|
"\ndefine(\'WPMU_ACCEL_REDIRECT\',"
|
||||||
"true);",
|
" true);",
|
||||||
"\ndefine(\'WPMU_ACCEL_REDIRECT\',"
|
"\n\ndefine(\'WP_DEBUG\', false);",
|
||||||
" true);",
|
redissalt="\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );"
|
||||||
"\n\ndefine(\'WP_DEBUG\', false);",
|
.format(wo_domain_name) if data['wpredis']
|
||||||
redissalt="\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );"
|
else ''),
|
||||||
.format(wo_domain_name) if data['wpredis']
|
log=False
|
||||||
else ''),
|
):
|
||||||
log=False
|
|
||||||
):
|
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise SiteError("generate wp-config failed for wp multi site")
|
raise SiteError("generate wp-config failed for wp multi site")
|
||||||
except CommandExecutionError as e:
|
except CommandExecutionError as e:
|
||||||
raise SiteError("generate wp-config failed for wp multi site")
|
raise SiteError("generate wp-config failed for wp multi site")
|
||||||
|
|
||||||
#WOFileUtils.mvfile(self, os.getcwd()+'/wp-config.php',
|
# WOFileUtils.mvfile(self, os.getcwd()+'/wp-config.php',
|
||||||
# os.path.abspath(os.path.join(os.getcwd(), os.pardir)))
|
# os.path.abspath(os.path.join(os.getcwd(), os.pardir)))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
Log.debug(self, "Moving file from {0} to {1}".format(os.getcwd()+'/wp-config.php',os.path.abspath(os.path.join(os.getcwd(), os.pardir))))
|
Log.debug(self, "Moving file from {0} to {1}".format(os.getcwd()+'/wp-config.php', os.path.abspath(os.path.join(os.getcwd(), os.pardir))))
|
||||||
shutil.move(os.getcwd()+'/wp-config.php',os.path.abspath(os.path.join(os.getcwd(), os.pardir)))
|
shutil.move(os.getcwd()+'/wp-config.php', os.path.abspath(os.path.join(os.getcwd(), os.pardir)))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Log.error(self, 'Unable to move file from {0} to {1}'
|
Log.error(self, 'Unable to move file from {0} to {1}'
|
||||||
.format(os.getcwd()+'/wp-config.php', os.path.abspath(os.path.join(os.getcwd(), os.pardir))),False)
|
.format(os.getcwd()+'/wp-config.php', os.path.abspath(os.path.join(os.getcwd(), os.pardir))), False)
|
||||||
raise SiteError("Unable to move wp-config.php")
|
raise SiteError("Unable to move wp-config.php")
|
||||||
|
|
||||||
|
|
||||||
if not wo_wp_user:
|
if not wo_wp_user:
|
||||||
wo_wp_user = WOVariables.wo_user
|
wo_wp_user = WOVariables.wo_user
|
||||||
while not wo_wp_user:
|
while not wo_wp_user:
|
||||||
@@ -577,6 +571,7 @@ def uninstallwp_plugin(self, plugin_name, data):
|
|||||||
except CommandExecutionError as e:
|
except CommandExecutionError as e:
|
||||||
raise SiteError("plugin uninstall failed")
|
raise SiteError("plugin uninstall failed")
|
||||||
|
|
||||||
|
|
||||||
def setupwp_plugin(self, plugin_name, plugin_option, plugin_data, data):
|
def setupwp_plugin(self, plugin_name, plugin_option, plugin_data, data):
|
||||||
wo_site_webroot = data['webroot']
|
wo_site_webroot = data['webroot']
|
||||||
Log.info(self, "Setting plugin {0}, please wait..."
|
Log.info(self, "Setting plugin {0}, please wait..."
|
||||||
@@ -623,7 +618,7 @@ def sitebackup(self, data):
|
|||||||
.format(data['site_name']), backup_path)
|
.format(data['site_name']), backup_path)
|
||||||
|
|
||||||
if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']:
|
if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']:
|
||||||
if data['php72'] is True and not data['wp']:
|
if data['php73'] is True and not data['wp']:
|
||||||
Log.info(self, "Backing up Webroot \t\t", end='')
|
Log.info(self, "Backing up Webroot \t\t", end='')
|
||||||
WOFileUtils.copyfiles(self, wo_site_webroot + '/htdocs', backup_path + '/htdocs')
|
WOFileUtils.copyfiles(self, wo_site_webroot + '/htdocs', backup_path + '/htdocs')
|
||||||
Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
|
Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
|
||||||
@@ -634,7 +629,7 @@ def sitebackup(self, data):
|
|||||||
|
|
||||||
configfiles = glob.glob(wo_site_webroot + '/*-config.php')
|
configfiles = glob.glob(wo_site_webroot + '/*-config.php')
|
||||||
if not configfiles:
|
if not configfiles:
|
||||||
#search for wp-config.php inside htdocs/
|
# search for wp-config.php inside htdocs/
|
||||||
Log.debug(self, "Config files not found in {0}/ "
|
Log.debug(self, "Config files not found in {0}/ "
|
||||||
.format(wo_site_webroot))
|
.format(wo_site_webroot))
|
||||||
if data['currsitetype'] in ['mysql']:
|
if data['currsitetype'] in ['mysql']:
|
||||||
@@ -663,7 +658,7 @@ def sitebackup(self, data):
|
|||||||
Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
|
Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
|
||||||
# move wp-config.php/wo-config.php to backup
|
# move wp-config.php/wo-config.php to backup
|
||||||
if data['currsitetype'] in ['mysql', 'proxy']:
|
if data['currsitetype'] in ['mysql', 'proxy']:
|
||||||
if data['php72'] is True and not data['wp']:
|
if data['php73'] is True and not data['wp']:
|
||||||
WOFileUtils.copyfile(self, configfiles[0], backup_path)
|
WOFileUtils.copyfile(self, configfiles[0], backup_path)
|
||||||
else:
|
else:
|
||||||
WOFileUtils.mvfile(self, configfiles[0], backup_path)
|
WOFileUtils.mvfile(self, configfiles[0], backup_path)
|
||||||
@@ -677,25 +672,25 @@ def site_package_check(self, stype):
|
|||||||
stack = WOStackController()
|
stack = WOStackController()
|
||||||
stack.app = self.app
|
stack.app = self.app
|
||||||
if stype in ['html', 'proxy', 'php', 'mysql', 'wp', 'wpsubdir',
|
if stype in ['html', 'proxy', 'php', 'mysql', 'wp', 'wpsubdir',
|
||||||
'wpsubdomain', 'php72']:
|
'wpsubdomain', 'php73']:
|
||||||
Log.debug(self, "Setting apt_packages variable for Nginx")
|
Log.debug(self, "Setting apt_packages variable for Nginx")
|
||||||
|
|
||||||
# Check if server has nginx-custom package
|
# Check if server has nginx-custom package
|
||||||
if not (WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline')):
|
if not (WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline')):
|
||||||
# check if Server has nginx-plus installed
|
# check if Server has nginx-plus installed
|
||||||
if WOAptGet.is_installed(self, 'nginx-plus'):
|
if WOAptGet.is_installed(self, 'nginx-plus'):
|
||||||
# do something
|
# do something
|
||||||
# do post nginx installation configuration
|
# do post nginx installation configuration
|
||||||
Log.info(self, "NGINX PLUS Detected ...")
|
Log.info(self, "NGINX PLUS Detected ...")
|
||||||
apt = ["nginx-plus"] + WOVariables.wo_nginx
|
apt = ["nginx-plus"] + WOVariables.wo_nginx
|
||||||
#apt_packages = apt_packages + WOVariables.wo_nginx
|
# apt_packages = apt_packages + WOVariables.wo_nginx
|
||||||
stack.post_pref(apt, packages)
|
stack.post_pref(apt, packages)
|
||||||
elif WOAptGet.is_installed(self, 'nginx'):
|
elif WOAptGet.is_installed(self, 'nginx'):
|
||||||
Log.info(self, "WordOps detected a previously installed Nginx package. "
|
Log.info(self, "WordOps detected a previously installed Nginx package. "
|
||||||
"It may or may not have required modules. "
|
"It may or may not have required modules. "
|
||||||
"\nIf you need help, please create an issue at https://github.com/WordOps/WordOps/issues/ \n")
|
"\nIf you need help, please create an issue at https://github.com/WordOps/WordOps/issues/ \n")
|
||||||
apt = ["nginx"] + WOVariables.wo_nginx
|
apt = ["nginx"] + WOVariables.wo_nginx
|
||||||
#apt_packages = apt_packages + WOVariables.wo_nginx
|
# apt_packages = apt_packages + WOVariables.wo_nginx
|
||||||
stack.post_pref(apt, packages)
|
stack.post_pref(apt, packages)
|
||||||
else:
|
else:
|
||||||
apt_packages = apt_packages + WOVariables.wo_nginx
|
apt_packages = apt_packages + WOVariables.wo_nginx
|
||||||
@@ -708,22 +703,28 @@ def site_package_check(self, stype):
|
|||||||
wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
|
wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
|
||||||
'\t$request_filename;\n')
|
'\t$request_filename;\n')
|
||||||
|
|
||||||
if self.app.pargs.php and self.app.pargs.php72:
|
if self.app.pargs.php and self.app.pargs.php73:
|
||||||
Log.error(self,"Error: two different PHP versions cannot be combined within the same WordOps site")
|
Log.error(self, "Error: two different PHP versions cannot be combined within the same WordOps site")
|
||||||
|
|
||||||
if not self.app.pargs.php72 and stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
if not self.app.pargs.php73 and stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||||
Log.debug(self, "Setting apt_packages variable for PHP")
|
|
||||||
apt_packages = apt_packages + WOVariables.wo_php72 + WOVariables.wo_php_extra
|
|
||||||
|
|
||||||
if self.app.pargs.php72 and stype in [ 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||||
Log.debug(self, "Setting apt_packages variable for PHP 7.2")
|
Log.debug(self, "Setting apt_packages variable for PHP 7.2")
|
||||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_php72 + WOVariables.wo_php_extra
|
apt_packages = apt_packages + WOVariables.wo_php + WOVariables.wo_php_extra
|
||||||
else:
|
else:
|
||||||
Log.debug(self, "Setting apt_packages variable for PHP 7.2")
|
Log.debug(self, "Setting apt_packages variable for PHP 7.2")
|
||||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_php72
|
apt_packages = apt_packages + WOVariables.wo_php
|
||||||
|
|
||||||
|
if self.app.pargs.php73 and stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||||
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||||
|
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
||||||
|
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
apt_packages = apt_packages + WOVariables.wo_php73 + WOVariables.wo_php_extra
|
||||||
|
else:
|
||||||
|
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
||||||
|
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
apt_packages = apt_packages + WOVariables.wo_php73
|
||||||
|
|
||||||
if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||||
Log.debug(self, "Setting apt_packages variable for MySQL")
|
Log.debug(self, "Setting apt_packages variable for MySQL")
|
||||||
@@ -736,24 +737,24 @@ def site_package_check(self, stype):
|
|||||||
|
|
||||||
if stype in ['wp', 'wpsubdir', 'wpsubdomain']:
|
if stype in ['wp', 'wpsubdir', 'wpsubdomain']:
|
||||||
Log.debug(self, "Setting packages variable for WP-CLI")
|
Log.debug(self, "Setting packages variable for WP-CLI")
|
||||||
if not WOShellExec.cmd_exec(self, "which wp"):
|
if not WOShellExec.cmd_exec(self, "command -v wp"):
|
||||||
packages = packages + [["https://github.com/wp-cli/wp-cli/"
|
packages = packages + [["https://github.com/wp-cli/wp-cli/"
|
||||||
"releases/download/v{0}/"
|
"releases/download/v{0}/"
|
||||||
"wp-cli-{0}.phar"
|
"wp-cli-{0}.phar"
|
||||||
.format(WOVariables.wo_wp_cli),
|
.format(WOVariables.wo_wp_cli),
|
||||||
"/usr/bin/wp", "WP-CLI"]]
|
"/usr/local/bin/wp", "WP-CLI"]]
|
||||||
if self.app.pargs.wpredis:
|
if self.app.pargs.wpredis:
|
||||||
Log.debug(self, "Setting apt_packages variable for redis")
|
Log.debug(self, "Setting apt_packages variable for redis")
|
||||||
if not WOAptGet.is_installed(self, 'redis-server'):
|
if not WOAptGet.is_installed(self, 'redis-server'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_redis
|
apt_packages = apt_packages + WOVariables.wo_redis
|
||||||
|
|
||||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
||||||
os.path.isfile("/etc/nginx/common/redis.conf")):
|
os.path.isfile("/etc/nginx/common/redis-php72.conf")):
|
||||||
|
|
||||||
data = dict()
|
data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/redis.conf')
|
'file /etc/nginx/common/redis-php72.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/redis.conf',
|
wo_nginx = open('/etc/nginx/common/redis-php72.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'redis.mustache',
|
self.app.render((data), 'redis.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
@@ -830,63 +831,65 @@ def site_package_check(self, stype):
|
|||||||
hhvm_file.write("upstream hhvm {\nserver 127.0.0.1:8000;\n"
|
hhvm_file.write("upstream hhvm {\nserver 127.0.0.1:8000;\n"
|
||||||
"server 127.0.0.1:9000 backup;\n}\n")
|
"server 127.0.0.1:9000 backup;\n}\n")
|
||||||
|
|
||||||
if self.app.pargs.php72:
|
if self.app.pargs.php73:
|
||||||
if (WOVariables.wo_platform_codename == 'wheezy' or WOVariables.wo_platform_codename == 'precise'):
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||||
Log.error(self,"PHP 7.0 is not supported in your Platform")
|
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
||||||
|
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
Log.debug(self, "Setting apt_packages variable for PHP 7.0")
|
apt_packages = apt_packages + WOVariables.wo_php73 + WOVariables.wo_php_extra
|
||||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
else:
|
||||||
apt_packages = apt_packages + WOVariables.wo_php72 + WOVariables.wo_php_extra
|
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
||||||
|
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
apt_packages = apt_packages + WOVariables.wo_php73
|
||||||
|
|
||||||
if os.path.isdir("/etc/nginx/common") and (not
|
if os.path.isdir("/etc/nginx/common") and (not
|
||||||
os.path.isfile("/etc/nginx/common/php7.conf")):
|
os.path.isfile("/etc/nginx/common/php73.conf")):
|
||||||
data = dict()
|
data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/locations-php7.conf')
|
'file /etc/nginx/common/locations-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/locations-php7.conf',
|
wo_nginx = open('/etc/nginx/common/locations-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'locations-php7.mustache',
|
self.app.render((data), 'locations-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/php7.conf')
|
'file /etc/nginx/common/php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/php7.conf',
|
wo_nginx = open('/etc/nginx/common/php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'php7.mustache',
|
self.app.render((data), 'php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpcommon-php7.conf')
|
'file /etc/nginx/common/wpcommon-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpcommon-php7.conf',
|
wo_nginx = open('/etc/nginx/common/wpcommon-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpcommon-php7.mustache',
|
self.app.render((data), 'wpcommon-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpfc-php7.conf')
|
'file /etc/nginx/common/wpfc-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpfc-php7.conf',
|
wo_nginx = open('/etc/nginx/common/wpfc-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpfc-php7.mustache',
|
self.app.render((data), 'wpfc-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpsc-php7.conf')
|
'file /etc/nginx/common/wpsc-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpsc-php7.conf',
|
wo_nginx = open('/etc/nginx/common/wpsc-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpsc-php7.mustache',
|
self.app.render((data), 'wpsc-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
||||||
os.path.isfile("/etc/nginx/common/redis-php7.conf")):
|
os.path.isfile("/etc/nginx/common/redis-php73.conf")):
|
||||||
data = dict()
|
data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/redis-php7.conf')
|
'file /etc/nginx/common/redis-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/redis-php7.conf',
|
wo_nginx = open('/etc/nginx/common/redis-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'redis-php7.mustache',
|
self.app.render((data), 'redis-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
@@ -894,10 +897,10 @@ def site_package_check(self, stype):
|
|||||||
|
|
||||||
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
|
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
|
||||||
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf",
|
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf",
|
||||||
"php72"):
|
"php73"):
|
||||||
with open("/etc/nginx/conf.d/upstream.conf", "a") as php_file:
|
with open("/etc/nginx/conf.d/upstream.conf", "a") as php_file:
|
||||||
php_file.write("upstream php72 {\nserver 127.0.0.1:9072;\n}\n"
|
php_file.write("upstream php73 {\nserver unix:/var/run/php/php73-fpm.sock;\n}\n"
|
||||||
"upstream debug72 {\nserver 127.0.0.1:9172;\n}\n")
|
"upstream debug73 {\nserver 127.0.0.1:9173;\n}\n")
|
||||||
|
|
||||||
return(stack.install(apt_packages=apt_packages, packages=packages,
|
return(stack.install(apt_packages=apt_packages, packages=packages,
|
||||||
disp_msg=False))
|
disp_msg=False))
|
||||||
@@ -1032,7 +1035,7 @@ def detSitePar(opts):
|
|||||||
cachelist = list()
|
cachelist = list()
|
||||||
for key, val in opts.items():
|
for key, val in opts.items():
|
||||||
if val and key in ['html', 'php', 'mysql', 'wp',
|
if val and key in ['html', 'php', 'mysql', 'wp',
|
||||||
'wpsubdir', 'wpsubdomain','php72']:
|
'wpsubdir', 'wpsubdomain','php73']:
|
||||||
typelist.append(key)
|
typelist.append(key)
|
||||||
elif val and key in ['wpfc', 'wpsc', 'wpredis']:
|
elif val and key in ['wpfc', 'wpsc', 'wpredis']:
|
||||||
cachelist.append(key)
|
cachelist.append(key)
|
||||||
@@ -1046,7 +1049,7 @@ def detSitePar(opts):
|
|||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
else:
|
else:
|
||||||
cachetype = cachelist[0]
|
cachetype = cachelist[0]
|
||||||
elif False not in [x in ('php72','mysql','html') for x in typelist]:
|
elif False not in [x in ('php73','mysql','html') for x in typelist]:
|
||||||
sitetype = 'mysql'
|
sitetype = 'mysql'
|
||||||
if not cachelist:
|
if not cachelist:
|
||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
@@ -1058,7 +1061,7 @@ def detSitePar(opts):
|
|||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
else:
|
else:
|
||||||
cachetype = cachelist[0]
|
cachetype = cachelist[0]
|
||||||
elif False not in [x in ('php72','mysql') for x in typelist]:
|
elif False not in [x in ('php73','mysql') for x in typelist]:
|
||||||
sitetype = 'mysql'
|
sitetype = 'mysql'
|
||||||
if not cachelist:
|
if not cachelist:
|
||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
@@ -1076,8 +1079,8 @@ def detSitePar(opts):
|
|||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
else:
|
else:
|
||||||
cachetype = cachelist[0]
|
cachetype = cachelist[0]
|
||||||
elif False not in [x in ('php72','html') for x in typelist]:
|
elif False not in [x in ('php73','html') for x in typelist]:
|
||||||
sitetype = 'php72'
|
sitetype = 'php73'
|
||||||
if not cachelist:
|
if not cachelist:
|
||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
else:
|
else:
|
||||||
@@ -1094,19 +1097,19 @@ def detSitePar(opts):
|
|||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
else:
|
else:
|
||||||
cachetype = cachelist[0]
|
cachetype = cachelist[0]
|
||||||
elif False not in [x in ('wp','php72') for x in typelist]:
|
elif False not in [x in ('wp','php73') for x in typelist]:
|
||||||
sitetype = 'wp'
|
sitetype = 'wp'
|
||||||
if not cachelist:
|
if not cachelist:
|
||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
else:
|
else:
|
||||||
cachetype = cachelist[0]
|
cachetype = cachelist[0]
|
||||||
elif False not in [x in ('wpsubdir','php72') for x in typelist]:
|
elif False not in [x in ('wpsubdir','php73') for x in typelist]:
|
||||||
sitetype = 'wpsubdir'
|
sitetype = 'wpsubdir'
|
||||||
if not cachelist:
|
if not cachelist:
|
||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
else:
|
else:
|
||||||
cachetype = cachelist[0]
|
cachetype = cachelist[0]
|
||||||
elif False not in [x in ('wpsubdomain','php72') for x in typelist]:
|
elif False not in [x in ('wpsubdomain','php73') for x in typelist]:
|
||||||
sitetype = 'wpsubdomain'
|
sitetype = 'wpsubdomain'
|
||||||
if not cachelist:
|
if not cachelist:
|
||||||
cachetype = 'basic'
|
cachetype = 'basic'
|
||||||
@@ -1118,7 +1121,7 @@ def detSitePar(opts):
|
|||||||
if not typelist and not cachelist:
|
if not typelist and not cachelist:
|
||||||
sitetype = None
|
sitetype = None
|
||||||
cachetype = None
|
cachetype = None
|
||||||
elif (not typelist or "php72" in typelist) and cachelist:
|
elif (not typelist or "php73" in typelist) and cachelist:
|
||||||
sitetype = 'wp'
|
sitetype = 'wp'
|
||||||
cachetype = cachelist[0]
|
cachetype = cachelist[0]
|
||||||
elif typelist and (not cachelist):
|
elif typelist and (not cachelist):
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -56,21 +56,21 @@ class WOStackMigrateController(CementBaseController):
|
|||||||
% e)
|
% e)
|
||||||
|
|
||||||
Log.debug(self, "Pre-seeding MariaDB")
|
Log.debug(self, "Pre-seeding MariaDB")
|
||||||
Log.debug(self, "echo \"mariadb-server-10.0 "
|
Log.debug(self, "echo \"mariadb-server-10.3 "
|
||||||
"mysql-server/root_password "
|
"mysql-server/root_password "
|
||||||
"password \" | "
|
"password \" | "
|
||||||
"debconf-set-selections")
|
"debconf-set-selections")
|
||||||
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.0 "
|
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.3 "
|
||||||
"mysql-server/root_password "
|
"mysql-server/root_password "
|
||||||
"password {chars}\" | "
|
"password {chars}\" | "
|
||||||
"debconf-set-selections"
|
"debconf-set-selections"
|
||||||
.format(chars=chars),
|
.format(chars=chars),
|
||||||
log=False)
|
log=False)
|
||||||
Log.debug(self, "echo \"mariadb-server-10.0 "
|
Log.debug(self, "echo \"mariadb-server-10.3 "
|
||||||
"mysql-server/root_password_again "
|
"mysql-server/root_password_again "
|
||||||
"password \" | "
|
"password \" | "
|
||||||
"debconf-set-selections")
|
"debconf-set-selections")
|
||||||
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.0 "
|
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.3 "
|
||||||
"mysql-server/root_password_again "
|
"mysql-server/root_password_again "
|
||||||
"password {chars}\" | "
|
"password {chars}\" | "
|
||||||
"debconf-set-selections"
|
"debconf-set-selections"
|
||||||
|
|||||||
@@ -13,59 +13,49 @@ class WOStackStatusController(CementBaseController):
|
|||||||
stacked_type = 'embedded'
|
stacked_type = 'embedded'
|
||||||
description = 'Check the stack status'
|
description = 'Check the stack status'
|
||||||
arguments = [
|
arguments = [
|
||||||
(['--memcache'],
|
(['--memcached'],
|
||||||
dict(help='start/stop/restart memcache', action='store_true')),
|
dict(help='start/stop/restart memcached', action='store_true')),
|
||||||
]
|
]
|
||||||
|
|
||||||
@expose(help="Start stack services")
|
@expose(help="Start stack services")
|
||||||
def start(self):
|
def start(self):
|
||||||
"""Start services"""
|
"""Start services"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
|
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||||
or self.app.pargs.redis):
|
or self.app.pargs.redis):
|
||||||
self.app.pargs.nginx = True
|
self.app.pargs.nginx = True
|
||||||
self.app.pargs.php = True
|
self.app.pargs.php = True
|
||||||
self.app.pargs.mysql = True
|
self.app.pargs.mysql = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if self.app.pargs.nginx:
|
||||||
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
|
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if self.app.pargs.php:
|
||||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
if WOAptGet.is_installed(self, 'php5-fpm'):
|
services = services + ['php7.2-fpm']
|
||||||
services = services + ['php5-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP5-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
if WOAptGet.is_installed(self, 'php5.6-fpm'):
|
Log.info(self, "PHP7.2-FPM is not installed")
|
||||||
services = services + ['php5.6-fpm']
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
else:
|
services = services + ['php7.3-fpm']
|
||||||
Log.info(self, "PHP5.6-FPM is not installed")
|
|
||||||
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
|
||||||
services = services + ['php7.2-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
|
|
||||||
if self.app.pargs.php7:
|
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
|
||||||
services = services + ['php7.2-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Your platform does not support PHP 7")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
|
if self.app.pargs.php73:
|
||||||
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
services = services + ['php7.3-fpm']
|
||||||
|
else:
|
||||||
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if self.app.pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if (WOAptGet.is_installed(self, 'mysql-server') or
|
if (WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
||||||
WOAptGet.is_installed(self, 'mariadb-server')):
|
WOAptGet.is_installed(self, 'mariadb-server')):
|
||||||
services = services + ['mysql']
|
services = services + ['mysql']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "MySQL is not installed")
|
Log.info(self, "MySQL is not installed")
|
||||||
@@ -78,11 +68,11 @@ class WOStackStatusController(CementBaseController):
|
|||||||
services = services + ['hhvm']
|
services = services + ['hhvm']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "HHVM is not installed")
|
Log.info(self, "HHVM is not installed")
|
||||||
if self.app.pargs.memcache:
|
if self.app.pargs.memcached:
|
||||||
if WOAptGet.is_installed(self, 'memcached'):
|
if WOAptGet.is_installed(self, 'memcached'):
|
||||||
services = services + ['memcached']
|
services = services + ['memcached']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Memcache is not installed")
|
Log.info(self, "Memcached is not installed")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if self.app.pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
@@ -98,51 +88,42 @@ class WOStackStatusController(CementBaseController):
|
|||||||
def stop(self):
|
def stop(self):
|
||||||
"""Stop services"""
|
"""Stop services"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
|
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||||
or self.app.pargs.redis):
|
or self.app.pargs.redis):
|
||||||
self.app.pargs.nginx = True
|
self.app.pargs.nginx = True
|
||||||
self.app.pargs.php = True
|
self.app.pargs.php = True
|
||||||
self.app.pargs.mysql = True
|
self.app.pargs.mysql = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if self.app.pargs.nginx:
|
||||||
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
|
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if self.app.pargs.php:
|
||||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
if WOAptGet.is_installed(self, 'php5-fpm'):
|
services = services + ['php7.2-fpm']
|
||||||
services = services + ['php5-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP5-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
if WOAptGet.is_installed(self, 'php5.6-fpm'):
|
Log.info(self, "PHP7.2-FPM is not installed")
|
||||||
services = services + ['php5.6-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP5.6-FPM is not installed")
|
|
||||||
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
services = services + ['php7.2-fpm']
|
services = services + ['php7.3-fpm']
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
|
|
||||||
if self.app.pargs.php7:
|
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
|
||||||
services = services + ['php7.2-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Your platform does not support PHP 7")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
|
if self.app.pargs.php73:
|
||||||
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
services = services + ['php7.3-fpm']
|
||||||
|
else:
|
||||||
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if self.app.pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if (WOAptGet.is_installed(self, 'mysql-server') or
|
if (WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
||||||
WOAptGet.is_installed(self, 'mariadb-server')):
|
WOAptGet.is_installed(self, 'mariadb-server')):
|
||||||
services = services + ['mysql']
|
services = services + ['mysql']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "MySQL is not installed")
|
Log.info(self, "MySQL is not installed")
|
||||||
@@ -155,11 +136,11 @@ class WOStackStatusController(CementBaseController):
|
|||||||
services = services + ['hhvm']
|
services = services + ['hhvm']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "HHVM is not installed")
|
Log.info(self, "HHVM is not installed")
|
||||||
if self.app.pargs.memcache:
|
if self.app.pargs.memcached:
|
||||||
if WOAptGet.is_installed(self, 'memcached'):
|
if WOAptGet.is_installed(self, 'memcached'):
|
||||||
services = services + ['memcached']
|
services = services + ['memcached']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Memcache is not installed")
|
Log.info(self, "Memcached is not installed")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if self.app.pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
@@ -175,52 +156,42 @@ class WOStackStatusController(CementBaseController):
|
|||||||
def restart(self):
|
def restart(self):
|
||||||
"""Restart services"""
|
"""Restart services"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
|
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||||
or self.app.pargs.redis):
|
or self.app.pargs.redis):
|
||||||
self.app.pargs.nginx = True
|
self.app.pargs.nginx = True
|
||||||
self.app.pargs.php = True
|
self.app.pargs.php = True
|
||||||
self.app.pargs.mysql = True
|
self.app.pargs.mysql = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if self.app.pargs.nginx:
|
||||||
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
|
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if self.app.pargs.php:
|
||||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
if WOAptGet.is_installed(self, 'php5-fpm'):
|
services = services + ['php7.2-fpm']
|
||||||
services = services + ['php5-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP5-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
if WOAptGet.is_installed(self, 'php5.6-fpm'):
|
Log.info(self, "PHP7.2-FPM is not installed")
|
||||||
services = services + ['php5.6-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP5.6-FPM is not installed")
|
|
||||||
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
services = services + ['php7.2-fpm']
|
services = services + ['php7.3-fpm']
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
|
|
||||||
if self.app.pargs.php7:
|
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
|
||||||
services = services + ['php7.2-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Your platform does not support PHP 7")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
|
if self.app.pargs.php73:
|
||||||
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
services = services + ['php7.3-fpm']
|
||||||
|
else:
|
||||||
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if self.app.pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if (WOAptGet.is_installed(self, 'mysql-server') or
|
if (WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
||||||
WOAptGet.is_installed(self, 'mariadb-server')):
|
WOAptGet.is_installed(self, 'mariadb-server')):
|
||||||
services = services + ['mysql']
|
services = services + ['mysql']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "MySQL is not installed")
|
Log.info(self, "MySQL is not installed")
|
||||||
@@ -233,11 +204,11 @@ class WOStackStatusController(CementBaseController):
|
|||||||
services = services + ['hhvm']
|
services = services + ['hhvm']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "HHVM is not installed")
|
Log.info(self, "HHVM is not installed")
|
||||||
if self.app.pargs.memcache:
|
if self.app.pargs.memcached:
|
||||||
if WOAptGet.is_installed(self, 'memcached'):
|
if WOAptGet.is_installed(self, 'memcached'):
|
||||||
services = services + ['memcached']
|
services = services + ['memcached']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Memcache is not installed")
|
Log.info(self, "Memcached is not installed")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if self.app.pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
@@ -253,8 +224,8 @@ class WOStackStatusController(CementBaseController):
|
|||||||
def status(self):
|
def status(self):
|
||||||
"""Status of services"""
|
"""Status of services"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
|
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||||
or self.app.pargs.redis):
|
or self.app.pargs.redis):
|
||||||
self.app.pargs.nginx = True
|
self.app.pargs.nginx = True
|
||||||
self.app.pargs.php = True
|
self.app.pargs.php = True
|
||||||
@@ -262,43 +233,34 @@ class WOStackStatusController(CementBaseController):
|
|||||||
self.app.pargs.hhvm = True
|
self.app.pargs.hhvm = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if self.app.pargs.nginx:
|
||||||
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
|
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if self.app.pargs.php:
|
||||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
if WOAptGet.is_installed(self, 'php5-fpm'):
|
services = services + ['php7.2-fpm']
|
||||||
services = services + ['php5-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP5-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
if WOAptGet.is_installed(self, 'php5.6-fpm'):
|
Log.info(self, "PHP7.2-FPM is not installed")
|
||||||
services = services + ['php5.6-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP5.6-FPM is not installed")
|
|
||||||
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
services = services + ['php7.2-fpm']
|
services = services + ['php7.3-fpm']
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
|
|
||||||
if self.app.pargs.php7:
|
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
|
||||||
services = services + ['php7.2-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Your platform does not support PHP 7")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
|
if self.app.pargs.php73:
|
||||||
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
services = services + ['php7.3-fpm']
|
||||||
|
else:
|
||||||
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if self.app.pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if (WOAptGet.is_installed(self, 'mysql-server') or
|
if (WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
||||||
WOAptGet.is_installed(self, 'mariadb-server')):
|
WOAptGet.is_installed(self, 'mariadb-server')):
|
||||||
services = services + ['mysql']
|
services = services + ['mysql']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "MySQL is not installed")
|
Log.info(self, "MySQL is not installed")
|
||||||
@@ -311,11 +273,11 @@ class WOStackStatusController(CementBaseController):
|
|||||||
services = services + ['hhvm']
|
services = services + ['hhvm']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "HHVM is not installed")
|
Log.info(self, "HHVM is not installed")
|
||||||
if self.app.pargs.memcache:
|
if self.app.pargs.memcached:
|
||||||
if WOAptGet.is_installed(self, 'memcached'):
|
if WOAptGet.is_installed(self, 'memcached'):
|
||||||
services = services + ['memcached']
|
services = services + ['memcached']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Memcache is not installed")
|
Log.info(self, "Memcached is not installed")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if self.app.pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
@@ -331,51 +293,42 @@ class WOStackStatusController(CementBaseController):
|
|||||||
def reload(self):
|
def reload(self):
|
||||||
"""Reload service"""
|
"""Reload service"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
|
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||||
or self.app.pargs.redis):
|
or self.app.pargs.redis):
|
||||||
self.app.pargs.nginx = True
|
self.app.pargs.nginx = True
|
||||||
self.app.pargs.php = True
|
self.app.pargs.php = True
|
||||||
self.app.pargs.mysql = True
|
self.app.pargs.mysql = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if self.app.pargs.nginx:
|
||||||
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
|
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if self.app.pargs.php:
|
||||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
if WOAptGet.is_installed(self, 'php5-fpm'):
|
services = services + ['php7.2-fpm']
|
||||||
services = services + ['php5-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP5-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
if WOAptGet.is_installed(self, 'php5.6-fpm'):
|
Log.info(self, "PHP7.2-FPM is not installed")
|
||||||
services = services + ['php5.6-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP5.6-FPM is not installed")
|
|
||||||
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
services = services + ['php7.2-fpm']
|
services = services + ['php7.3-fpm']
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
|
|
||||||
if self.app.pargs.php7:
|
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
|
||||||
services = services + ['php7.2-fpm']
|
|
||||||
else:
|
|
||||||
Log.info(self, "PHP7.2-FPM is not installed")
|
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Your platform does not support PHP 7")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
|
if self.app.pargs.php73:
|
||||||
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
|
services = services + ['php7.3-fpm']
|
||||||
|
else:
|
||||||
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if self.app.pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if (WOAptGet.is_installed(self, 'mysql-server') or
|
if (WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
|
||||||
WOAptGet.is_installed(self, 'mariadb-server')):
|
WOAptGet.is_installed(self, 'mariadb-server')):
|
||||||
services = services + ['mysql']
|
services = services + ['mysql']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "MySQL is not installed")
|
Log.info(self, "MySQL is not installed")
|
||||||
@@ -386,11 +339,11 @@ class WOStackStatusController(CementBaseController):
|
|||||||
if self.app.pargs.hhvm:
|
if self.app.pargs.hhvm:
|
||||||
Log.info(self, "HHVM does not support to reload")
|
Log.info(self, "HHVM does not support to reload")
|
||||||
|
|
||||||
if self.app.pargs.memcache:
|
if self.app.pargs.memcached:
|
||||||
if WOAptGet.is_installed(self, 'memcached'):
|
if WOAptGet.is_installed(self, 'memcached'):
|
||||||
services = services + ['memcached']
|
services = services + ['memcached']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Memcache is not installed")
|
Log.info(self, "Memcached is not installed")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if self.app.pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
self.app.pargs.mysql = True
|
self.app.pargs.mysql = True
|
||||||
self.app.pargs.wpcli = True
|
self.app.pargs.wpcli = True
|
||||||
|
|
||||||
if self.app.pargs.nginx :
|
if self.app.pargs.nginx:
|
||||||
if WOAptGet.is_installed(self, 'nginx-custom'):
|
if WOAptGet.is_installed(self, 'nginx-custom'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_nginx
|
apt_packages = apt_packages + WOVariables.wo_nginx
|
||||||
else:
|
else:
|
||||||
@@ -137,12 +137,12 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
Log.info(self, "Redis is not installed")
|
Log.info(self, "Redis is not installed")
|
||||||
|
|
||||||
if self.app.pargs.wpcli:
|
if self.app.pargs.wpcli:
|
||||||
if os.path.isfile('/usr/bin/wp'):
|
if os.path.isfile('/usr/local/bin/wp'):
|
||||||
packages = packages + [["https://github.com/wp-cli/wp-cli/"
|
packages = packages + [["https://github.com/wp-cli/wp-cli/"
|
||||||
"releases/download/v{0}/"
|
"releases/download/v{0}/"
|
||||||
"wp-cli-{0}.phar"
|
"wp-cli-{0}.phar"
|
||||||
"".format(WOVariables.wo_wp_cli),
|
"".format(WOVariables.wo_wp_cli),
|
||||||
"/usr/bin/wp",
|
"/usr/local/bin/wp",
|
||||||
"WP-CLI"]]
|
"WP-CLI"]]
|
||||||
else:
|
else:
|
||||||
Log.info(self, "WPCLI is not installed with WordOps")
|
Log.info(self, "WPCLI is not installed with WordOps")
|
||||||
@@ -178,13 +178,13 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
|
|
||||||
if len(packages):
|
if len(packages):
|
||||||
if self.app.pargs.wpcli:
|
if self.app.pargs.wpcli:
|
||||||
WOFileUtils.remove(self,['/usr/bin/wp'])
|
WOFileUtils.remove(self, ['/usr/local/bin/wp'])
|
||||||
|
|
||||||
Log.debug(self, "Downloading following: {0}".format(packages))
|
Log.debug(self, "Downloading following: {0}".format(packages))
|
||||||
WODownload.download(self, packages)
|
WODownload.download(self, packages)
|
||||||
|
|
||||||
if self.app.pargs.wpcli:
|
if self.app.pargs.wpcli:
|
||||||
WOFileUtils.chmod(self, "/usr/bin/wp", 0o775)
|
WOFileUtils.chmod(self, "/usr/local/bin/wp", 0o775)
|
||||||
|
|
||||||
Log.info(self, "Successfully updated packages")
|
Log.info(self, "Successfully updated packages")
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class WOSyncController(CementBaseController):
|
|||||||
# Read config files
|
# Read config files
|
||||||
configfiles = glob.glob(wo_site_webroot + '/*-config.php')
|
configfiles = glob.glob(wo_site_webroot + '/*-config.php')
|
||||||
|
|
||||||
#search for wp-config.php inside htdocs/
|
# search for wp-config.php inside htdocs/
|
||||||
if not configfiles:
|
if not configfiles:
|
||||||
Log.debug(self, "Config files not found in {0}/ "
|
Log.debug(self, "Config files not found in {0}/ "
|
||||||
.format(wo_site_webroot))
|
.format(wo_site_webroot))
|
||||||
|
|||||||
@@ -39,6 +39,6 @@ server {
|
|||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php;
|
fastcgi_pass php72;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
# FastCGI cache settings
|
# FastCGI cache settings
|
||||||
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:50m inactive=60m;
|
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:50m inactive=60m max_size=256M;
|
||||||
fastcgi_cache_key "$scheme$request_method$host$request_uri";
|
fastcgi_cache_key "$scheme$request_method$host$request_uri";
|
||||||
fastcgi_cache_use_stale error timeout invalid_header updating http_500 http_503;
|
fastcgi_cache_use_stale error timeout invalid_header updating http_500 http_503;
|
||||||
|
fastcgi_cache_methods GET HEAD;
|
||||||
|
fastcgi_cache_background_update on;
|
||||||
fastcgi_cache_valid 200 301 302 404 1h;
|
fastcgi_cache_valid 200 301 302 404 1h;
|
||||||
fastcgi_buffers 16 16k;
|
fastcgi_buffers 16 16k;
|
||||||
fastcgi_buffer_size 32k;
|
fastcgi_buffer_size 32k;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ location = /nginx_status {
|
|||||||
}
|
}
|
||||||
location ~ ^/(status|ping)$ {
|
location ~ ^/(status|ping)$ {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php7;
|
fastcgi_pass php73;
|
||||||
include common/acl.conf;
|
include common/acl.conf;
|
||||||
}
|
}
|
||||||
# WordOps (wo) utilities
|
# WordOps (wo) utilities
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ location = /nginx_status {
|
|||||||
}
|
}
|
||||||
location ~ ^/(status|ping)$ {
|
location ~ ^/(status|ping)$ {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php;
|
fastcgi_pass php72;
|
||||||
include common/acl.conf;
|
include common/acl.conf;
|
||||||
}
|
}
|
||||||
# WordOps (wo) utilities
|
# WordOps (wo) utilities
|
||||||
|
|||||||
55
wo/cli/templates/map-wp.mustache
Normal file
55
wo/cli/templates/map-wp.mustache
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# NGINX CONFIGURATION FOR FASTCGI_CACHE EXCEPTION
|
||||||
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
|
|
||||||
|
# do not cache xhtml request
|
||||||
|
map $http_x_requested_with $http_request_no_cache {
|
||||||
|
default 0;
|
||||||
|
XMLHttpRequest 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# do not cache requests on cookies
|
||||||
|
map $http_cookie $cookie_no_cache {
|
||||||
|
default 0;
|
||||||
|
"~*wordpress_[a-f0-9]+" 1;
|
||||||
|
"~*wp-postpass" 1;
|
||||||
|
"~*wordpress_logged_in" 1;
|
||||||
|
"~*wordpress_no_cache" 1;
|
||||||
|
"~*comment_author" 1;
|
||||||
|
"~*woocommerce_items_in_cart" 1;
|
||||||
|
"~*woocommerce_cart_hash" 1;
|
||||||
|
"~*wptouch_switch_toogle" 1;
|
||||||
|
"~*comment_author_email_" 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# do not cache the following uri
|
||||||
|
map $request_uri $uri_no_cache {
|
||||||
|
default 0;
|
||||||
|
"~*/wp-admin/" 1;
|
||||||
|
"~*/wp-[a-zA-Z0-9-]+.php" 1;
|
||||||
|
"~*/feed/" 1;
|
||||||
|
"~*/index.php" 1;
|
||||||
|
"~*/[a-z0-9_-]+-sitemap([0-9]+)?.xml" 1;
|
||||||
|
"~*/sitemap(_index)?.xml" 1;
|
||||||
|
"~*/wp-comments-popup.php" 1;
|
||||||
|
"~*/wp-links-opml.php" 1;
|
||||||
|
"~*/xmlrpc.php" 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# do not cache requests with query strings
|
||||||
|
map $is_args $query_no_cache {
|
||||||
|
default 1;
|
||||||
|
"" 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
# if all previous check are passed, $skip_cache = 0
|
||||||
|
map $http_request_no_cache$cookie_no_cache$uri_no_cache$query_no_cache $skip_cache {
|
||||||
|
default 1;
|
||||||
|
0000 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
# map $skip_cache with $cache_uri for --wpsc stack
|
||||||
|
map $skip_cache $cache_uri {
|
||||||
|
default 'null cache';
|
||||||
|
0 $request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -6,5 +6,5 @@ location / {
|
|||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php;
|
fastcgi_pass php72;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ location / {
|
|||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php7;
|
fastcgi_pass php73;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,7 @@
|
|||||||
# Redis NGINX CONFIGURATION
|
# Redis NGINX CONFIGURATION
|
||||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
set $skip_cache 0;
|
# $skip_cache variable set in /etc/nginx/conf.d/map-wp.conf
|
||||||
# POST requests and URL with a query string should always go to php
|
|
||||||
if ($request_method = POST) {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
if ($query_string != "") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't cache URL containing the following segments
|
|
||||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
|
||||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php$is_args$args;
|
try_files $uri $uri/ /index.php$is_args$args;
|
||||||
@@ -52,5 +38,5 @@ location ~ \.php$ {
|
|||||||
more_set_headers 'X-SRCache-Store-Status $srcache_store_status';
|
more_set_headers 'X-SRCache-Store-Status $srcache_store_status';
|
||||||
|
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php7;
|
fastcgi_pass php73;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,7 @@
|
|||||||
# Redis NGINX CONFIGURATION
|
# Redis NGINX CONFIGURATION
|
||||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
set $skip_cache 0;
|
# $skip_cache variable set in /etc/nginx/conf.d/map-wp.conf
|
||||||
# POST requests and URL with a query string should always go to php
|
|
||||||
if ($request_method = POST) {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
if ($query_string != "") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't cache URL containing the following segments
|
|
||||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
|
||||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php$is_args$args;
|
try_files $uri $uri/ /index.php$is_args$args;
|
||||||
@@ -53,5 +39,5 @@ location ~ \.php$ {
|
|||||||
more_set_headers 'X-SRCache-Store-Status $srcache_store_status';
|
more_set_headers 'X-SRCache-Store-Status $srcache_store_status';
|
||||||
|
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php;
|
fastcgi_pass php72;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,50 @@
|
|||||||
# Common upstream settings
|
# Common upstream settings
|
||||||
|
|
||||||
|
# PHP 5.6 upstream
|
||||||
upstream php {
|
upstream php {
|
||||||
server 127.0.0.1:9072;
|
server 127.0.0.1:9000;
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream debug {
|
upstream debug {
|
||||||
# Debug Pool
|
# Debug Pool
|
||||||
server 127.0.0.1:9172;
|
server 127.0.0.1:9001;
|
||||||
}
|
}
|
||||||
{{#php7conf}}
|
|
||||||
|
# PHP 7.0 upstream
|
||||||
upstream php7 {
|
upstream php7 {
|
||||||
server 127.0.0.1:9072;
|
server 127.0.0.1:9070;
|
||||||
}
|
}
|
||||||
upstream debug7 {
|
|
||||||
|
# PHP 7.2 upstream with load-balancing on two unix sockets
|
||||||
|
upstream php72 {
|
||||||
|
server unix:/var/run/php/php72-fpm.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
# PHP 7.2 debug
|
||||||
|
upstream debug72 {
|
||||||
# Debug Pool
|
# Debug Pool
|
||||||
server 127.0.0.1:9172;
|
server 127.0.0.1:9172;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# PHP 7.3 upstream with load-balancing on two unix sockets
|
||||||
|
upstream php73 {
|
||||||
|
server unix:/var/run/php/php73-fpm.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#php7conf}}
|
||||||
|
# PHP 7.3 debug
|
||||||
|
upstream debug73 {
|
||||||
|
# Debug Pool
|
||||||
|
server 127.0.0.1:9173;
|
||||||
|
}
|
||||||
{{/php7conf}}
|
{{/php7conf}}
|
||||||
|
|
||||||
|
# Netdata Monitoring Upstream
|
||||||
|
upstream netdata {
|
||||||
|
server 127.0.0.1:19999;
|
||||||
|
keepalive 64;
|
||||||
|
}
|
||||||
|
|
||||||
{{#hhvmconf}}
|
{{#hhvmconf}}
|
||||||
upstream hhvm {
|
upstream hhvm {
|
||||||
# HHVM Pool
|
# HHVM Pool
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ server {
|
|||||||
}
|
}
|
||||||
{{/static}}
|
{{/static}}
|
||||||
|
|
||||||
{{^static}}include {{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}
|
{{^static}}include {{^hhvm}}{{#basic}}common/php73.conf;{{/basic}}{{#wpfc}}common/wpfc-php73.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php73.conf;{{/wpsc}}{{#wpredis}}common/redis-php73.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}
|
||||||
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
|
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
|
||||||
{{#wp}}include common/wpcommon-php7.conf;{{/wp}}
|
{{#wp}}include common/wpcommon-php73.conf;{{/wp}}
|
||||||
{{^proxy}}include common/locations-php7.conf;{{/proxy}}
|
{{^proxy}}include common/locations-php73.conf;{{/proxy}}
|
||||||
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
|
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
|
||||||
{{/proxy}}
|
{{/proxy}}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ server {
|
|||||||
}
|
}
|
||||||
{{/static}}
|
{{/static}}
|
||||||
|
|
||||||
{{^static}}include {{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
|
{{^static}}include {{^hhvm}}{{#basic}}common/php72.conf;{{/basic}}{{#wpfc}}common/wpfc-php72.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php72.conf;{{/wpsc}}{{#wpredis}}common/redis-php72.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
|
||||||
{{#wp}}include common/wpcommon.conf;{{/wp}}
|
{{#wp}}include common/wpcommon-php72.conf;{{/wp}}
|
||||||
{{^proxy}}include common/locations.conf;{{/proxy}}
|
{{^proxy}}include common/locations-php72.conf;{{/proxy}}
|
||||||
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
|
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
|
||||||
{{/proxy}}
|
{{/proxy}}
|
||||||
}
|
}
|
||||||
|
|||||||
7
wo/cli/templates/webp.mustache
Normal file
7
wo/cli/templates/webp.mustache
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# WEBP NGINX CONFIGURATION
|
||||||
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
|
|
||||||
|
map $http_accept $webp_suffix {
|
||||||
|
default "";
|
||||||
|
"~*webp" ".webp";
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
location = /wp-login.php {
|
location = /wp-login.php {
|
||||||
limit_req zone=one burst=1 nodelay;
|
limit_req zone=one burst=1 nodelay;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php7;
|
fastcgi_pass php73;
|
||||||
}
|
}
|
||||||
# Disable wp-config.txt
|
# Disable wp-config.txt
|
||||||
location = /wp-config.txt {
|
location = /wp-config.txt {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
location = /wp-login.php {
|
location = /wp-login.php {
|
||||||
limit_req zone=one burst=1 nodelay;
|
limit_req zone=one burst=1 nodelay;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php;
|
fastcgi_pass php72;
|
||||||
}
|
}
|
||||||
# Disable wp-config.txt
|
# Disable wp-config.txt
|
||||||
location = /wp-config.txt {
|
location = /wp-config.txt {
|
||||||
@@ -25,7 +25,7 @@ location /wp-content/uploads {
|
|||||||
try_files $uri$webp_suffix $uri =404;
|
try_files $uri$webp_suffix $uri =404;
|
||||||
}
|
}
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
#Prevent Direct Access Of PHP Files From Web Browsers
|
#Prevent Direct Access Of PHP Files From Web Browsers
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,7 @@
|
|||||||
# WPFC NGINX CONFIGURATION
|
# WPFC NGINX CONFIGURATION
|
||||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
set $skip_cache 0;
|
# $skip_cache variable set in /etc/nginx/conf.d/map-wp.conf
|
||||||
# POST requests and URL with a query string should always go to php
|
|
||||||
if ($request_method = POST) {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
if ($query_string != "") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't cache URL containing the following segments
|
|
||||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
|
||||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php$is_args$args;
|
try_files $uri $uri/ /index.php$is_args$args;
|
||||||
|
|||||||
@@ -1,32 +1,16 @@
|
|||||||
# WPFC NGINX CONFIGURATION
|
# WPFC NGINX CONFIGURATION
|
||||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
set $skip_cache 0;
|
# $skip_cache variable set in /etc/nginx/conf.d/map-wp.conf
|
||||||
# POST requests and URL with a query string should always go to php
|
|
||||||
if ($request_method = POST) {
|
add_header X-fastcgi-cache $upstream_cache_status;
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
if ($query_string != "") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't cache URL containing the following segments
|
|
||||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
|
||||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php$is_args$args;
|
try_files $uri $uri/ /index.php$is_args$args;
|
||||||
}
|
}
|
||||||
location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ {
|
|
||||||
try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1;
|
|
||||||
}
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php7;
|
fastcgi_pass php73;
|
||||||
fastcgi_cache_bypass $skip_cache;
|
fastcgi_cache_bypass $skip_cache;
|
||||||
fastcgi_no_cache $skip_cache;
|
fastcgi_no_cache $skip_cache;
|
||||||
fastcgi_cache WORDPRESS;
|
fastcgi_cache WORDPRESS;
|
||||||
|
|||||||
@@ -1,32 +1,16 @@
|
|||||||
# WPFC NGINX CONFIGURATION
|
# WPFC NGINX CONFIGURATION
|
||||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
set $skip_cache 0;
|
# $skip_cache variable set in /etc/nginx/conf.d/map-wp.conf
|
||||||
# POST requests and URL with a query string should always go to php
|
|
||||||
if ($request_method = POST) {
|
add_header X-fastcgi-cache $upstream_cache_status;
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
if ($query_string != "") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't cache URL containing the following segments
|
|
||||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
|
||||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
|
||||||
set $skip_cache 1;
|
|
||||||
}
|
|
||||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php$is_args$args;
|
try_files $uri $uri/ /index.php$is_args$args;
|
||||||
}
|
}
|
||||||
location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ {
|
|
||||||
try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1;
|
|
||||||
}
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php;
|
fastcgi_pass php72;
|
||||||
fastcgi_cache_bypass $skip_cache;
|
fastcgi_cache_bypass $skip_cache;
|
||||||
fastcgi_no_cache $skip_cache;
|
fastcgi_no_cache $skip_cache;
|
||||||
fastcgi_cache WORDPRESS;
|
fastcgi_cache WORDPRESS;
|
||||||
|
|||||||
@@ -1,21 +1,7 @@
|
|||||||
# WPSC NGINX CONFIGURATION
|
# WPSC NGINX CONFIGURATION
|
||||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
set $cache_uri $request_uri;
|
# $skip_cache variable set in /etc/nginx/conf.d/map-wp.conf
|
||||||
# POST requests and URL with a query string should always go to php
|
|
||||||
if ($request_method = POST) {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
if ($query_string != "") {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
# Don't cache URL containing the following segments
|
|
||||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
|
||||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||||
location / {
|
location / {
|
||||||
# If we add index.php?$args its break WooCommerce like plugins
|
# If we add index.php?$args its break WooCommerce like plugins
|
||||||
|
|||||||
@@ -1,21 +1,7 @@
|
|||||||
# WPSC NGINX CONFIGURATION
|
# WPSC NGINX CONFIGURATION
|
||||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
set $cache_uri $request_uri;
|
# $cache_uri variable set in /etc/nginx/conf.d/map-wp.conf
|
||||||
# POST requests and URL with a query string should always go to php
|
|
||||||
if ($request_method = POST) {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
if ($query_string != "") {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
# Don't cache URL containing the following segments
|
|
||||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
|
||||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||||
location / {
|
location / {
|
||||||
# If we add index.php?$args its break WooCommerce like plugins
|
# If we add index.php?$args its break WooCommerce like plugins
|
||||||
@@ -25,7 +11,7 @@ location / {
|
|||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php7;
|
fastcgi_pass php73;
|
||||||
# Following line is needed by WP Super Cache plugin
|
# Following line is needed by WP Super Cache plugin
|
||||||
fastcgi_param SERVER_NAME $http_host;
|
fastcgi_param SERVER_NAME $http_host;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,7 @@
|
|||||||
# WPSC NGINX CONFIGURATION
|
# WPSC NGINX CONFIGURATION
|
||||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
set $cache_uri $request_uri;
|
# $cache_uri variable set in /etc/nginx/conf.d/map-wp.conf
|
||||||
# POST requests and URL with a query string should always go to php
|
|
||||||
if ($request_method = POST) {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
if ($query_string != "") {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
# Don't cache URL containing the following segments
|
|
||||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
|
||||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
|
||||||
set $cache_uri 'null cache';
|
|
||||||
}
|
|
||||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||||
location / {
|
location / {
|
||||||
# If we add index.php?$args its break WooCommerce like plugins
|
# If we add index.php?$args its break WooCommerce like plugins
|
||||||
@@ -25,7 +11,7 @@ location / {
|
|||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php;
|
fastcgi_pass php72;
|
||||||
# Following line is needed by WP Super Cache plugin
|
# Following line is needed by WP Super Cache plugin
|
||||||
fastcgi_param SERVER_NAME $http_host;
|
fastcgi_param SERVER_NAME $http_host;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ class WOService():
|
|||||||
Log.info(self, "Reload : {0:10}".format(service_name), end='')
|
Log.info(self, "Reload : {0:10}".format(service_name), end='')
|
||||||
retcode = subprocess.getstatusoutput(service_cmd)
|
retcode = subprocess.getstatusoutput(service_cmd)
|
||||||
if retcode[0] == 0:
|
if retcode[0] == 0:
|
||||||
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
|
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
Log.debug(self, "{0}".format(retcode[1]))
|
Log.debug(self, "{0}".format(retcode[1]))
|
||||||
Log.info(self, "[" + Log.FAIL + "Failed" + Log.OKBLUE+"]")
|
Log.info(self, "[" + Log.FAIL + "Failed" + Log.OKBLUE+"]")
|
||||||
@@ -113,11 +113,10 @@ class WOService():
|
|||||||
|
|
||||||
def get_service_status(self, service_name):
|
def get_service_status(self, service_name):
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
is_exist = subprocess.getstatusoutput('which {0}'
|
is_exist = subprocess.getstatusoutput('which {0}'
|
||||||
.format(service_name))
|
.format(service_name))
|
||||||
if is_exist[0] == 0 or service_name in ['php7.0-fpm', 'php5.6-fpm']:
|
if is_exist[0] == 0 or service_name in ['php7.2-fpm', 'php7.3-fpm']:
|
||||||
retcode = subprocess.getstatusoutput('service {0} status'
|
retcode = subprocess.getstatusoutput('service {0} status'
|
||||||
.format(service_name))
|
.format(service_name))
|
||||||
if retcode[0] == 0:
|
if retcode[0] == 0:
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ class WOVariables():
|
|||||||
wo_adminer = "4.7.1"
|
wo_adminer = "4.7.1"
|
||||||
|
|
||||||
# Get WPCLI path
|
# Get WPCLI path
|
||||||
wo_wpcli_path = os.popen('which wp | tr "\n" " "').read()
|
wo_wpcli_path = os.popen('command -v wp | tr "\n" " "').read()
|
||||||
if wo_wpcli_path == '':
|
if wo_wpcli_path == '':
|
||||||
wo_wpcli_path = '/usr/bin/wp '
|
wo_wpcli_path = '/usr/local/bin/wp '
|
||||||
|
|
||||||
# Current date and time of System
|
# Current date and time of System
|
||||||
wo_date = datetime.datetime.now().strftime('%d%b%Y%H%M%S')
|
wo_date = datetime.datetime.now().strftime('%d%b%Y%H%M%S')
|
||||||
@@ -89,7 +89,7 @@ class WOVariables():
|
|||||||
"/rtCamp:/EasyEngine/xUbuntu_16.04/ /")
|
"/rtCamp:/EasyEngine/xUbuntu_16.04/ /")
|
||||||
elif wo_platform_codename == 'bionic':
|
elif wo_platform_codename == 'bionic':
|
||||||
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
||||||
"/rtCamp:/EasyEngine/xUbuntu_18.04/ /")
|
"/rtCamp:/EasyEngine/xUbuntu_18.04/ /")
|
||||||
elif wo_platform_codename == 'jessie':
|
elif wo_platform_codename == 'jessie':
|
||||||
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
||||||
"/rtCamp:/EasyEngine/Debian_8.0/ /")
|
"/rtCamp:/EasyEngine/Debian_8.0/ /")
|
||||||
@@ -102,42 +102,46 @@ class WOVariables():
|
|||||||
|
|
||||||
# PHP repo and packages
|
# PHP repo and packages
|
||||||
if wo_platform_distro == 'ubuntu':
|
if wo_platform_distro == 'ubuntu':
|
||||||
if (wo_platform_codename == 'trusty' or wo_platform_codename == 'xenial' or wo_platform_codename == 'bionic'):
|
wo_php_repo = "ppa:ondrej/php"
|
||||||
wo_php_repo = "ppa:ondrej/php"
|
|
||||||
wo_php = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
|
|
||||||
"php7.2-readline", "php7.2-common", "php7.2-recode",
|
|
||||||
"php7.2-cli", "php7.2-mbstring",
|
|
||||||
"php7.2-bcmath", "php7.2-mysql", "php7.2-opcache", "php7.2-zip", "php7.2-xml", "php7.2-soap"]
|
|
||||||
wo_php72 = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
|
|
||||||
"php7.2-readline", "php7.2-common", "php7.2-recode",
|
|
||||||
"php7.2-cli", "php7.2-mbstring",
|
|
||||||
"php7.2-bcmath", "php7.2-mysql", "php7.2-opcache", "php7.2-zip", "php7.2-xml", "php7.2-soap"]
|
|
||||||
wo_php_extra = ["php-memcached", "php-imagick", "memcached",
|
|
||||||
"graphviz", "php-pear", "php-xdebug", "php-msgpack", "php-redis"]
|
|
||||||
elif wo_platform_distro == 'debian':
|
|
||||||
wo_php_repo = ("deb https://packages.sury.org/php/ {codename} main".format(codename=wo_platform_codename))
|
|
||||||
wo_php = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
|
wo_php = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
|
||||||
"php-sodium", "php7.2-common", "php7.2-readline", "php7.2-redis",
|
"php7.2-readline", "php7.2-common", "php7.2-recode",
|
||||||
"php7.2-mysql", "php7.2-cli", "php7.2-memcache", "php7.2-imagick",
|
"php7.2-cli", "php7.2-mbstring",
|
||||||
"php7.2-mbstring", "php7.2-recode", "php7.2-bcmath", "php7.2-opcache", "php7.2-zip", "php7.2-xml",
|
"php7.2-bcmath", "php7.2-mysql", "php7.2-opcache",
|
||||||
"php7.2-soap", "php7.2-msgpack",
|
"php7.2-zip", "php7.2-xml", "php7.2-soap"]
|
||||||
"memcached", "graphviz", "php-pear", "php7.2-xdebug"]
|
wo_php73 = ["php7.3-fpm", "php7.3-curl", "php7.3-gd", "php7.3-imap",
|
||||||
wo_php72 = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
|
"php7.3-readline", "php7.3-common", "php7.3-recode",
|
||||||
"php-sodium", "php7.2-common", "php7.2-readline", "php7.2-redis",
|
"php7.3-cli", "php7.3-mbstring",
|
||||||
"php7.2-mysql", "php7.2-cli", "php7.2-memcache", "php7.2-imagick",
|
"php7.3-bcmath", "php7.3-mysql", "php7.3-opcache",
|
||||||
"php7.2-mbstring", "php7.2-recode", "php7.2-bcmath", "php7.2-opcache", "php7.2-zip", "php7.2-xml",
|
"php7.3-zip", "php7.3-xml", "php7.3-soap"]
|
||||||
"php7.2-soap", "php7.2-msgpack",
|
wo_php_extra = ["php-memcached", "php-imagick", "memcached",
|
||||||
"memcached", "graphviz", "php-pear", "php7.2-xdebug"]
|
"graphviz", "php-xdebug", "php-msgpack", "php-redis"]
|
||||||
|
elif wo_platform_distro == 'debian':
|
||||||
|
wo_php_repo = (
|
||||||
|
"deb https://packages.sury.org/php/ {codename} main".format(codename=wo_platform_codename))
|
||||||
|
wo_php = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
|
||||||
|
"php7.2-common", "php7.2-readline", "php-redis",
|
||||||
|
"php7.2-mysql", "php7.2-cli", "php-imagick",
|
||||||
|
"php7.2-mbstring", "php7.2-recode", "php7.2-bcmath",
|
||||||
|
"php7.2-opcache", "php7.2-zip", "php7.2-xml",
|
||||||
|
"php7.2-soap", "php-msgpack",
|
||||||
|
"graphviz", "php-pear", "php-xdebug"]
|
||||||
|
wo_php73 = ["php7.3-fpm", "php7.3-curl", "php7.3-gd", "php7.3-imap",
|
||||||
|
"php7.3-common", "php7.3-readline", "php-redis",
|
||||||
|
"php7.3-mysql", "php7.3-cli", "php-imagick",
|
||||||
|
"php7.3-mbstring", "php7.3-recode", "php7.3-bcmath",
|
||||||
|
"php7.3-opcache", "php7.3-zip", "php7.3-xml",
|
||||||
|
"php7.3-soap", "php-msgpack",
|
||||||
|
"graphviz", "php-pear", "php-xdebug"]
|
||||||
wo_php_extra = []
|
wo_php_extra = []
|
||||||
|
|
||||||
# MySQL repo and packages
|
# MySQL repo and packages
|
||||||
if wo_platform_distro == 'ubuntu':
|
if wo_platform_distro == 'ubuntu':
|
||||||
wo_mysql_repo = ("deb [arch=amd64,i386,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/"
|
wo_mysql_repo = ("deb [arch=amd64,i386,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/"
|
||||||
"10.1/ubuntu {codename} main"
|
"10.3/ubuntu {codename} main"
|
||||||
.format(codename=wo_platform_codename))
|
.format(codename=wo_platform_codename))
|
||||||
elif wo_platform_distro == 'debian':
|
elif wo_platform_distro == 'debian':
|
||||||
wo_mysql_repo = ("deb [arch=amd64,i386,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/"
|
wo_mysql_repo = ("deb [arch=amd64,i386,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/"
|
||||||
"10.1/debian {codename} main"
|
"10.3/debian {codename} main"
|
||||||
.format(codename=wo_platform_codename))
|
.format(codename=wo_platform_codename))
|
||||||
|
|
||||||
wo_mysql = ["mariadb-server", "percona-toolkit"]
|
wo_mysql = ["mariadb-server", "percona-toolkit"]
|
||||||
@@ -146,7 +150,7 @@ class WOVariables():
|
|||||||
if wo_platform_distro == 'ubuntu':
|
if wo_platform_distro == 'ubuntu':
|
||||||
if wo_platform_codename == "trusty" or wo_platform_codename == "xenial" or wo_platform_codename == "bionic":
|
if wo_platform_codename == "trusty" or wo_platform_codename == "xenial" or wo_platform_codename == "bionic":
|
||||||
wo_hhvm_repo = ("deb http://dl.hhvm.com/ubuntu {codename} main"
|
wo_hhvm_repo = ("deb http://dl.hhvm.com/ubuntu {codename} main"
|
||||||
.format(codename=wo_platform_codename))
|
.format(codename=wo_platform_codename))
|
||||||
else:
|
else:
|
||||||
wo_hhvm_repo = ("deb http://dl.hhvm.com/debian {codename} main"
|
wo_hhvm_repo = ("deb http://dl.hhvm.com/debian {codename} main"
|
||||||
.format(codename=wo_platform_codename))
|
.format(codename=wo_platform_codename))
|
||||||
@@ -159,10 +163,9 @@ class WOVariables():
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
wo_redis_repo = ("deb https://packages.sury.org/php/ {codename} all"
|
wo_redis_repo = ("deb https://packages.sury.org/php/ {codename} all"
|
||||||
.format(codename=wo_platform_codename))
|
.format(codename=wo_platform_codename))
|
||||||
|
|
||||||
if (wo_platform_codename == 'trusty' or wo_platform_codename == 'xenial' or wo_platform_codename == 'bionic' or wo_platform_distro == 'debian'):
|
wo_redis = ['redis-server', 'php-redis']
|
||||||
wo_redis = ['redis-server', 'php-redis']
|
|
||||||
|
|
||||||
# Repo path
|
# Repo path
|
||||||
wo_repo_file = "wo-repo.list"
|
wo_repo_file = "wo-repo.list"
|
||||||
|
|||||||
Reference in New Issue
Block a user