Skip to content

Commit

Permalink
fix after testing
Browse files Browse the repository at this point in the history
- auto-update process not runnign server-reset.
- typos in some check paths in verify command.
- login www-data not deleting some data after disabled.
- Remove statistics for alpha versions.
- exit after verify fails when conf file found during re-installation process.
  • Loading branch information
QROkes committed Jul 9, 2018
1 parent 97887cf commit 7e51c04
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 35 deletions.
2 changes: 1 addition & 1 deletion lib/install
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
11 changes: 1 addition & 10 deletions lib/update
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
33 changes: 17 additions & 16 deletions lib/webin
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
}

Expand Down
17 changes: 10 additions & 7 deletions plugins/webinoly
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion weby
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 7e51c04

Please sign in to comment.