diff --git a/lib/install b/lib/install index be1ed91..c02bfa3 100644 --- a/lib/install +++ b/lib/install @@ -3,7 +3,7 @@ source /opt/webinoly/lib/general app_version() { - local app_ver="1.5.1-beta" + local app_ver="1.5.1" echo $app_ver } svr_version() { diff --git a/lib/update b/lib/update index a6f346f..23cd885 100644 --- a/lib/update +++ b/lib/update @@ -39,29 +39,20 @@ must-staple = True" | tee -a /etc/letsencrypt/cli.ini done fi - # Update nginx and php conf files - serupd=1 - } oneone_to_onetwo() { # Forgot doing it in 1.1 update sudo apt-get -y install zip - - # Update nginx and php conf files - serupd=1 } -# Update-Server Flag -serupd=0 - # Version numbers without point [[ ${oldver//.} -lt 11 ]] && onezero_to_oneone > /dev/null 2>&1 & [[ ${oldver//.} -lt 12 ]] && oneone_to_onetwo > /dev/null 2>&1 & -[[ $serupd == 1 ]] && sudo webinoly -server-update +sudo webinoly -server-reset echo "${gre}Your server-configuration has been successfully updated!${end}" diff --git a/lib/webin b/lib/webin index 4c813a3..15d2124 100644 --- a/lib/webin +++ b/lib/webin @@ -7,7 +7,7 @@ webinoly_verify() { local error="0" local warning="0" local info="0" - echo "${gre}Verifying integrity of the entire Webinoly system... ${end}" + echo "${blu}Verifying integrity of the entire Webinoly system..." echo "${red}" # Webinoly @@ -111,16 +111,16 @@ webinoly_verify() { echo "[ERROR] File: /opt/webinoly/templates/nginx/common/wpsubdir.conf not found!" error="1" fi - if [[ ! -a /opt/webinoly/templates/nginx/common/headers-html ]]; then - echo "[ERROR] File: /opt/webinoly/templates/nginx/common/wpsubdir.conf not found!" + if [[ ! -a /opt/webinoly/templates/nginx/common/headers-html.conf ]]; then + echo "[ERROR] File: /opt/webinoly/templates/nginx/common/headers-html.conf not found!" error="1" fi - if [[ ! -a /opt/webinoly/templates/nginx/common/headers-http ]]; then - echo "[ERROR] File: /opt/webinoly/templates/nginx/common/wpsubdir.conf not found!" + if [[ ! -a /opt/webinoly/templates/nginx/common/headers-http.conf ]]; then + echo "[ERROR] File: /opt/webinoly/templates/nginx/common/headers-http.conf not found!" error="1" fi - if [[ ! -a /opt/webinoly/templates/nginx/common/headers-https ]]; then - echo "[ERROR] File: /opt/webinoly/templates/nginx/common/wpsubdir.conf not found!" + if [[ ! -a /opt/webinoly/templates/nginx/common/headers-https.conf ]]; then + echo "[ERROR] File: /opt/webinoly/templates/nginx/common/headers-https.conf not found!" error="1" fi if [[ ! -a /opt/webinoly/webinoly.conf ]]; then @@ -216,16 +216,16 @@ webinoly_verify() { echo "[ERROR] File: /etc/nginx/common/wpsubdir.conf not found!" error="1" fi - if [[ ! -a /etc/nginx/common/headers-html ]]; then - echo "[ERROR] File: /etc/nginx/common/wpsubdir.conf not found!" + if [[ ! -a /etc/nginx/common/headers-html.conf ]]; then + echo "[ERROR] File: /etc/nginx/common/headers-html.conf not found!" error="1" fi - if [[ ! -a /etc/nginx/common/headers-http ]]; then - echo "[ERROR] File: /etc/nginx/common/wpsubdir.conf not found!" + if [[ ! -a /etc/nginx/common/headers-http.conf ]]; then + echo "[ERROR] File: /etc/nginx/common/headers-http.conf not found!" error="1" fi - if [[ ! -a /etc/nginx/common/headers-https ]]; then - echo "[ERROR] File: /etc/nginx/common/wpsubdir.conf not found!" + if [[ ! -a /etc/nginx/common/headers-https.conf ]]; then + echo "[ERROR] File: /etc/nginx/common/headers-https.conf not found!" error="1" fi fi @@ -296,7 +296,7 @@ webinoly_verify() { fi # PHP Tools - if [[ $(conf_read php-tool) == "true" ]]; then + if [[ $(conf_read php-tool) == "true" && $(conf_read nginx) == "true" ]]; then if [[ ! -a /var/www/$(conf_read tools-port)/htdocs/fpm/status/php ]]; then echo "[ERROR] File: /var/www/$(conf_read tools-port)/htdocs/fpm/status/php not found!" error="1" @@ -310,7 +310,7 @@ webinoly_verify() { error="1" fi fi - if [[ $(conf_read php-tool) != "true" ]]; then + if [[ $(conf_read php-tool) != "true" && $(conf_read nginx) == "true" ]]; then if [[ -a /var/www/$(conf_read tools-port)/htdocs/fpm/status/php ]]; then echo "[WARNING] Seems like PHP Tools are enabled but Webinoly can not detect it!" warning="1" @@ -398,7 +398,8 @@ webinoly_verify() { echo "*********************************************************************************************************** ${end}" exit 2 else - echo "${gre} Integrity test passed!! ${end}" + echo "${gre}Integrity test passed!! ${end}" + exit 0 fi } diff --git a/plugins/webinoly b/plugins/webinoly index 1d98bbe..7902246 100644 --- a/plugins/webinoly +++ b/plugins/webinoly @@ -105,11 +105,13 @@ elif [[ $opt == "-login-www-data" ]]; then sudo usermod -G sftponly www-data sudo chown root:root /var/www sudo sed -i "/Subsystem sftp/c\Subsystem sftp internal-sftp" /etc/ssh/sshd_config - sudo echo 'Match Group sftponly - ChrootDirectory /var/www - X11Forwarding no - AllowTcpForwarding no - ForceCommand internal-sftp' >> /etc/ssh/sshd_config + sudo echo '# WebinolySFTPstart +Match Group sftponly +ChrootDirectory /var/www +X11Forwarding no +AllowTcpForwarding no +ForceCommand internal-sftp +# WebinolySFTPend' >> /etc/ssh/sshd_config falus=$( grep -F "AllowUsers" /etc/ssh/sshd_config ) if [[ -n $falus ]]; then @@ -118,7 +120,7 @@ elif [[ $opt == "-login-www-data" ]]; then conf_write login-www-data true sudo service ssh restart - echo "${gre} SFTP access for www-data user has been successfuly enabled! ${end}" + echo "${gre}SFTP access for www-data user has been successfuly enabled! ${end}" elif [[ $opt == "-nologin-www-data" ]]; then @@ -137,6 +139,7 @@ elif [[ $opt == "-nologin-www-data" ]]; then sudo delgroup sftponly sudo chown www-data:www-data /var/www sudo sed -i "/Subsystem sftp/c\Subsystem sftp \/usr\/lib\/openssh\/sftp-server" /etc/ssh/sshd_config + sudo sed -i '/WebinolySFTPstart/,/WebinolySFTPstart/{/.*/d}' /etc/ssh/sshd_config falus=$( grep -F "AllowUsers" /etc/ssh/sshd_config ) if [[ -n $falus ]]; then @@ -147,7 +150,7 @@ elif [[ $opt == "-nologin-www-data" ]]; then conf_write login-www-data purged sudo service ssh restart - echo "${gre} SFTP access for www-data user has been successfuly disabled! ${end}" + echo "${gre}SFTP access for www-data user has been successfuly disabled! ${end}" elif [[ $opt == "-config-cache" ]]; then diff --git a/weby b/weby index 2a877ab..25bd1ce 100644 --- a/weby +++ b/weby @@ -47,7 +47,7 @@ if [[ $2 == "-ver="* ]]; then webyversion="$ver" [[ $ver == "beta" ]] && echo "[WARNING] You are installing a BETA version of Webinoly and it's not recommended for production enviroments." # Just for stadistics - sudo wget --timeout=15 --spider --referer="https://webinoly.com/?version=${ver}" -q https://qrok.es/wyver + [[ $ver != "alpha" ]] && sudo wget --timeout=15 --spider --referer="https://webinoly.com/?version=${ver}" -q https://qrok.es/wyver else echo "[ERROR] Version not found or not available! ($code) $(tput sgr0)" exit 1 @@ -73,6 +73,7 @@ if [[ -a $HOME/.webinoly-conf-restore_dont-remove ]]; then echo "${gre}Seems like Webinoly was installed previously, we will try to recover your old configuration!${end}" sudo mv $HOME/.webinoly-conf-restore_dont-remove /opt/webinoly/webinoly.conf sudo webinoly -verify + [[ $? == 1 ]] && exit 1 fi # Check for Server Conf Updates and Save Tools Port after library is available.