From 946da7128b1420fddf4d0f1d1df5b21b2a332a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Wed, 27 Jun 2018 18:28:50 -0600 Subject: [PATCH] small fixes After testing and before release: - now we don't need to change cgi.fix_pathinfo in PHP. - fixed update process. - better wp-admin security. - fixed auto-stack installation process --- lib/install | 8 +++++--- lib/update | 8 ++++---- plugins/site | 2 +- plugins/webinoly | 10 +++++----- weby | 4 ++-- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/install b/lib/install index 35423a2..480687e 100644 --- a/lib/install +++ b/lib/install @@ -3,7 +3,7 @@ source /opt/webinoly/lib/general app_version() { - local app_ver="1.5.0-beta" + local app_ver="1.5.0" echo $app_ver } svr_version() { @@ -303,7 +303,9 @@ php_optim() { local maxuploads="100" fi - sudo sed -i '/cgi.fix_pathinfo=/c\cgi.fix_pathinfo=0' /etc/php/$ver/fpm/php.ini + # Not needed anymore! https://serverfault.com/questions/627903/is-the-php-option-cgi-fix-pathinfo-really-dangerous-with-nginx-php-fpm + #sudo sed -i '/cgi.fix_pathinfo=/c\cgi.fix_pathinfo=0' /etc/php/$ver/fpm/php.ini + sudo sed -i '/memory_limit =/c\memory_limit = 128M' /etc/php/$ver/fpm/php.ini sudo sed -i '/max_execution_time =/c\max_execution_time = 300' /etc/php/$ver/fpm/php.ini sudo sed -i '/expose_php =/c\expose_php = Off' /etc/php/$ver/fpm/php.ini @@ -530,7 +532,7 @@ swap_create() { sudo sed -i "/LABEL.*/a \/swapfile none swap sw 0 0" /etc/fstab echo 10 | sudo tee /proc/sys/vm/swappiness - echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf + echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf # Swap created by Webinoly - so we should remove it in uninstall conf_write swap-owner webinoly diff --git a/lib/update b/lib/update index 102aa51..50cfd6f 100644 --- a/lib/update +++ b/lib/update @@ -1,9 +1,8 @@ #!/bin/bash echo "${red}" -echo "Your server configuration will be updated and all changes you manually made will be lost!!" -echo "${blu}Current server version '$oldver' will be upgraded to the newest '$newver'" -echo "Wait...${end}" +echo "Your server configuration will be updated and all changes you manually did will be lost!!" +echo "${blu}Current server version 'v$oldver' will be upgraded to the newest 'v$newver'. Wait...${end}" onezero_to_oneone() { @@ -40,6 +39,7 @@ must-staple = True" | tee -a /etc/letsencrypt/cli.ini done fi + # Update nginx and php conf files sudo webinoly -server-update } @@ -47,5 +47,5 @@ must-staple = True" | tee -a /etc/letsencrypt/cli.ini # Version numbers without point [[ ${newver//.} -ge 11 ]] && onezero_to_oneone > /dev/null 2>&1 & -echo "${blu}Done!" + echo "${gre}Your server-configuration has been successfully updated!${end}" diff --git a/plugins/site b/plugins/site index 8113913..165826c 100644 --- a/plugins/site +++ b/plugins/site @@ -244,7 +244,7 @@ elif [ "$type" == "-parked" ]; then # Reverse proxy elif [[ "$type" == "-proxy" ]]; then createsite - sudo sed -i '/php.conf;/d' /etc/nginx/sites-available/$domain + sudo sed -i '/include /d' /etc/nginx/sites-available/$domain sudo sed -i '/root /d' /etc/nginx/sites-available/$domain sudo sed -i '/index /d' /etc/nginx/sites-available/$domain sudo sed -i '/error_log /r /opt/webinoly/templates/template-site-proxy' /etc/nginx/sites-available/$domain diff --git a/plugins/webinoly b/plugins/webinoly index 9994192..9e2d3f9 100644 --- a/plugins/webinoly +++ b/plugins/webinoly @@ -33,11 +33,11 @@ elif [[ $opt == "-server-update" || $opt == "-server-reset" ]]; then if [[ $(conf_read nginx-optim) == "true" && ( $value == "nginx" || $value = "all" ) ]]; then sudo rm -rf /etc/nginx/common sudo rm -rf /etc/nginx/conf.d/* - linux_purge > /dev/null 2>&1 & + linux_purge nginx_optim > /dev/null 2>&1 & - echo "${gre}Nginx has been updated successfully!${end}" + echo "${gre}Nginx settings has been updated successfully!${end}" elif [[ $(conf_read nginx-optim) != "true" && ( $value == "nginx" || $value = "all" ) ]]; then - echo "${red}Seems like Nginx is not installed in your server!${end}" + echo "${red}Nginx settings couldn't been updated, seems like is not installed in your server!${end}" fi # Regenerate PHP conf files @@ -46,9 +46,9 @@ elif [[ $opt == "-server-update" || $opt == "-server-reset" ]]; then sudo cat /opt/webinoly/templates/source/www.conf > /etc/php/$(conf_read php-ver)/fpm/pool.d/www.conf sudo rm /etc/php/$(conf_read php-ver)/fpm/pool.d/debug.conf php_optim - echo "${gre}PHP has been updated successfully!${end}" + echo "${gre}PHP settings has been updated successfully!${end}" elif [[ $(conf_read php-optim) != "true" && ( $value == "php" || $value = "all" ) ]]; then - echo "${red}Seems like PHP is not installed in your server!${end}" + echo "${red}PHP settings couldn't been updated, seems like is not installed in your server!${end}" fi diff --git a/weby b/weby index c0d433e..8f3503a 100644 --- a/weby +++ b/weby @@ -90,8 +90,8 @@ conf_write app-version $webyversion # Stack installation -[[ $setup -gt 0 && $setup -lt 3 ]] && stack -nginx -[[ $setup -gt 1 && $setup -lt 3 ]] && stack -php +[[ $setup -gt 0 && $setup -le 3 ]] && stack -nginx +[[ $setup -gt 1 && $setup -le 3 ]] && stack -php [[ $setup == 3 ]] && stack -mysql