From c81a959d2b68401ae0753ec390ac025112bcc29f Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 8 Jan 2016 19:40:47 +0530 Subject: [PATCH 01/40] removed --min_expiry_limit 30 --- ee/cli/plugins/site.py | 59 +++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 1be91214..9c49c3af 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -753,8 +753,8 @@ class EESiteCreateController(CementBaseController): setupLetsEncrypt(self, ee_domain) httpsRedirect(self,ee_domain) Log.info(self,"Creating Cron Job for cert auto-renewal") - EECron.setcron_daily(self,'ee site update {0} --le=renew --min_expiry_limit 30 2> /dev/null'.format(ee_domain),'Renew ' - 'letsencrypt SSL cert. Set by EasyEngine') + EECron.setcron_daily(self,'ee site update --le=renew --all 2> /dev/null'.format(ee_domain),'Renew all' + ' letsencrypt SSL cert. Set by EasyEngine') if not EEService.reload_service(self, 'nginx'): Log.error(self, "service nginx reload failed. " @@ -828,8 +828,6 @@ class EESiteUpdateController(CementBaseController): dict(help="configure letsencrypt ssl for the site", action='store' or 'store_const', choices=('on', 'off', 'renew'), const='on', nargs='?')), - (['--min_expiry_limit'], - dict(help="pass minimum expiry days to renew let's encrypt cert")), (['--proxy'], dict(help="update to proxy site", nargs='+')), (['--experimental'], @@ -1090,9 +1088,15 @@ class EESiteUpdateController(CementBaseController): pargs.pagespeed = False #--letsencrypt=renew code goes here - if pargs.letsencrypt == "renew" and not pargs.min_expiry_limit: + if pargs.letsencrypt == "renew" and not pargs.all: + expiry_days = SSL.getExpirationDays(self,ee_domain) + min_expiry_days = 30 if check_ssl: - renewLetsEncrypt(self,ee_domain) + if (expiry_days <= min_expiry_days): + renewLetsEncrypt(self,ee_domain) + else: + Log.error(self,"More than 60 days left for certificate Expiry. Not renewing now.") + else: Log.error(self,"Cannot RENEW ! SSL is not configured for given site .") @@ -1103,34 +1107,25 @@ class EESiteUpdateController(CementBaseController): Log.info(self, "Expiration DATE: " + str(SSL.getExpirationDate(self,ee_domain))) else: - Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ") - - if pargs.min_expiry_limit: - if not int(pargs.min_expiry_limit)>0 or not int(pargs.min_expiry_limit)< 90: - Log.error(self,'INVALID --min_expiry_limit argument provided. Please use range 1-89 .') + Log.warn(self, "Your cert already EXPIRED !. PLEASE renew soon . ") - if not pargs.letsencrypt == "renew": - Log.error(self,'--min_expiry_limit parameter cannot be used as a standalone. Provide --le=renew') + if pargs.all and pargs.letsencrypt == "renew": - if not check_ssl: - Log.error(self,"Cannot RENEW ! SSL is not configured for given site .") - - expiry_days = SSL.getExpirationDays(self,ee_domain) - min_expiry_days = int(pargs.min_expiry_limit) - if (expiry_days <= min_expiry_days): - renewLetsEncrypt(self,ee_domain) - Log.info(self, "SUCCESS: Certificate was successfully renewed For" - " https://{0}".format(ee_domain)) - else: - Log.info(self, "Not renewing SSL .") + if check_ssl: + expiry_days = SSL.getExpirationDays(self,ee_domain) + min_expiry_days = 30 + if (expiry_days <= min_expiry_days): + renewLetsEncrypt(self,ee_domain) + Log.info(self, "SUCCESS: Certificate was successfully renewed For" + " https://{0}".format(ee_domain)) - if (SSL.getExpirationDays(self,ee_domain)>0): - Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,ee_domain)) + " days.") - Log.info(self, "Expiration DATE: " + str(SSL.getExpirationDate(self,ee_domain))) + if (SSL.getExpirationDays(self,ee_domain)>0): + Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,ee_domain)) + " days.") + Log.info(self, "Expiration DATE: \n\n" + str(SSL.getExpirationDate(self,ee_domain))) - else: - Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ") - return 0 + #else: + # Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ") + #return 0 if pargs.letsencrypt: if pargs.letsencrypt == 'on': @@ -1323,7 +1318,7 @@ class EESiteUpdateController(CementBaseController): httpsRedirect(self,ee_domain) Log.info(self,"Creating Cron Job for cert auto-renewal") - EECron.setcron_daily(self,'ee site update {0} --le=renew --min_expiry_limit 30 2> /dev/null'.format(ee_domain),'Renew' + EECron.setcron_daily(self,'ee site update --le=renew --all 2> /dev/null'.format(ee_domain),'Renew all' ' letsencrypt SSL cert. Set by EasyEngine') if not EEService.reload_service(self, 'nginx'): @@ -1351,7 +1346,7 @@ class EESiteUpdateController(CementBaseController): Log.error(self, "service nginx reload failed. " "check issues with `nginx -t` command") Log.info(self,"Removing Cron Job set for cert auto-renewal") - EECron.remove_cron(self,'ee site update {0} --le=renew --min_expiry_limit 30 2> \/dev\/null'.format(ee_domain)) + #EECron.remove_cron(self,'ee site update {0} --le=renew --min_expiry_limit 30 2> \/dev\/null'.format(ee_domain)) Log.info(self, "Successfully Disabled SSl for Site " " http://{0}".format(ee_domain)) From 165d08fdfc1889f99acb5ef2812aceabff98f560 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 14:53:16 +0530 Subject: [PATCH 02/40] remove old cron format --- install | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install b/install index 083deeed..0be0c3e3 100644 --- a/install +++ b/install @@ -525,6 +525,14 @@ function ee_update_latest() sed -i 's/HIGH:!aNULL:!MD5:!kEDH;/ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;/' /etc/nginx/nginx.conf fi + #Fix for SSL cert --all + crontab -l | grep -q '\-\-min_expiry_limit' + if [[ $? -eq 0 ]]; then + crontab -l | sed '/--min_expiry_limit/d' | crontab - + crontab -l 2> /dev/null | {{ cat; echo -e "0 12 * * * ee site update --le=renew --all # Renew all letsencrypt SSL cert. Set by EasyEngine "; }} | crontab - + fi + + } From 1e659de7668189b3726188135403626ce9b7bfc4 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 18:40:02 +0530 Subject: [PATCH 03/40] set cron for --le --- ee/cli/plugins/site.py | 10 +++++++--- ee/cli/plugins/site_functions.py | 1 + ee/core/sslutils.py | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 9c49c3af..61359543 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1112,7 +1112,9 @@ class EESiteUpdateController(CementBaseController): if pargs.all and pargs.letsencrypt == "renew": if check_ssl: - expiry_days = SSL.getExpirationDays(self,ee_domain) + expiry_days = SSL.getExpirationDays(self,ee_domain,True) + if expiry_days < 0: + return 0 min_expiry_days = 30 if (expiry_days <= min_expiry_days): renewLetsEncrypt(self,ee_domain) @@ -1122,10 +1124,12 @@ class EESiteUpdateController(CementBaseController): if (SSL.getExpirationDays(self,ee_domain)>0): Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,ee_domain)) + " days.") Log.info(self, "Expiration DATE: \n\n" + str(SSL.getExpirationDate(self,ee_domain))) - + return 0 #else: # Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ") - #return 0 + else: + Log.info(self,"SSL not configured for site http://{0}".format(ee_domain)) + return 0 if pargs.letsencrypt: if pargs.letsencrypt == 'on': diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 68b5a536..b6c8b4cb 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1212,6 +1212,7 @@ def setupLetsEncrypt(self, ee_domain_name): cloneLetsEncrypt(self) EEFileUtils.chdir(self, '/opt/letsencrypt') EEShellExec.cmd_exec(self, "git pull") + Log.warn(self,"Please Wait while we fetch SSL Certificate for your site.\nIt may take time depending upon network.") ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " .format(ee_domain_name) diff --git a/ee/core/sslutils.py b/ee/core/sslutils.py index 305f4f76..d704c71f 100644 --- a/ee/core/sslutils.py +++ b/ee/core/sslutils.py @@ -5,12 +5,14 @@ from ee.core.logging import Log class SSL: - def getExpirationDays(self,domain): + def getExpirationDays(self,domain,returnonerror=False): # check if exist if not os.path.isfile('/etc/letsencrypt/live/{0}/cert.pem' .format(domain)): Log.error(self,'File Not Found : /etc/letsencrypt/live/{0}/cert.pem' .format(domain),False) + if returnonerror: + return -1 Log.error(self, "Check logs for reason " "`tail /var/log/ee/ee.log` & Try Again!!!") From 309c4e784e07d7c1f4929bdd347ee54b7681cd4e Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 19:07:52 +0530 Subject: [PATCH 04/40] run commit weekly --- ee/cli/plugins/site.py | 4 ++-- ee/core/cron.py | 4 ++-- install | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 61359543..0eb5781f 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -753,7 +753,7 @@ class EESiteCreateController(CementBaseController): setupLetsEncrypt(self, ee_domain) httpsRedirect(self,ee_domain) Log.info(self,"Creating Cron Job for cert auto-renewal") - EECron.setcron_daily(self,'ee site update --le=renew --all 2> /dev/null'.format(ee_domain),'Renew all' + EECron.setcron_weekly(self,'ee site update --le=renew --all 2> /dev/null'.format(ee_domain),'Renew all' ' letsencrypt SSL cert. Set by EasyEngine') if not EEService.reload_service(self, 'nginx'): @@ -1322,7 +1322,7 @@ class EESiteUpdateController(CementBaseController): httpsRedirect(self,ee_domain) Log.info(self,"Creating Cron Job for cert auto-renewal") - EECron.setcron_daily(self,'ee site update --le=renew --all 2> /dev/null'.format(ee_domain),'Renew all' + EECron.setcron_weekly(self,'ee site update --le=renew --all 2> /dev/null'.format(ee_domain),'Renew all' ' letsencrypt SSL cert. Set by EasyEngine') if not EEService.reload_service(self, 'nginx'): diff --git a/ee/core/cron.py b/ee/core/cron.py index 9c419a1f..7357ebd1 100644 --- a/ee/core/cron.py +++ b/ee/core/cron.py @@ -6,13 +6,13 @@ Set CRON on LINUX system. """ class EECron(): - def setcron_daily(self,cmd,comment='Cron set by EasyEngine',user='root',min=0,hour=12): + def setcron_weekly(self,cmd,comment='Cron set by EasyEngine',user='root',min=0,hour=12): if not EEShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(cmd)): EEShellExec.cmd_exec(self, "/bin/bash -c \"crontab -l " "2> /dev/null | {{ cat; echo -e" " \\\"" - "\\n0 12 * * * " + "\\n0 0 * * 0 " "{0}".format(cmd) + " # {0}".format(comment)+ "\\\"; } | crontab -\"") diff --git a/install b/install index 0be0c3e3..cdc25be8 100644 --- a/install +++ b/install @@ -529,7 +529,7 @@ function ee_update_latest() crontab -l | grep -q '\-\-min_expiry_limit' if [[ $? -eq 0 ]]; then crontab -l | sed '/--min_expiry_limit/d' | crontab - - crontab -l 2> /dev/null | {{ cat; echo -e "0 12 * * * ee site update --le=renew --all # Renew all letsencrypt SSL cert. Set by EasyEngine "; }} | crontab - + crontab -l 2> /dev/null | {{ cat; echo -e "0 0 * * 0 ee site update --le=renew --all 2> /dev/null # Renew all letsencrypt SSL cert. Set by EasyEngine "; }} | crontab - fi From 640e5bf961e7cc0e5de2a82d4966df83184a2e0e Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 19:37:09 +0530 Subject: [PATCH 05/40] update cron --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index cdc25be8..780747ea 100644 --- a/install +++ b/install @@ -529,7 +529,7 @@ function ee_update_latest() crontab -l | grep -q '\-\-min_expiry_limit' if [[ $? -eq 0 ]]; then crontab -l | sed '/--min_expiry_limit/d' | crontab - - crontab -l 2> /dev/null | {{ cat; echo -e "0 0 * * 0 ee site update --le=renew --all 2> /dev/null # Renew all letsencrypt SSL cert. Set by EasyEngine "; }} | crontab - + crontab -l 2> /dev/null | { cat; echo -e "0 0 * * 0 ee site update --le=renew --all 2> /dev/null # Renew all letsencrypt SSL cert. Set by EasyEngine "; } | crontab - fi From f6a4728d71c447f4c5b9247e60fada0843ba46c7 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 19:47:11 +0530 Subject: [PATCH 06/40] add log --- ee/cli/plugins/site.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 0eb5781f..705be8f8 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1120,6 +1120,8 @@ class EESiteUpdateController(CementBaseController): renewLetsEncrypt(self,ee_domain) Log.info(self, "SUCCESS: Certificate was successfully renewed For" " https://{0}".format(ee_domain)) + else: + Log.info(self,"More than 60 days left for certificate Expiry. Not renewing now.\n") if (SSL.getExpirationDays(self,ee_domain)>0): Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,ee_domain)) + " days.") From b0bbd2e7d8923620be79ccfead8f18a39e9756cd Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 19:55:43 +0530 Subject: [PATCH 07/40] removed log --- ee/cli/plugins/site.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 705be8f8..78f2f5d2 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1351,7 +1351,7 @@ class EESiteUpdateController(CementBaseController): if not EEService.reload_service(self, 'nginx'): Log.error(self, "service nginx reload failed. " "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") #EECron.remove_cron(self,'ee site update {0} --le=renew --min_expiry_limit 30 2> \/dev\/null'.format(ee_domain)) Log.info(self, "Successfully Disabled SSl for Site " " http://{0}".format(ee_domain)) From 22ddac1cbad155981a13cb39bb9c60365b23965a Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 20:27:50 +0530 Subject: [PATCH 08/40] install && remove nginx, nginx-mainline in single command --- ee/cli/plugins/stack.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 60a3349a..9424a935 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1693,11 +1693,21 @@ class EEStackController(CementBaseController): self.post_pref(apt, packages) else: Log.debug(self, "Nginx already installed") - Log.info(self, "Nginx already installed") + if EEAptGet.is_installed(self, 'nginx-mainline'): + ee_prompt = input('Nginx Stable already found on your system.\nDo you want to remove Nginx mainline ' + 'and install Nginx Stable.,\nAny answer other than "yes" will be stop this ' + 'operation :') + if ee_prompt == 'YES' or ee_prompt == 'yes': + EEService.stop_service(self, 'nginx') + Log.debug(self, "Removing apt_packages variable of Nginx") + EEFileUtils.remove(self, EEVariables.ee_nginx_dev) + EEAptGet.auto_remove(self) + Log.info(self, "Removing repository for NGINX MAINLINE,") + EERepo.remove(self, repo_url=EEVariables.ee_nginx_dev_repo) if self.app.pargs.nginxmainline: if EEVariables.ee_nginx_dev_repo == None: - Log.error(self, "NGINX Mainline Version is not supported in wheezy") + Log.error(self, "NGINX Mainline Version is not supported in your platform") Log.debug(self, "Setting apt_packages variable for Nginx") @@ -1711,7 +1721,17 @@ class EEStackController(CementBaseController): self.post_pref(apt, packages) else: Log.debug(self, "Nginx already installed") - Log.info(self, "Nginx already installed") + if EEAptGet.is_installed(self, 'nginx-custom'): + ee_prompt = input('Nginx Stable already found on your system.\nDo you want to remove Nginx stable ' + 'and install Nginx Mainline.,\nAny answer other than "yes" will be stop this ' + 'operation :') + if ee_prompt == 'YES' or ee_prompt == 'yes': + EEService.stop_service(self, 'nginx') + Log.debug(self, "Removing apt_packages variable of Nginx") + EEFileUtils.remove(self, EEVariables.ee_nginx) + EEAptGet.auto_remove(self) + + if self.app.pargs.php: Log.debug(self, "Setting apt_packages variable for PHP") From db69444cd928b77df5aaf9616cd22d9875a73fbd Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 20:35:46 +0530 Subject: [PATCH 09/40] install nginx --- ee/cli/plugins/stack.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 9424a935..cad46bd7 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1704,6 +1704,7 @@ class EEStackController(CementBaseController): EEAptGet.auto_remove(self) Log.info(self, "Removing repository for NGINX MAINLINE,") EERepo.remove(self, repo_url=EEVariables.ee_nginx_dev_repo) + apt_packages = apt_packages + EEVariables.ee_nginx if self.app.pargs.nginxmainline: if EEVariables.ee_nginx_dev_repo == None: @@ -1730,6 +1731,7 @@ class EEStackController(CementBaseController): Log.debug(self, "Removing apt_packages variable of Nginx") EEFileUtils.remove(self, EEVariables.ee_nginx) EEAptGet.auto_remove(self) + apt_packages = apt_packages + EEVariables.ee_nginx_dev From b98894f9701b7bfeb67d3f053b681bcdcfa5b604 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 20:42:07 +0530 Subject: [PATCH 10/40] fix previous commit issue --- ee/cli/plugins/stack.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index cad46bd7..85af738f 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1700,7 +1700,8 @@ class EEStackController(CementBaseController): if ee_prompt == 'YES' or ee_prompt == 'yes': EEService.stop_service(self, 'nginx') Log.debug(self, "Removing apt_packages variable of Nginx") - EEFileUtils.remove(self, EEVariables.ee_nginx_dev) + Log.info(self, "Removing packages, please wait...") + EEAptGet.remove(self, EEVariables.ee_nginx_dev) EEAptGet.auto_remove(self) Log.info(self, "Removing repository for NGINX MAINLINE,") EERepo.remove(self, repo_url=EEVariables.ee_nginx_dev_repo) @@ -1729,12 +1730,11 @@ class EEStackController(CementBaseController): if ee_prompt == 'YES' or ee_prompt == 'yes': EEService.stop_service(self, 'nginx') Log.debug(self, "Removing apt_packages variable of Nginx") - EEFileUtils.remove(self, EEVariables.ee_nginx) + Log.info(self, "Removing packages, please wait...") + EEAptGet.remove(self, EEVariables.ee_nginx) EEAptGet.auto_remove(self) apt_packages = apt_packages + EEVariables.ee_nginx_dev - - if self.app.pargs.php: Log.debug(self, "Setting apt_packages variable for PHP") if not EEAptGet.is_installed(self, 'php5-fpm'): From 8a2adf79f8329881205333b780dca248670ce576 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 11 Jan 2016 20:44:45 +0530 Subject: [PATCH 11/40] added log info --- ee/cli/plugins/stack.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 85af738f..1fe8d4d4 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1705,6 +1705,7 @@ class EEStackController(CementBaseController): EEAptGet.auto_remove(self) Log.info(self, "Removing repository for NGINX MAINLINE,") EERepo.remove(self, repo_url=EEVariables.ee_nginx_dev_repo) + Log.info(self, "Successfully removed packages") apt_packages = apt_packages + EEVariables.ee_nginx if self.app.pargs.nginxmainline: @@ -1733,6 +1734,7 @@ class EEStackController(CementBaseController): Log.info(self, "Removing packages, please wait...") EEAptGet.remove(self, EEVariables.ee_nginx) EEAptGet.auto_remove(self) + Log.info(self, "Successfully removed packages") apt_packages = apt_packages + EEVariables.ee_nginx_dev if self.app.pargs.php: From 81d4393e58c7953f874a4e8830eddd88374481ed Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 12 Jan 2016 14:33:47 +0530 Subject: [PATCH 12/40] update warn color --- ee/cli/plugins/stack.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 1fe8d4d4..490f036c 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1694,9 +1694,10 @@ class EEStackController(CementBaseController): else: Log.debug(self, "Nginx already installed") if EEAptGet.is_installed(self, 'nginx-mainline'): - ee_prompt = input('Nginx Stable already found on your system.\nDo you want to remove Nginx mainline ' + Log.warn(self,'Nginx Mainline already found on your system.\nDo you want to remove Nginx mainline ' 'and install Nginx Stable.,\nAny answer other than "yes" will be stop this ' - 'operation :') + 'operation.') + ee_prompt = input("Type \"YES\" or \"yes\" to continue [n]: ") if ee_prompt == 'YES' or ee_prompt == 'yes': EEService.stop_service(self, 'nginx') Log.debug(self, "Removing apt_packages variable of Nginx") @@ -1725,9 +1726,10 @@ class EEStackController(CementBaseController): else: Log.debug(self, "Nginx already installed") if EEAptGet.is_installed(self, 'nginx-custom'): - ee_prompt = input('Nginx Stable already found on your system.\nDo you want to remove Nginx stable ' + Log.warn(self,'Nginx Stable already found on your system.\nDo you want to remove Nginx stable ' 'and install Nginx Mainline.,\nAny answer other than "yes" will be stop this ' - 'operation :') + 'operation.') + ee_prompt = input("Type \"YES\" or \"yes\" to continue [n]: ") if ee_prompt == 'YES' or ee_prompt == 'yes': EEService.stop_service(self, 'nginx') Log.debug(self, "Removing apt_packages variable of Nginx") From aca34c6ec96870bb90bd4515d6041435550611cb Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 12 Jan 2016 16:30:41 +0530 Subject: [PATCH 13/40] minimizing Downtime --- ee/cli/plugins/stack.py | 40 +++++++++++++++++++++++++--------------- ee/core/aptget.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 15 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 490f036c..467e7fd0 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1699,15 +1699,21 @@ class EEStackController(CementBaseController): 'operation.') ee_prompt = input("Type \"YES\" or \"yes\" to continue [n]: ") if ee_prompt == 'YES' or ee_prompt == 'yes': - EEService.stop_service(self, 'nginx') - Log.debug(self, "Removing apt_packages variable of Nginx") - Log.info(self, "Removing packages, please wait...") - EEAptGet.remove(self, EEVariables.ee_nginx_dev) - EEAptGet.auto_remove(self) - Log.info(self, "Removing repository for NGINX MAINLINE,") + Log.info(self,"Initializing... Please Wait") EERepo.remove(self, repo_url=EEVariables.ee_nginx_dev_repo) - Log.info(self, "Successfully removed packages") - apt_packages = apt_packages + EEVariables.ee_nginx + if EEAptGet.download_only(self,EEVariables.ee_nginx,EEVariables.ee_nginx_repo,EEVariables.ee_nginx_key): + EEService.stop_service(self, 'nginx') + Log.debug(self, "Removing apt_packages variable of NGINX") + Log.info(self, "Removing packages, please wait...") + EEAptGet.remove(self, EEVariables.ee_nginx_dev) + EEAptGet.auto_remove(self) + Log.info(self, "Removing repository for NGINX MAINLINE,") + Log.info(self, "Successfully removed packages") + apt_packages = apt_packages + EEVariables.ee_nginx + else: + #revert the changes + EERepo.add(self, repo_url=EEVariables.ee_nginx_dev_repo) + Log.error(self,"Skipped installing NGINX Stable") if self.app.pargs.nginxmainline: if EEVariables.ee_nginx_dev_repo == None: @@ -1731,13 +1737,17 @@ class EEStackController(CementBaseController): 'operation.') ee_prompt = input("Type \"YES\" or \"yes\" to continue [n]: ") if ee_prompt == 'YES' or ee_prompt == 'yes': - EEService.stop_service(self, 'nginx') - Log.debug(self, "Removing apt_packages variable of Nginx") - Log.info(self, "Removing packages, please wait...") - EEAptGet.remove(self, EEVariables.ee_nginx) - EEAptGet.auto_remove(self) - Log.info(self, "Successfully removed packages") - apt_packages = apt_packages + EEVariables.ee_nginx_dev + Log.info(self,"Initializing... Please Wait") + if EEAptGet.download_only(self,EEVariables.ee_nginx_dev,EEVariables.ee_nginx_dev_repo,EEVariables.ee_nginx_key): + EEService.stop_service(self, 'nginx') + Log.debug(self, "Removing apt_packages variable of Nginx") + Log.info(self, "Removing packages, please wait...") + EEAptGet.remove(self, EEVariables.ee_nginx) + EEAptGet.auto_remove(self) + Log.info(self, "Successfully removed packages") + apt_packages = apt_packages + EEVariables.ee_nginx_dev + else: + Log.error(self,"Skipped installing NGINX Mainline") if self.app.pargs.php: Log.debug(self, "Setting apt_packages variable for PHP") diff --git a/ee/core/aptget.py b/ee/core/aptget.py index b8181c6a..1aac6495 100644 --- a/ee/core/aptget.py +++ b/ee/core/aptget.py @@ -195,3 +195,36 @@ class EEAptGet(): return True # apt_cache.close() return False + + def download_only(self,package_name,repo_url=None,repo_key=None): + """ + Similar to `apt-get install --download-only` + """ + try: + with open('/var/log/ee/ee.log', 'a') as f: + if repo_url is not None: + EERepo.add(self, repo_url=repo_url) + if repo_key is not None: + EERepo.add_key(self, repo_key) + proc = subprocess.Popen("DEBIAN_FRONTEND=noninteractive " + "apt-get install -o " + "Dpkg::Options::=\"--force-confdef\"" + " -o " + "Dpkg::Options::=\"--force-confold\"" + " -y --download-only {0}" + .format(package_name), shell=True, + stdin=None, stdout=f, stderr=f, + executable="/bin/bash") + proc.wait() + + if proc.returncode == 0: + return True + else: + Log.error(self,"Error in fetching dpkg package.\nReverting changes ..",False) + if repo_url is not None: + EERepo.remove(self, repo_url=repo_url) + return False + except Exception as e: + Log.error(self, "Error while downloading packages, " + "apt-get exited with error") + From 357691ac21b155f29f13ed4f89bc10c3ff877f1b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 12 Jan 2016 19:41:32 +0530 Subject: [PATCH 14/40] reverting to old nginx while migrating --- ee/cli/plugins/stack.py | 21 +++++++++++---------- ee/core/aptget.py | 5 +++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 467e7fd0..6b64dc76 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1699,21 +1699,22 @@ class EEStackController(CementBaseController): 'operation.') ee_prompt = input("Type \"YES\" or \"yes\" to continue [n]: ") if ee_prompt == 'YES' or ee_prompt == 'yes': - Log.info(self,"Initializing... Please Wait") + EEService.stop_service(self, 'nginx') + Log.debug(self, "Removing apt_packages variable of NGINX") + Log.info(self, "Removing packages, please wait...") + EEAptGet.remove(self, EEVariables.ee_nginx_dev) + EEAptGet.auto_remove(self) + Log.info(self, "Removing repository for NGINX MAINLINE,") EERepo.remove(self, repo_url=EEVariables.ee_nginx_dev_repo) + Log.info(self, "Successfully removed packages") + Log.info(self,"Initializing NGINX Mainline Packages... Please Wait") if EEAptGet.download_only(self,EEVariables.ee_nginx,EEVariables.ee_nginx_repo,EEVariables.ee_nginx_key): - EEService.stop_service(self, 'nginx') - Log.debug(self, "Removing apt_packages variable of NGINX") - Log.info(self, "Removing packages, please wait...") - EEAptGet.remove(self, EEVariables.ee_nginx_dev) - EEAptGet.auto_remove(self) - Log.info(self, "Removing repository for NGINX MAINLINE,") - Log.info(self, "Successfully removed packages") apt_packages = apt_packages + EEVariables.ee_nginx else: #revert the changes EERepo.add(self, repo_url=EEVariables.ee_nginx_dev_repo) - Log.error(self,"Skipped installing NGINX Stable") + Log.error(self,"Error installing NGINX Stable\nReverting back to NGINX Mainline ..",False) + apt_packages = apt_packages + EEVariables.ee_nginx_dev if self.app.pargs.nginxmainline: if EEVariables.ee_nginx_dev_repo == None: @@ -1747,7 +1748,7 @@ class EEStackController(CementBaseController): Log.info(self, "Successfully removed packages") apt_packages = apt_packages + EEVariables.ee_nginx_dev else: - Log.error(self,"Skipped installing NGINX Mainline") + Log.error(self,"Skipped installing NGINX Mainline",False) if self.app.pargs.php: Log.debug(self, "Setting apt_packages variable for PHP") diff --git a/ee/core/aptget.py b/ee/core/aptget.py index 1aac6495..bd05243f 100644 --- a/ee/core/aptget.py +++ b/ee/core/aptget.py @@ -200,19 +200,20 @@ class EEAptGet(): """ Similar to `apt-get install --download-only` """ + packages = ' '.join(package_name) try: with open('/var/log/ee/ee.log', 'a') as f: if repo_url is not None: EERepo.add(self, repo_url=repo_url) if repo_key is not None: EERepo.add_key(self, repo_key) - proc = subprocess.Popen("DEBIAN_FRONTEND=noninteractive " + proc = subprocess.Popen("apt-get update && DEBIAN_FRONTEND=noninteractive " "apt-get install -o " "Dpkg::Options::=\"--force-confdef\"" " -o " "Dpkg::Options::=\"--force-confold\"" " -y --download-only {0}" - .format(package_name), shell=True, + .format(packages), shell=True, stdin=None, stdout=f, stderr=f, executable="/bin/bash") proc.wait() From e31a582d020397fab2ea813ce38a0849e8787681 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 13 Jan 2016 12:38:09 +0530 Subject: [PATCH 15/40] fix cron issue in precise --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 780747ea..e5605a85 100644 --- a/install +++ b/install @@ -529,7 +529,7 @@ function ee_update_latest() crontab -l | grep -q '\-\-min_expiry_limit' if [[ $? -eq 0 ]]; then crontab -l | sed '/--min_expiry_limit/d' | crontab - - crontab -l 2> /dev/null | { cat; echo -e "0 0 * * 0 ee site update --le=renew --all 2> /dev/null # Renew all letsencrypt SSL cert. Set by EasyEngine "; } | crontab - + crontab -l 2> /dev/null | ( cat; echo -e "\n0 0 * * 0 ee site update --le=renew --all 2> /dev/null # Renew all letsencrypt SSL cert. Set by EasyEngine "; ) | crontab - fi From 0e5160dd39c16ec4bb295c9497c90e77299de7cf Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 13 Jan 2016 12:42:10 +0530 Subject: [PATCH 16/40] update wp-cli version --- ee/core/variables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/core/variables.py b/ee/core/variables.py index a0f76234..476ce416 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -16,7 +16,7 @@ class EEVariables(): # EasyEngine packages versions - ee_wp_cli = "0.21.1" + ee_wp_cli = "0.22.0" ee_adminer = "4.2.1" ee_roundcube = "1.1.4" ee_vimbadmin = "3.0.12" From bbea3b0b4416118e8dda19d78e601c8280203b53 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 13 Jan 2016 13:59:14 +0530 Subject: [PATCH 17/40] create /opt if not exist --- ee/cli/plugins/site_functions.py | 3 ++- ee/core/aptget.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index b6c8b4cb..ebcbad90 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1186,7 +1186,8 @@ def operateOnPagespeed(self, data): def cloneLetsEncrypt(self): letsencrypt_repo = "https://github.com/letsencrypt/letsencrypt" - + if not os.path.isdir("/opt"): + EEFileUtils.mkdir(self,"/opt") try: Log.info(self, "Downloading {0:20}".format("LetsEncrypt"), end=' ') EEFileUtils.chdir(self, '/opt/') diff --git a/ee/core/aptget.py b/ee/core/aptget.py index bd05243f..14482739 100644 --- a/ee/core/aptget.py +++ b/ee/core/aptget.py @@ -198,7 +198,7 @@ class EEAptGet(): def download_only(self,package_name,repo_url=None,repo_key=None): """ - Similar to `apt-get install --download-only` + Similar to `apt-get install --download-only PACKAGE_NAME` """ packages = ' '.join(package_name) try: From 6cdb674e2c5e9e06fc96a126aa86bb26a42efde3 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 13 Jan 2016 16:00:28 +0530 Subject: [PATCH 18/40] added handling existing cert --- ee/cli/plugins/site_functions.py | 39 +++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index ebcbad90..d24a228e 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1215,7 +1215,12 @@ def setupLetsEncrypt(self, ee_domain_name): EEShellExec.cmd_exec(self, "git pull") Log.warn(self,"Please Wait while we fetch SSL Certificate for your site.\nIt may take time depending upon network.") - ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " + if os.path.isfile("/etc/letsencrypt/renewal/{0}.conf"): + Log.debug(self, "LetsEncrypt SSL Certificate found for the domain {0}" + .format(ee_domain_name)) + ssl= archivedCertificateHandle(self,ee_domain_name,ee_wp_email) + else: + ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " .format(ee_domain_name) + "--email {0} --text --agree-tos".format(ee_wp_email)) if ssl: @@ -1333,7 +1338,39 @@ def httpsRedirect(self,ee_domain_name,redirect=True): Log.info(self, "Disabled HTTPS Force Redirection for Site " " http://{0}".format(ee_domain_name)) +def archivedCertificateHandle(self,domain,ee_wp_email): + Log.warn(self,"You already have an existing certificate for the domain requested.\n" + "(ref: /etc/letsencrypt/renewal/{0}.conf)".format(domain) + + "\nPlease select an option from below?" + "\n\t1: Reinstall existing certificate [RECOMMENDED]" + "\n\t2: Keep the existing certificate for now" + "\n\t3: Renew & replace the certificate (limit ~5 per 7 days)" + "") + + check_prompt = input("\nType any other key to cancel: ") + + if check_prompt == "1": + ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --reinstall --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " + .format(domain) + + "--email {0} --text --agree-tos --renew-by-default".format(ee_wp_email)) + elif check_prompt == "2" : + Log.info(self,"Using Existing Certificates") + elif check_prompt == "3": + ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto --renew certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " + .format(domain) + + "--email {0} --text --agree-tos".format(ee_wp_email)) + else: + Log.error(self,"Operation cancelled by user.") + + if os.path.isfile("{0}/conf/nginx/ssl.conf" + .format(domain)): + Log.info(self, "Existing ssl.conf . Backing it up ..") + EEFileUtils.mvfile(self, "/var/www/{0}/conf/nginx/ssl.conf" + .format(domain), + '/var/www/{0}/conf/nginx/ssl.conf.bak' + .format(domain)) + return ssl From 3cafe8f90353001a41f621af7ff15ee8f66c9d7b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 13 Jan 2016 17:50:18 +0530 Subject: [PATCH 19/40] add format --- ee/cli/plugins/site_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index d24a228e..d77f5edc 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1215,7 +1215,7 @@ def setupLetsEncrypt(self, ee_domain_name): EEShellExec.cmd_exec(self, "git pull") Log.warn(self,"Please Wait while we fetch SSL Certificate for your site.\nIt may take time depending upon network.") - if os.path.isfile("/etc/letsencrypt/renewal/{0}.conf"): + if os.path.isfile("/etc/letsencrypt/renewal/{0}.conf".format(ee_domain_name)): Log.debug(self, "LetsEncrypt SSL Certificate found for the domain {0}" .format(ee_domain_name)) ssl= archivedCertificateHandle(self,ee_domain_name,ee_wp_email) From 2b6f924b697cd83a1527260b8e099ca3ed748fde Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 13 Jan 2016 18:46:21 +0530 Subject: [PATCH 20/40] file exist validation check --- ee/cli/plugins/site_functions.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index d77f5edc..6f0b421a 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1347,14 +1347,20 @@ def archivedCertificateHandle(self,domain,ee_wp_email): "\n\t3: Renew & replace the certificate (limit ~5 per 7 days)" "") - check_prompt = input("\nType any other key to cancel: ") + check_prompt = input("\nType the appropriate number [1-3] or any other key to cancel: ") if check_prompt == "1": ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --reinstall --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " .format(domain) + "--email {0} --text --agree-tos --renew-by-default".format(ee_wp_email)) elif check_prompt == "2" : - Log.info(self,"Using Existing Certificates") + Log.info(self,"Using Existing Certificate files") + if not (os.path.isfile("/etc/letsencrypt/live/{0}/fullchain.pem".format(domain)) or + os.path.isfile("/etc/letsencrypt/live/{0}/privkey.pem".format(domain))): + Log.error(self,"Certificate files not found. Skipping.\n" + "Please check if following file exist\n\t/etc/letsencrypt/live/{0}/fullchain.pem\n\t" + "/etc/letsencrypt/live/{0}/privkey.pem".format(domain)) + elif check_prompt == "3": ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto --renew certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " .format(domain) From b8a70bc29e5dff7923f16e1bbf8aa51fdff0cbbf Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 13 Jan 2016 19:39:42 +0530 Subject: [PATCH 21/40] ssl missed --- ee/cli/plugins/site_functions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 6f0b421a..188f15c3 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1360,6 +1360,7 @@ def archivedCertificateHandle(self,domain,ee_wp_email): Log.error(self,"Certificate files not found. Skipping.\n" "Please check if following file exist\n\t/etc/letsencrypt/live/{0}/fullchain.pem\n\t" "/etc/letsencrypt/live/{0}/privkey.pem".format(domain)) + ssl = True elif check_prompt == "3": ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto --renew certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " From bc088f699e303b24f2b64c8025ea1b62e387be5e Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 13 Jan 2016 20:05:37 +0530 Subject: [PATCH 22/40] error handling --- ee/cli/plugins/site_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 188f15c3..f399e9f7 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1346,9 +1346,9 @@ def archivedCertificateHandle(self,domain,ee_wp_email): "\n\t2: Keep the existing certificate for now" "\n\t3: Renew & replace the certificate (limit ~5 per 7 days)" "") - check_prompt = input("\nType the appropriate number [1-3] or any other key to cancel: ") - + if not os.path.isfile("/etc/letsencrypt/live/{0}/cert.pem".format(domain)): + Log.error(self,"/etc/letsencrypt/live/{0}/cert.pem file is missing.".format(domain)) if check_prompt == "1": ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --reinstall --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " .format(domain) From 26c8bf571687fe099733ddb4486f627863a17c1b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 14 Jan 2016 13:09:21 +0530 Subject: [PATCH 23/40] notice if nginx already installed --- ee/cli/plugins/stack.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 6b64dc76..cf360e4d 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1715,6 +1715,8 @@ class EEStackController(CementBaseController): EERepo.add(self, repo_url=EEVariables.ee_nginx_dev_repo) Log.error(self,"Error installing NGINX Stable\nReverting back to NGINX Mainline ..",False) apt_packages = apt_packages + EEVariables.ee_nginx_dev + else: + Log.info(self, "NGINX Stable already installed") if self.app.pargs.nginxmainline: if EEVariables.ee_nginx_dev_repo == None: @@ -1749,6 +1751,8 @@ class EEStackController(CementBaseController): apt_packages = apt_packages + EEVariables.ee_nginx_dev else: Log.error(self,"Skipped installing NGINX Mainline",False) + else: + Log.info(self, "NGINX Mainline already installed") if self.app.pargs.php: Log.debug(self, "Setting apt_packages variable for PHP") From e527adc2351d7da986624dc03a48e87c0069cd72 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 14 Jan 2016 14:54:54 +0530 Subject: [PATCH 24/40] update info/warn --- ee/cli/plugins/site_functions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index f399e9f7..07c8c34c 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1213,13 +1213,13 @@ def setupLetsEncrypt(self, ee_domain_name): cloneLetsEncrypt(self) EEFileUtils.chdir(self, '/opt/letsencrypt') EEShellExec.cmd_exec(self, "git pull") - Log.warn(self,"Please Wait while we fetch SSL Certificate for your site.\nIt may take time depending upon network.") if os.path.isfile("/etc/letsencrypt/renewal/{0}.conf".format(ee_domain_name)): Log.debug(self, "LetsEncrypt SSL Certificate found for the domain {0}" .format(ee_domain_name)) ssl= archivedCertificateHandle(self,ee_domain_name,ee_wp_email) else: + Log.warn(self,"Please Wait while we fetch SSL Certificate for your site.\nIt may take time depending upon network.") ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " .format(ee_domain_name) + "--email {0} --text --agree-tos".format(ee_wp_email)) @@ -1350,6 +1350,7 @@ def archivedCertificateHandle(self,domain,ee_wp_email): if not os.path.isfile("/etc/letsencrypt/live/{0}/cert.pem".format(domain)): Log.error(self,"/etc/letsencrypt/live/{0}/cert.pem file is missing.".format(domain)) if check_prompt == "1": + Log.info(self,"Please Wait while we reinstall SSL Certificate for your site.\nIt may take time depending upon network.") ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --reinstall --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " .format(domain) + "--email {0} --text --agree-tos --renew-by-default".format(ee_wp_email)) @@ -1363,6 +1364,7 @@ def archivedCertificateHandle(self,domain,ee_wp_email): ssl = True elif check_prompt == "3": + Log.info(self,"Please Wait while we renew SSL Certificate for your site.\nIt may take time depending upon network.") ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto --renew certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " .format(domain) + "--email {0} --text --agree-tos".format(ee_wp_email)) From 92ccc94df6a7aac177b17502f876cda8b6bc1122 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 14 Jan 2016 15:23:29 +0530 Subject: [PATCH 25/40] removed --renew-by-default parameter --- ee/cli/plugins/site_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 07c8c34c..38232fca 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1342,7 +1342,7 @@ def archivedCertificateHandle(self,domain,ee_wp_email): Log.warn(self,"You already have an existing certificate for the domain requested.\n" "(ref: /etc/letsencrypt/renewal/{0}.conf)".format(domain) + "\nPlease select an option from below?" - "\n\t1: Reinstall existing certificate [RECOMMENDED]" + "\n\t1: Reinstall existing certificate" "\n\t2: Keep the existing certificate for now" "\n\t3: Renew & replace the certificate (limit ~5 per 7 days)" "") @@ -1353,7 +1353,7 @@ def archivedCertificateHandle(self,domain,ee_wp_email): Log.info(self,"Please Wait while we reinstall SSL Certificate for your site.\nIt may take time depending upon network.") ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --reinstall --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " .format(domain) - + "--email {0} --text --agree-tos --renew-by-default".format(ee_wp_email)) + + "--email {0} --text --agree-tos".format(ee_wp_email)) elif check_prompt == "2" : Log.info(self,"Using Existing Certificate files") if not (os.path.isfile("/etc/letsencrypt/live/{0}/fullchain.pem".format(domain)) or From 24e0d3f70767ff2cbd425b76edbfdd0e2035b50d Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 14 Jan 2016 18:05:02 +0530 Subject: [PATCH 26/40] update version --- ee/core/variables.py | 2 +- install | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ee/core/variables.py b/ee/core/variables.py index 476ce416..7848c816 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -12,7 +12,7 @@ class EEVariables(): """Intialization of core variables""" # EasyEngine version - ee_version = "3.4.0" + ee_version = "3.4.1" # EasyEngine packages versions diff --git a/install b/install index e5605a85..cdb7dd51 100644 --- a/install +++ b/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.4.0" +readonly ee_version_new="3.4.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}') diff --git a/setup.py b/setup.py index caa47e00..0538bd92 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ if not os.path.isfile('/root/.gitconfig'): shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig') setup(name='ee', - version='3.4.0', + version='3.4.1', description=long_description, long_description=long_description, classifiers=[], From ce1b4da2fd4e85b64ed04dc8452f653c72a45a27 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 15 Jan 2016 13:04:08 +0530 Subject: [PATCH 27/40] .travis.yml with nginx mainline --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index f2a02038..945e1738 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,8 @@ script: - sudo ee stack install --web - sudo ee stack install --admin + - yes | sudo ee stack install --nginxmainline + - sudo ee site create html.net --html - sudo ee site create php.com --php - sudo ee site create mysql.com --mysql From f873b4e5eafb6cab882ba642105758ece250ffb7 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 15 Jan 2016 13:16:05 +0530 Subject: [PATCH 28/40] .travis.yml with nginx mainline --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 945e1738..c9745dca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ script: - sudo ee stack install --web - sudo ee stack install --admin - - yes | sudo ee stack install --nginxmainline + - echo "yes" | sudo ee stack install --nginxmainline - sudo ee site create html.net --html - sudo ee site create php.com --php From fe1e07ce2b18dc163246226d9cfb42c545e20211 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 15 Jan 2016 14:18:16 +0530 Subject: [PATCH 29/40] Added travis_wait in .travis.yml --- .travis.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c9745dca..8d00f2e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,6 @@ script: - sudo ee stack install --web - sudo ee stack install --admin - - echo "yes" | sudo ee stack install --nginxmainline - - sudo ee site create html.net --html - sudo ee site create php.com --php - sudo ee site create mysql.com --mysql @@ -126,10 +124,16 @@ script: - sudo ee site delete site12.in --all --no-prompt - sudo ee site delete site12.net --no-prompt - - sudo ee site delete site12.org --no-prompt - sudo ee site delete site9.com --no-prompt - - sudo ee stack install --mail + - echo "yes" | sudo ee stack install --nginxmainline + - nginx -v + - sudo ee site create site-nm.localtest.me --php --mysql --html + - sudo ee site update site-nm.localtest.me --wp + - yes | sudo ee site update site-nm.localtest.me --hhvm --pagespeed --wpredis + - sudo ee site delete site-nm.localtest.me --no-prompt + + - travis_wait sudo ee stack install --mail - sudo ls /var/www/ - sudo wp --allow-root --info - sudo bash -c 'cat /var/log/ee/ee.log' From bef9449dfad61f4d66e1cda8010a5af6e03bce6f Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 15 Jan 2016 14:45:39 +0530 Subject: [PATCH 30/40] optimize travis build --- .travis.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d00f2e3..dfe2162f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,44 +37,31 @@ script: - sudo ee site create mysql.com --mysql - sudo ee site create site1.com --wp - - sudo ee site create site2.com --wpsc - sudo ee site create site2.net --wp --wpsc - - sudo ee site create site2.org --wpsc --wp - - sudo ee site create site3.com --w3tc - sudo ee site create site3.net --wp --w3tc - - sudo ee site create site3.org --w3tc --wp - sudo ee site create site4.com --wpfc - sudo ee site create site4.net --wp --wpfc - sudo ee site create site4.org --wpfc --wp - sudo ee site create site5.com --wpsubdir - - sudo ee site create site5.net --wpsubdir - sudo ee site create site6.com --wpsubdir --wpsc - - sudo ee site create site6.net --wpsc --wpsubdir - sudo ee site create site7.com --wpsubdir --w3tc - - sudo ee site create site7.net --w3tc --wpsubdir - sudo ee site create site8.com --wpsubdir --wpfc - sudo ee site create site8.net --wpfc --wpsubdir - sudo ee site create site9.com --wpsubdomain - sudo ee site create site10.org --wpsubdomain --wpsc - - sudo ee site create site10.in --wpsc --wpsubdomain - sudo ee site create site11.org --wpsubdomain --w3tc - - sudo ee site create site11.in --w3tc --wpsubdomain - sudo ee site create site12.org --wpsubdomain --wpfc - sudo ee site create site12.in --wpfc --wpsubdomain - - sudo ee site create site12.net --wpfc --wpsubdomain - yes | sudo ee site create site.hhvm.pagespeed2.com --wpsc --hhvm --pagespeed - - yes | sudo ee site create site.hhvm.pagespeed3.com --w3tc --hhvm --pagespeed - yes | sudo ee site create site.hhvm.pagespeed4.com --wpfc --hhvm --pagespeed - yes | sudo ee site create site.hhvm.pagespeed5.com --wpsubdir --hhvm --pagespeed - yes | sudo ee site create site.hhvm.pagespeed6.com --wpsubdir --wpsc --hhvm --pagespeed - - yes | sudo ee site create site.hhvm.pagespeed7.com --wpsubdir --w3tc --hhvm --pagespeed - yes | sudo ee site create site.hhvm.pagespeed8.com --wpsubdir --wpfc --hhvm --pagespeed - yes | sudo ee site create site.hhvm.pagespeed9.com --wpsubdomain --hhvm --pagespeed - yes | sudo ee site create site.hhvm.pagespeed10.org --wpsubdomain --wpsc --hhvm --pagespeed - - yes | sudo ee site create site.hhvm.pagespeed11.in --w3tc --wpsubdomain --hhvm --pagespeed - yes | sudo ee site create site.hhvm.pagespeed12.in --wpfc --wpsubdomain --hhvm --pagespeed - sudo ee site create site.localtest.me --php --mysql --html @@ -106,11 +93,9 @@ script: - yes | sudo ee site update site1.com --wpredis - sudo ee site update site5.com --wpsubdir --wpfc - - sudo ee site update site5.com --wpsubdir --w3tc - sudo ee site update site5.com --wpsubdir --wpsc - sudo ee site update site9.com --wpsubdomain --wpfc - - sudo ee site update site9.com --wpsubdomain --w3tc - sudo ee site update site9.com --wpsubdomain --wpsc - yes | sudo ee site update site.hhvm.pagespeed12.in --pagespeed=off --hhvm=off - yes | sudo ee site update site9.com --hhvm --pagespeed @@ -124,7 +109,6 @@ script: - sudo ee site delete site12.in --all --no-prompt - sudo ee site delete site12.net --no-prompt - - sudo ee site delete site9.com --no-prompt - echo "yes" | sudo ee stack install --nginxmainline - nginx -v From 0bd6c3ea9e422313acea4f75eb53af89d4a42fe7 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 15 Jan 2016 15:00:45 +0530 Subject: [PATCH 31/40] optimize travis build --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dfe2162f..310ea6fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -108,7 +108,6 @@ script: - sudo ee site delete www.subsite.site-1.com --all --no-prompt - sudo ee site delete site12.in --all --no-prompt - - sudo ee site delete site12.net --no-prompt - echo "yes" | sudo ee stack install --nginxmainline - nginx -v From 4514b47158aa463ae5a429d72088afb2d93bf97d Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 18 Jan 2016 18:51:55 +0530 Subject: [PATCH 32/40] create cron backup before editing --- install | 1 + 1 file changed, 1 insertion(+) diff --git a/install b/install index cdb7dd51..dd08b8dd 100644 --- a/install +++ b/install @@ -528,6 +528,7 @@ function ee_update_latest() #Fix for SSL cert --all crontab -l | grep -q '\-\-min_expiry_limit' if [[ $? -eq 0 ]]; then + crontab -l > /var/spool/cron/cron-backup.txt #backup cron before editing crontab -l | sed '/--min_expiry_limit/d' | crontab - crontab -l 2> /dev/null | ( cat; echo -e "\n0 0 * * 0 ee site update --le=renew --all 2> /dev/null # Renew all letsencrypt SSL cert. Set by EasyEngine "; ) | crontab - fi From 2fd922f517236d18eb367d3ce40ac42c6a6602b2 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 18 Jan 2016 18:52:31 +0530 Subject: [PATCH 33/40] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 310ea6fd..663d291d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,6 @@ script: - yes | sudo ee site create site.hhvm.pagespeed10.org --wpsubdomain --wpsc --hhvm --pagespeed - yes | sudo ee site create site.hhvm.pagespeed12.in --wpfc --wpsubdomain --hhvm --pagespeed - - sudo ee site create site.localtest.me --php --mysql --html - sudo ee site create site1.localtest.me --php --mysql - sudo ee site create site2.localtest.me --mysql --html - sudo ee site create site3.localtest.me --php --html From 477514df68c6144d225957e271333f00ee842e88 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 18 Jan 2016 19:50:23 +0530 Subject: [PATCH 34/40] fix for precise --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index dd08b8dd..95194a5e 100644 --- a/install +++ b/install @@ -530,7 +530,7 @@ function ee_update_latest() if [[ $? -eq 0 ]]; then crontab -l > /var/spool/cron/cron-backup.txt #backup cron before editing crontab -l | sed '/--min_expiry_limit/d' | crontab - - crontab -l 2> /dev/null | ( cat; echo -e "\n0 0 * * 0 ee site update --le=renew --all 2> /dev/null # Renew all letsencrypt SSL cert. Set by EasyEngine "; ) | crontab - + /bin/bash -c "crontab -l 2> /dev/null | { cat; echo -e \"\n0 0 * * 0 ee site update --le=renew --all 2> /dev/null # Renew all letsencrypt SSL cert. Set by EasyEngine\"; } | crontab -" fi From 16b7bc9de373ea84750acf6e0e116e77737f1465 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 19 Jan 2016 14:34:28 +0530 Subject: [PATCH 35/40] Fix for HHVM with LE --- ee/cli/plugins/site.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 78f2f5d2..8be95629 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1301,7 +1301,7 @@ class EESiteUpdateController(CementBaseController): if 'proxy' in data.keys() and data['proxy']: updateSiteInfo(self, ee_domain, stype=stype, cache=cache, - hhvm=hhvm, pagespeed=pagespeed) + hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False) Log.info(self, "Successfully updated site" " http://{0}".format(ee_domain)) return 0 @@ -1372,7 +1372,7 @@ class EESiteUpdateController(CementBaseController): "check issues with `nginx -t` command") updateSiteInfo(self, ee_domain, stype=stype, cache=cache, - hhvm=hhvm, pagespeed=pagespeed) + hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False) Log.info(self, "Successfully updated site" " http://{0}".format(ee_domain)) @@ -1590,10 +1590,10 @@ class EESiteUpdateController(CementBaseController): db_user=data['ee_db_user'], db_password=data['ee_db_pass'], db_host=data['ee_db_host'], hhvm=hhvm, - pagespeed=pagespeed) + pagespeed=pagespeed,ssl=True if check_site.is_ssl else False) else: updateSiteInfo(self, ee_domain, stype=stype, cache=cache, - hhvm=hhvm, pagespeed=pagespeed) + hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False) Log.info(self, "Successfully updated site" " http://{0}".format(ee_domain)) return 0 From 2517d7e947c2b0e8791d014b08beac98eb4d0fee Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 20 Jan 2016 12:55:41 +0530 Subject: [PATCH 36/40] Fix nginx mainline upgrade on stack updrade --- ee/cli/plugins/stack_upgrade.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack_upgrade.py b/ee/cli/plugins/stack_upgrade.py index 7f2488c0..c3887fad 100644 --- a/ee/cli/plugins/stack_upgrade.py +++ b/ee/cli/plugins/stack_upgrade.py @@ -32,6 +32,8 @@ class EEStackUpgradeController(CementBaseController): dict(help='Upgrade mail scanner stack', action='store_true')), (['--nginx'], dict(help='Upgrade Nginx stack', action='store_true')), + (['--nginxmainline'], + dict(help='Upgrade Nginx Mainline stack', action='store_true')), (['--php'], dict(help='Upgrade PHP stack', action='store_true')), (['--mysql'], @@ -139,9 +141,11 @@ class EEStackUpgradeController(CementBaseController): else: Log.info(self, "Mail server is not installed") - if self.app.pargs.nginx: + if self.app.pargs.nginx or self.app.pargs.nginxmainline: if EEAptGet.is_installed(self, 'nginx-custom'): apt_packages = apt_packages + EEVariables.ee_nginx + elif EEAptGet.is_installed(self, 'nginx-mainline'): + apt_packages = apt_packages + EEVariables.ee_nginx_dev else: Log.info(self, "Nginx is not already installed") From 09645db0260f4c6aaa317157bd7a5fbbdd6211ad Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 20 Jan 2016 13:02:00 +0530 Subject: [PATCH 37/40] Add nginx mainline to restart on upgrade --- ee/cli/plugins/stack_upgrade.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack_upgrade.py b/ee/cli/plugins/stack_upgrade.py index c3887fad..6bc04dbb 100644 --- a/ee/cli/plugins/stack_upgrade.py +++ b/ee/cli/plugins/stack_upgrade.py @@ -214,7 +214,8 @@ class EEStackUpgradeController(CementBaseController): EEAptGet.install(self, apt_packages) # Post Actions after package updates - if set(EEVariables.ee_nginx).issubset(set(apt_packages)): + if (set(EEVariables.ee_nginx).issubset(set(apt_packages)) or + set(EEVariables.ee_nginx_dev).issubset(set(apt_packages))): EEService.restart_service(self, 'nginx') if set(EEVariables.ee_php).issubset(set(apt_packages)): EEService.restart_service(self, 'php5-fpm') From 9a51cc8249aebac343aa533650d041daa64ee682 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 20 Jan 2016 13:23:44 +0530 Subject: [PATCH 38/40] Fix stack upgrade --nginxmainline --- ee/cli/plugins/stack_upgrade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack_upgrade.py b/ee/cli/plugins/stack_upgrade.py index 6bc04dbb..815bc054 100644 --- a/ee/cli/plugins/stack_upgrade.py +++ b/ee/cli/plugins/stack_upgrade.py @@ -114,7 +114,7 @@ class EEStackUpgradeController(CementBaseController): (not self.app.pargs.php) and (not self.app.pargs.mysql) and (not self.app.pargs.postfix) and (not self.app.pargs.hhvm) and (not self.app.pargs.mailscanner) and (not self.app.pargs.all) - and (not self.app.pargs.wpcli) and (not self.app.pargs.redis)): + and (not self.app.pargs.wpcli) and (not self.app.pargs.redis) and (not self.app.pargs.nginxmainline)): self.app.pargs.web = True if self.app.pargs.all: From ca19fc67192d59f3112e89f0e808e061cc69e7b9 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 20 Jan 2016 13:32:16 +0530 Subject: [PATCH 39/40] Add nginx mainline to restart on upgrade --- ee/cli/plugins/stack_upgrade.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/stack_upgrade.py b/ee/cli/plugins/stack_upgrade.py index 815bc054..4801b7b1 100644 --- a/ee/cli/plugins/stack_upgrade.py +++ b/ee/cli/plugins/stack_upgrade.py @@ -122,7 +122,12 @@ class EEStackUpgradeController(CementBaseController): self.app.pargs.mail = True if self.app.pargs.web: - self.app.pargs.nginx = True + if EEAptGet.is_installed(self, 'nginx-custom'): + self.app.pargs.nginx = True + elif EEAptGet.is_installed(self, 'nginx-mainline'): + self.app.pargs.nginxmainline = True + else: + Log.info(self, "Nginx is not already installed") self.app.pargs.php = True self.app.pargs.mysql = True self.app.pargs.postfix = True @@ -141,13 +146,17 @@ class EEStackUpgradeController(CementBaseController): else: Log.info(self, "Mail server is not installed") - if self.app.pargs.nginx or self.app.pargs.nginxmainline: + if self.app.pargs.nginx : if EEAptGet.is_installed(self, 'nginx-custom'): apt_packages = apt_packages + EEVariables.ee_nginx - elif EEAptGet.is_installed(self, 'nginx-mainline'): + else: + Log.info(self, "Nginx Stable is not already installed") + + if self.app.pargs.nginxmainline: + if EEAptGet.is_installed(self, 'nginx-mainline'): apt_packages = apt_packages + EEVariables.ee_nginx_dev else: - Log.info(self, "Nginx is not already installed") + Log.info(self, "Nginx Mainline is not already installed") if self.app.pargs.php: if EEAptGet.is_installed(self, 'php5-fpm'): From f7f01ae953f55c92cdec18cc4b42cce6a57fdcf4 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 20 Jan 2016 15:26:51 +0530 Subject: [PATCH 40/40] Update changelog. Fix #665 Fix #659 --- CHANGELOG.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d990aedb..63cbd36b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,10 @@ -v3.4.0 - Jan 6, 2015 +v3.4.1 - Jan 20, 2016 +- Fixed and update ee stack install --nginx/--nginxmainline +- Fixed --letsencrypt minor issues +- Fixed #665 #659 +- Fixed other minor bug + +v3.4.0 - Jan 6, 2016 - Added Let's Encrypt support - ee site create example.com [--wp/..] --letsencrypt - ee site update example.com --letsencrypt=on/off/renew