Browse Source

Merge branch 'hotfix/v3.2.1'

hotfix/v3.3.3 v3.2.1
gau1991 10 years ago
parent
commit
19f0dac7e3
  1. 5
      CHANGELOG.txt
  2. 6
      README.md
  3. 6
      config/bash_completion.d/ee_auto.rc
  4. 20
      ee/cli/plugins/debug.py
  5. 106
      ee/cli/plugins/site.py
  6. 5
      ee/cli/plugins/site_functions.py
  7. 105
      ee/cli/plugins/stack.py
  8. 2
      ee/cli/templates/upstream.mustache
  9. 2
      ee/core/variables.py
  10. 11
      install
  11. 2
      setup.py

5
CHANGELOG.txt

@ -1,3 +1,8 @@
v 3.2.1 - Jun 19, 205
- Improved experimental HHVM and Pagespeed handling, fixes #564, #562
- Fixed missing link for Proxy sites #571
- Added hhvm.server.ip for HHVM config #567
v 3.2.0 - May 28, 2015
- Now using openSuse builder to build Nginx package for both Ubuntu and Debian
- Minor fixes and improvements

6
README.md

@ -11,9 +11,9 @@ EasyEngine (ee) is a python tool, which makes it easy to manage your wordpress s
- Debian 7 & 8
**Port Requirements:**
- 22/TCP (Inbound/Outbound) : Standerd SSH port
- 80/TCP (Inbound/Outbound) : Standerd HTTP port
- 443/TCP(Inbound/Outbound) : Standerd HTTPS port
- 22/TCP (Inbound/Outbound) : Standard SSH port
- 80/TCP (Inbound/Outbound) : Standard HTTP port
- 443/TCP(Inbound/Outbound) : Standard HTTPS port
- 22222/TCP (Inbound) : To access EasyEngine admin tools
- 11371/TCP (Outbound) : To connect to GPG Key Server

6
config/bash_completion.d/ee_auto.rc

@ -74,7 +74,7 @@ _ee_complete()
# HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE
"install" | "purge" | "remove" )
COMPREPLY=( $(compgen \
-W "--web --admin --mail --nginx --php --mysql --postfix --wpcli --phpmyadmin --adminer --utils --all --mailscanner --hhvm" \
-W "--pagespeed --web --admin --mail --nginx --php --mysql --postfix --wpcli --phpmyadmin --adminer --utils --all --mailscanner --hhvm" \
-- $cur) )
;;
"upgrade" )
@ -235,9 +235,9 @@ _ee_complete()
"--pagespeed" | "--hhvm")
if [ ${COMP_WORDS[2]} == "create" ]; then
retlist="--user --pass --email --html --php --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --pagespeed"
retlist="--user --pass --email --html --php --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --pagespeed --experimenal"
elif [ ${COMP_WORDS[2]} == "update" ]; then
retlist="--password --php --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --hhvm=off --pagespeed --pagespeed=off"
retlist="--password --php --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --hhvm=off --pagespeed --pagespeed=off --experimenal"
else
retlist=""
fi

20
ee/cli/plugins/debug.py

@ -171,8 +171,16 @@ class EEDebugController(CementBaseController):
"{/,/}/p \" /etc/nginx/"
"conf.d/upstream.conf "
"| grep 9001")):
Log.info(self, "Enabling PHP debug")
data = dict(php="9001", debug="9001", hhvm="9001")
# Check HHVM is installed if not instlled then dont not enable
# it in upstream config
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
hhvmconf=True
else:
hhvmconf=False
data = dict(php="9001", debug="9001", hhvm="9001",
hhvmconf=hhvmconf)
Log.debug(self, 'Writting the Nginx debug configration to file'
' /etc/nginx/conf.d/upstream.conf ')
ee_nginx = open('/etc/nginx/conf.d/upstream.conf',
@ -209,6 +217,16 @@ class EEDebugController(CementBaseController):
"/etc/nginx/conf.d/upstream.conf "
"| grep 9001"):
Log.info(self, "Disabling PHP debug")
# Check HHVM is installed if not instlled then dont not enable
# it in upstream config
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
hhvmconf=True
else:
hhvmconf=False
data = dict(php="9001", debug="9001", hhvm="9001",
hhvmconf=hhvmcof)
data = dict(php="9000", debug="9001", hhvm="8000")
Log.debug(self, 'Writting the Nginx debug configration to file'
' /etc/nginx/conf.d/upstream.conf ')

106
ee/cli/plugins/site.py

@ -359,7 +359,10 @@ class EESiteCreateController(CementBaseController):
dict(help="provide password for wordpress user",
dest='wppass')),
(['--proxy'],
dict(help="create proxy for site", nargs='+'))
dict(help="create proxy for site", nargs='+')),
(['--experimental'],
dict(help="Enable Experimenal packages without prompt",
action='store_true')),
]
@expose(hide=True)
@ -461,21 +464,56 @@ class EESiteCreateController(CementBaseController):
Log.error(self, "Can not create HTML site with HHVM")
if data and self.app.pargs.hhvm:
data['hhvm'] = True
hhvm = 1
if (not self.app.pargs.experimental):
Log.info(self, "HHVM is experimental feature and it may not"
"work with all plugins of your site.\nYou can "
"disable it by passing --hhvm=off later.\nDo you wish"
" to enable HHVM now for {0}?".format(ee_domain))
# Check prompt
check_prompt = input("Type \"y\" to continue [n]:")
if check_prompt != "Y" and check_prompt != "y":
Log.info(self, "Not using HHVM for site.")
data['hhvm'] = False
hhvm = 0
self.app.pargs.hhvm = False
else:
data['hhvm'] = True
hhvm = 1
else:
data['hhvm'] = True
hhvm = 1
elif data:
data['hhvm'] = False
hhvm = 0
if data and self.app.pargs.pagespeed:
data['pagespeed'] = True
pagespeed = 1
if (not self.app.pargs.experimental):
Log.info(self, "PageSpeed is experimental feature and it may not"
"work with all CSS/JS/Cache of your site.\nYou can "
"disable it by passing --pagespeed=off later.\nDo you wish"
" to enable PageSpeed now for {0}?".format(ee_domain))
# Check prompt
check_prompt = input("Type \"y\" to continue [n]:")
if check_prompt != "Y" and check_prompt != "y":
Log.info(self, "Not using PageSpeed for site.")
data['pagespeed'] = False
pagespeed = 0
self.app.pargs.pagespeed = False
else:
data['pagespeed'] = True
pagespeed = 1
else:
data['pagespeed'] = True
pagespeed = 1
elif data:
data['pagespeed'] = False
pagespeed = 0
# if not data:
# self.app.args.print_help()
# if not data:
# self.app.close(1)
# Check rerequired packages are installed or not
@ -704,7 +742,10 @@ class EESiteUpdateController(CementBaseController):
action='store' or 'store_const',
choices=('on', 'off'), const='on', nargs='?')),
(['--proxy'],
dict(help="update to prxy site", nargs='+')),
dict(help="update to proxy site", nargs='+')),
(['--experimental'],
dict(help="Enable Experimenal packages without prompt",
action='store_true')),
(['--all'],
dict(help="update all sites", action='store_true')),
]
@ -939,6 +980,7 @@ class EESiteUpdateController(CementBaseController):
elif pagespeed is True:
Log.info(self, "Pagespeed is allready enabled for given "
"site")
pargs.pagespeed = False
if pargs.hhvm:
if hhvm is old_hhvm:
@ -949,6 +991,8 @@ class EESiteUpdateController(CementBaseController):
Log.info(self, "HHVM is allready enabled for given "
"site")
pargs.hhvm = False
if data and (not pargs.hhvm):
if old_hhvm is True:
data['hhvm'] = True
@ -965,10 +1009,50 @@ class EESiteUpdateController(CementBaseController):
data['pagespeed'] = False
pagespeed = False
if pargs.pagespeed or pargs.hhvm:
if ((hhvm is old_hhvm) and (pagespeed is old_pagespeed) and
(stype == oldsitetype and cache == oldcachetype)):
return 1
if pargs.pagespeed=="on" or pargs.hhvm=="on":
if pargs.hhvm == "on":
if (not pargs.experimental):
Log.info(self, "HHVM is experimental feature and it may not"
" work with all plugins of your site.\nYou can "
"disable it by passing --hhvm=off later.\nDo you wish"
" to enable HHVM now for {0}?".format(ee_domain))
# Check prompt
check_prompt = input("Type \"y\" to continue [n]:")
if check_prompt != "Y" and check_prompt != "y":
Log.info(self, "Not using HHVM for site")
data['hhvm'] = False
hhvm = False
else:
data['hhvm'] = True
hhvm = True
else:
data['hhvm'] = True
hhvm = True
if pargs.pagespeed=="on":
if (not pargs.experimental):
Log.info(self, "PageSpeed is experimental feature and it may not"
" work with all CSS/JS/Cache of your site.\nYou can "
"disable it by passing --pagespeed=off later.\nDo you wish"
" to enable PageSpeed now for {0}?".format(ee_domain))
# Check prompt
check_prompt = input("Type \"y\" to continue [n]:")
if check_prompt != "Y" and check_prompt != "y":
Log.info(self, "Not using Pagespeed for given site")
data['pagespeed'] = False
pagespeed = False
else:
data['pagespeed'] = True
pagespeed = True
else:
data['pagespeed'] = True
pagespeed = True
if ((hhvm is old_hhvm) and (pagespeed is old_pagespeed) and
(stype == oldsitetype and cache == oldcachetype)):
return 1
if not data:
Log.error(self, "Cannot update {0}, Invalid Options"

5
ee/cli/plugins/site_functions.py

@ -91,8 +91,6 @@ def setupdomain(self, data):
raise SiteError("created nginx configuration failed for site."
" check with `nginx -t`")
if 'proxy' in data.keys() and data['proxy']:
return
# create symbolic link for
EEFileUtils.create_symlink(self, ['/etc/nginx/sites-available/{0}'
@ -100,6 +98,9 @@ def setupdomain(self, data):
'/etc/nginx/sites-enabled/{0}'
.format(ee_domain_name)])
if 'proxy' in data.keys() and data['proxy']:
return
# Creating htdocs & logs directory
Log.info(self, "Setting up webroot \t\t", end='')
try:

105
ee/cli/plugins/stack.py

@ -72,6 +72,8 @@ class EEStackController(CementBaseController):
dict(help='Install Adminer stack', action='store_true')),
(['--utils'],
dict(help='Install Utils stack', action='store_true')),
(['--pagespeed'],
dict(help='Install Pagespeed', action='store_true')),
]
usage = "ee stack (command) [options]"
@ -227,9 +229,10 @@ class EEStackController(CementBaseController):
self.app.render((data), 'fastcgi.mustache', out=ee_nginx)
ee_nginx.close()
data = dict(php="9000", debug="9001", hhvm="8000")
data = dict(php="9000", debug="9001", hhvm="8000",
hhvmconf=False)
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/conf.d/upstream.conf ')
'file /etc/nginx/conf.d/upstream.conf')
ee_nginx = open('/etc/nginx/conf.d/upstream.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'upstream.mustache', out=ee_nginx)
@ -258,38 +261,6 @@ class EEStackController(CementBaseController):
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/php-hhvm.conf')
ee_nginx = open('/etc/nginx/common/php-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'php-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/w3tc-hhvm.conf')
ee_nginx = open('/etc/nginx/common/w3tc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'w3tc-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpfc-hhvm.conf')
ee_nginx = open('/etc/nginx/common/wpfc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpfc-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpsc-hhvm.conf')
ee_nginx = open('/etc/nginx/common/wpsc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpsc-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/php.conf')
ee_nginx = open('/etc/nginx/common/php.conf',
@ -338,27 +309,6 @@ class EEStackController(CementBaseController):
out=ee_nginx)
ee_nginx.close()
# Fix whitescreen of death beacuse of missing value
# fastcgi_param SCRIPT_FILENAME $request_filename; in file
# /etc/nginx/fastcgi_params
if not EEFileUtils.grep(self, '/etc/nginx/fastcgi_params',
'SCRIPT_FILENAME'):
with open('/etc/nginx/fastcgi_params',
encoding='utf-8', mode='a') as ee_nginx:
ee_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
'\t$request_filename;\n')
# Pagespeed configuration
Log.debug(self, 'Writting the Pagespeed Global '
'configuration to file /etc/nginx/conf.d/'
'pagespeed.conf')
ee_nginx = open('/etc/nginx/conf.d/pagespeed.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'pagespeed-global.mustache',
out=ee_nginx)
ee_nginx.close()
# 22222 port settings
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/sites-available/'
@ -460,6 +410,21 @@ class EEStackController(CementBaseController):
self.msg = (self.msg + ["HTTP Auth User Name: easyengine"]
+ ["HTTP Auth Password : {0}".format(passwd)])
# Set up pagespeed config
if self.app.pargs.pagespeed:
if (os.path.isfile('/etc/nginx/nginx.conf') and
(not os.path.isfile('/etc/nginx/conf.d/pagespeed.conf'))):
# Pagespeed configuration
data = dict()
Log.debug(self, 'Writting the Pagespeed Global '
'configuration to file /etc/nginx/conf.d/'
'pagespeed.conf')
ee_nginx = open('/etc/nginx/conf.d/pagespeed.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'pagespeed-global.mustache',
out=ee_nginx)
ee_nginx.close()
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
EEShellExec.cmd_exec(self, "update-rc.d hhvm defaults")
@ -479,6 +444,9 @@ class EEStackController(CementBaseController):
"hhvm.mysqli.socket = "
"/var/run/mysqld/mysqld.sock\n")
with open("/etc/hhvm/server.ini", "a") as hhvm_file:
hhvm_file.write("hhvm.server.ip = 127.0.0.1\n")
if os.path.isfile("/etc/nginx/conf.d/fastcgi.conf"):
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
"fastcgi.conf",
@ -1389,7 +1357,7 @@ class EEStackController(CementBaseController):
(not self.app.pargs.php) and (not self.app.pargs.mysql) and
(not self.app.pargs.postfix) and (not self.app.pargs.wpcli) and
(not self.app.pargs.phpmyadmin) and (not self.app.pargs.hhvm)
and
and (not self.app.pargs.pagespeed) and
(not self.app.pargs.adminer) and (not self.app.pargs.utils) and
(not self.app.pargs.mailscanner) and (not self.app.pargs.all)):
self.app.pargs.web = True
@ -1406,7 +1374,6 @@ class EEStackController(CementBaseController):
self.app.pargs.mysql = True
self.app.pargs.wpcli = True
self.app.pargs.postfix = True
self.app.pargs.hhvm = True
if self.app.pargs.admin:
self.app.pargs.nginx = True
@ -1448,6 +1415,12 @@ class EEStackController(CementBaseController):
else:
Log.info(self, "Mail server is already installed")
if self.app.pargs.pagespeed:
if not EEAptGet.is_installed(self, 'nginx-custom'):
self.app.pargs.nginx = True
else:
Log.info(self, "Nginx already installed")
if self.app.pargs.nginx:
Log.debug(self, "Setting apt_packages variable for Nginx")
@ -1618,7 +1591,8 @@ class EEStackController(CementBaseController):
(not self.app.pargs.postfix) and (not self.app.pargs.wpcli) and
(not self.app.pargs.phpmyadmin) and (not self.app.pargs.hhvm) and
(not self.app.pargs.adminer) and (not self.app.pargs.utils) and
(not self.app.pargs.mailscanner) and (not self.app.pargs.all)):
(not self.app.pargs.mailscanner) and (not self.app.pargs.all) and
(not self.app.pargs.pagespeed)):
self.app.pargs.web = True
self.app.pargs.admin = True
@ -1630,7 +1604,6 @@ class EEStackController(CementBaseController):
if self.app.pargs.web:
self.app.pargs.nginx = True
self.app.pargs.php = True
self.app.pargs.hhvm = True
self.app.pargs.mysql = True
self.app.pargs.wpcli = True
self.app.pargs.postfix = True
@ -1655,6 +1628,10 @@ class EEStackController(CementBaseController):
if self.app.pargs.mailscanner:
apt_packages = (apt_packages + EEVariables.ee_mailscanner)
if self.app.pargs.pagespeed:
Log.debug(self, "Removing packages varible of Pagespeed")
packages = packages + ['/etc/nginx/conf.d/pagespeed.conf']
if self.app.pargs.nginx:
Log.debug(self, "Removing apt_packages variable of Nginx")
apt_packages = apt_packages + EEVariables.ee_nginx
@ -1699,7 +1676,7 @@ class EEStackController(CementBaseController):
'{0}22222/htdocs/db/anemometer'
.format(EEVariables.ee_webroot)]
ee_prompt = input('Are you sure you to want to'
' purge from server.'
' remove from server.'
'Package configuration will remain'
' on server after this operation.\n'
'Any answer other than '
@ -1734,7 +1711,8 @@ class EEStackController(CementBaseController):
(not self.app.pargs.postfix) and (not self.app.pargs.wpcli) and
(not self.app.pargs.phpmyadmin) and (not self.app.pargs.hhvm) and
(not self.app.pargs.adminer) and (not self.app.pargs.utils) and
(not self.app.pargs.mailscanner) and (not self.app.pargs.all)):
(not self.app.pargs.mailscanner) and (not self.app.pargs.all) and
(not self.app.pargs.pagespeed)):
self.app.pargs.web = True
self.app.pargs.admin = True
@ -1749,7 +1727,6 @@ class EEStackController(CementBaseController):
self.app.pargs.mysql = True
self.app.pargs.wpcli = True
self.app.pargs.postfix = True
self.app.pargs.hhvm = True
if self.app.pargs.admin:
self.app.pargs.adminer = True
@ -1771,6 +1748,10 @@ class EEStackController(CementBaseController):
if self.app.pargs.mailscanner:
apt_packages = (apt_packages + EEVariables.ee_mailscanner)
if self.app.pargs.pagespeed:
Log.debug(self, "Purge packages varible of Pagespeed")
packages = packages + ['/etc/nginx/conf.d/pagespeed.conf']
if self.app.pargs.nginx:
Log.debug(self, "Purge apt_packages variable of Nginx")
apt_packages = apt_packages + EEVariables.ee_nginx

2
ee/cli/templates/upstream.mustache

@ -7,8 +7,10 @@ upstream debug {
# Debug Pool
server 127.0.0.1:{{debug}};
}
{{#hhvmconf}}
upstream hhvm {
# HHVM Pool
server 127.0.0.1:{{hhvm}};
server 127.0.0.1:{{php}} backup;
}
{{/hhvmconf}}

2
ee/core/variables.py

@ -12,7 +12,7 @@ class EEVariables():
"""Intialization of core variables"""
# EasyEngine version
ee_version = "3.2.0"
ee_version = "3.2.1"
# EasyEngine packages versions
ee_wp_cli = "0.19.1"

11
install

@ -48,7 +48,7 @@ fi
# Define variables for later use
ee_branch=$1
readonly ee_version_old="2.2.3"
readonly ee_version_new="3.2.0"
readonly ee_version_new="3.2.1"
readonly ee_log_dir=/var/log/ee/
readonly ee_install_log=/var/log/ee/install.log
readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}')
@ -377,6 +377,15 @@ function ee_update_latest()
fi
fi
# Fix HHVM server IP
if [ -f /etc/hhvm/server.ini ]; then
grep -Hr "hhvm.server.ip" /etc/hhvm/server.ini &>> /dev/null
if [ $? -ne 0 ]; then
echo -e "hhvm.server.ip = 127.0.0.1\n" >> /etc/hhvm/server.ini
fi
fi
}
# Do git intialisation

2
setup.py

@ -54,7 +54,7 @@ except Exception as e:
os.system("git config --global user.email {0}".format(ee_email))
setup(name='ee',
version='3.2.0',
version='3.2.1',
description=long_description,
long_description=long_description,
classifiers=[],

Loading…
Cancel
Save