Minor fixes and tweaks.
Log command code refactored, messages improved, HTTPS links, Ondrej repo ppa key fixed, source folder issue.
This commit is contained in:
parent
13d9025391
commit
43a90a1dfd
|
@ -20,12 +20,12 @@ sudo site example.com -wp
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
For complete documentation, please [visit our site](https://qrokes.com/webinoly/).
|
For complete documentation, please [visit our site](https://webinoly.com/).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
Please open an issue first to discuss what you would like to change.
|
Please open an issue first to discuss what you would like to change.
|
||||||
|
|
||||||
Also, you can visit our [Community Support Forum](https://qrokes.com/support/)
|
Also, you can visit our [Community Support Forum](https://webinoly.com/support/)
|
||||||
|
|
||||||
## Donations
|
## Donations
|
||||||
[![PayPal Donations](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/gold-rect-paypal-60px.png)](https://www.paypal.me/qrokes)
|
[![PayPal Donations](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/gold-rect-paypal-60px.png)](https://www.paypal.me/qrokes)
|
||||||
|
|
19
lib/install
19
lib/install
|
@ -2,7 +2,7 @@
|
||||||
source /opt/webinoly/lib/general
|
source /opt/webinoly/lib/general
|
||||||
|
|
||||||
webinoly_version() {
|
webinoly_version() {
|
||||||
conf_write app-version 1.0.0
|
conf_write app-version 1.0.1
|
||||||
}
|
}
|
||||||
server_version() {
|
server_version() {
|
||||||
conf_write server-version 1.0
|
conf_write server-version 1.0
|
||||||
|
@ -98,13 +98,13 @@ linux_purge() {
|
||||||
|
|
||||||
messagend_install() {
|
messagend_install() {
|
||||||
echo "${gre}*****************************************************************************************"
|
echo "${gre}*****************************************************************************************"
|
||||||
echo "************ LA INSTALACIÓN HA FINALIZADO CON ÉXITO ************"
|
echo "************ INSTALLATION HAS FINISHED SUCCESSFULLY ************"
|
||||||
echo "*****************************************************************************************${end}"
|
echo "*****************************************************************************************${end}"
|
||||||
if [[ $1 == "dbpass" ]]; then
|
if [[ $1 == "dbpass" ]]; then
|
||||||
local rootpass=$( echo $(conf_read mysql-root) | openssl enc -d -a -salt )
|
local rootpass=$( echo $(conf_read mysql-root) | openssl enc -d -a -salt )
|
||||||
local adminpass=$( echo $(conf_read mysql-admin) | openssl enc -d -a -salt )
|
local adminpass=$( echo $(conf_read mysql-admin) | openssl enc -d -a -salt )
|
||||||
echo "${gre}*****************************************************************************************"
|
echo "${gre}*****************************************************************************************"
|
||||||
echo "************ Guarda tus claves de acceso para la DB: ************"
|
echo "************ Save your DB access password in a secure place: ************"
|
||||||
echo "************ root: ${rootpass} admin: ${adminpass} ************"
|
echo "************ root: ${rootpass} admin: ${adminpass} ************"
|
||||||
echo "*****************************************************************************************"
|
echo "*****************************************************************************************"
|
||||||
echo "${end}"
|
echo "${end}"
|
||||||
|
@ -134,7 +134,9 @@ php_install() {
|
||||||
fi
|
fi
|
||||||
ver=$(conf_read php-ver)
|
ver=$(conf_read php-ver)
|
||||||
|
|
||||||
sudo add-apt-repository -y 'ppa:ondrej/php'
|
# Fix ondrej issue - https://github.com/oerdnj/deb.sury.org/issues/56
|
||||||
|
sudo apt-get install -y language-pack-en-base
|
||||||
|
sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install php${ver}-fpm php${ver}-curl php${ver}-gd php${ver}-imap php${ver}-mcrypt php${ver}-readline php${ver}-common php${ver}-recode php${ver}-mysql php${ver}-cli php${ver}-mbstring php${ver}-bcmath php${ver}-mysql php${ver}-opcache php${ver}-zip php${ver}-xml php-memcached php-imagick php-memcache memcached graphviz php-pear php-xdebug php-msgpack php${ver}-soap unzip pwgen
|
sudo apt-get -y install php${ver}-fpm php${ver}-curl php${ver}-gd php${ver}-imap php${ver}-mcrypt php${ver}-readline php${ver}-common php${ver}-recode php${ver}-mysql php${ver}-cli php${ver}-mbstring php${ver}-bcmath php${ver}-mysql php${ver}-opcache php${ver}-zip php${ver}-xml php-memcached php-imagick php-memcache memcached graphviz php-pear php-xdebug php-msgpack php${ver}-soap unzip pwgen
|
||||||
|
|
||||||
|
@ -360,7 +362,7 @@ mysql_tool() {
|
||||||
app_install() {
|
app_install() {
|
||||||
|
|
||||||
#Download and install/update Webinoly
|
#Download and install/update Webinoly
|
||||||
sudo curl -o $HOME/webinoly.tar http://dl.qrokes.com/webinoly/webinoly.tar
|
sudo curl -o $HOME/webinoly.tar -L https://qrok.es/wytar
|
||||||
sudo tar -xf $HOME/webinoly.tar -C /opt/webinoly --overwrite
|
sudo tar -xf $HOME/webinoly.tar -C /opt/webinoly --overwrite
|
||||||
sudo find /opt/webinoly -type d -exec chmod 755 {} \;
|
sudo find /opt/webinoly -type d -exec chmod 755 {} \;
|
||||||
sudo find /opt/webinoly -type f -exec chmod 644 {} \;
|
sudo find /opt/webinoly -type f -exec chmod 644 {} \;
|
||||||
|
@ -615,17 +617,16 @@ webinoly_verify() {
|
||||||
echo "*******************************************************"
|
echo "*******************************************************"
|
||||||
echo "******** ${gre}> > > E R R O R < < <${red} ***********"
|
echo "******** ${gre}> > > E R R O R < < <${red} ***********"
|
||||||
echo "******** ${gre}System could not work properly${red} ***********"
|
echo "******** ${gre}System could not work properly${red} ***********"
|
||||||
echo "*******************************************************"
|
echo "******************************************************* ${end}"
|
||||||
exit 1
|
exit 1
|
||||||
elif [ $warning != 0 ]; then
|
elif [ $warning != 0 ]; then
|
||||||
echo "***********************************************************************************************************"
|
echo "***********************************************************************************************************"
|
||||||
echo "******** ${gre}[ W A R N I N G ] System seems to be corrupted and could not work properly${red} ***********"
|
echo "******** ${gre}[ W A R N I N G ] System seems to be corrupted and could not work properly${red} ***********"
|
||||||
echo "***********************************************************************************************************"
|
echo "*********************************************************************************************************** ${end}"
|
||||||
exit 2
|
exit 2
|
||||||
else
|
else
|
||||||
echo "${gre} Integrity test passed!!"
|
echo "${gre} Integrity test passed!! ${end}"
|
||||||
fi
|
fi
|
||||||
echo "${end}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
16
lib/site-ssl
16
lib/site-ssl
|
@ -13,13 +13,15 @@ site_ssl_on() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${gre}"
|
echo "${gre}"
|
||||||
echo "***********************************************************************************************"
|
echo "*************************************************************************************************"
|
||||||
echo "** Please, be careful with the number of intents or certificates you try to get. **"
|
echo "** Please, be careful with the number of intents or certificates you try to get. **"
|
||||||
echo "** Let’s Encrypt provides rate limits to ensure fair usage by as many people as possible. **"
|
echo "** Let’s Encrypt provides rate limits to ensure fair usage by as many people as possible. **"
|
||||||
echo "** **"
|
echo "** **"
|
||||||
echo "** If you are getting errors or having issues when trying to get a new certificate **"
|
echo "** If you are getting errors or having issues when trying to get a new certificate **"
|
||||||
echo "** read about the Let's Encrypt rate limit - https://letsencrypt.org/docs/rate-limits/ **"
|
echo "** read about the Let's Encrypt rate limit - https://letsencrypt.org/docs/rate-limits/ **"
|
||||||
echo "***********************************************************************************************"
|
echo "** **"
|
||||||
|
echo "** Please, be sure your domain and www subdomain are currently pointing (DNS) to this server **"
|
||||||
|
echo "*************************************************************************************************"
|
||||||
|
|
||||||
# We need an email to notify each renew intent (cron)
|
# We need an email to notify each renew intent (cron)
|
||||||
while [[ -z $cermail ]]
|
while [[ -z $cermail ]]
|
||||||
|
|
|
@ -8,11 +8,14 @@ source /opt/webinoly/lib/general
|
||||||
|
|
||||||
nginx_helper_plugin() {
|
nginx_helper_plugin() {
|
||||||
# Download WP (latest version)
|
# Download WP (latest version)
|
||||||
sudo curl -o /var/www/$domain/htdocs/nginx-helper-plugin.zip https://downloads.wordpress.org/plugin/nginx-helper.latest-stable.zip
|
sudo curl -o /var/www/$domain/htdocs/nginx-helper-plugin.zip https://downloads.wordpress.org/plugin/nginx-helper.latest-stable.zip 2>/dev/null
|
||||||
sudo unzip /var/www/$domain/htdocs/nginx-helper-plugin.zip -d /var/www/$domain/htdocs/wp-content/plugins/
|
sudo unzip -qq /var/www/$domain/htdocs/nginx-helper-plugin.zip -d /var/www/$domain/htdocs/wp-content/plugins/
|
||||||
sudo rm /var/www/$domain/htdocs/nginx-helper-plugin.zip
|
sudo rm /var/www/$domain/htdocs/nginx-helper-plugin.zip
|
||||||
echo ""
|
echo ""
|
||||||
echo "${gre} Nginx Helper Plugin has been installed! ${end}"
|
echo "${gre} Nginx Helper Plugin has been installed!"
|
||||||
|
echo " Please, activate this plugin for a better experience with FastCgi Cache."
|
||||||
|
echo "${blu}It is important to configure the Purge Method of the plugin as “Delete local server cache file”, the support for the purge/url method has been disabled because it is considered a security risk. Similarly, the “Caching Method” should be set to “Nginx FastCgi Cache”. ${end}"
|
||||||
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
60
plugins/log
60
plugins/log
|
@ -9,23 +9,39 @@ source /opt/webinoly/lib/general
|
||||||
domain="$1"
|
domain="$1"
|
||||||
opt="$2"
|
opt="$2"
|
||||||
|
|
||||||
if [[ ! $(conf_read nginx) == "true" ]]; then
|
error() {
|
||||||
echo ""
|
echo ""
|
||||||
echo "${red} NGINX is required to view your logs properly! ${end}"
|
echo "${red} Log file not found!!! ${end}"
|
||||||
echo ""
|
echo ""
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
}
|
||||||
|
|
||||||
if [[ -z $opt ]]; then
|
if [[ -z $opt ]]; then
|
||||||
case "$domain" in
|
case "$domain" in
|
||||||
"-mail")
|
"-mail")
|
||||||
sudo tail -f /var/log/mail.log /var/log/mail.err
|
if [[ -a /var/log/mail.log && -a /var/log/mail.err ]]; then
|
||||||
|
sudo tail -f /var/log/mail.log /var/log/mail.err
|
||||||
|
elif [[ -a /var/log/mail.log ]]; then
|
||||||
|
sudo tail -f /var/log/mail.log
|
||||||
|
elif [[ -a /var/log/mail.err ]]; then
|
||||||
|
sudo tail -f /var/log/mail.err
|
||||||
|
else
|
||||||
|
error
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
"-fpm")
|
"-fpm"|"-php")
|
||||||
sudo tail -f /var/log/php/$(conf_read php-ver)/*.log
|
if [[ -a /var/log/php/$(conf_read php-ver)/fpm.log ]]; then
|
||||||
|
sudo tail -f /var/log/php/$(conf_read php-ver)/*.log
|
||||||
|
else
|
||||||
|
error
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
"-mysql")
|
"-mysql")
|
||||||
sudo tail -f /var/log/mysql/*.log
|
if [[ -a /var/log/mysql/error.log ]]; then
|
||||||
|
sudo tail -f /var/log/mysql/*.log
|
||||||
|
else
|
||||||
|
error
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
@ -40,34 +56,20 @@ fi
|
||||||
if [[ -n "$opt" && "$opt" != "-error" && "$opt" != "-wp" ]]; then
|
if [[ -n "$opt" && "$opt" != "-error" && "$opt" != "-wp" ]]; then
|
||||||
echo "${red} $opt is not a valid option!${end}"
|
echo "${red} $opt is not a valid option!${end}"
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ -z "$domain" && -n "$opt" && ! -a /var/log/nginx/error.log ]]; then
|
|
||||||
echo "${red}Error log file could not be retrieved!${end}"
|
|
||||||
exit 1
|
|
||||||
elif [[ -n "$domain" && -n "$opt" && ! -a /var/log/nginx/$domain.error.log ]]; then
|
|
||||||
echo "${red}Error log file could not be retrieved!${end}"
|
|
||||||
exit 1
|
|
||||||
elif [[ -z "$domain" && -z "$opt" && ! -a /var/log/nginx/access.log ]]; then
|
|
||||||
echo "${red}Access log file could not be retrieved!${end}"
|
|
||||||
exit 1
|
|
||||||
elif [[ -n "$domain" && -z "$opt" && ! -a /var/log/nginx/$domain.access.log ]]; then
|
|
||||||
echo "${red}Access log file could not be retrieved!${end}"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Show the correct log file
|
# Show the correct log file
|
||||||
if [[ "$opt" == "-error" && -z "$domain" ]]; then
|
if [[ "$opt" == "-error" && -z "$domain" && -a /var/log/nginx/error.log ]]; then
|
||||||
sudo tail -f /var/log/nginx/*error.log
|
sudo tail -f /var/log/nginx/*error.log
|
||||||
elif [[ "$opt" == "-error" && -n "$domain" ]]; then
|
elif [[ "$opt" == "-error" && -n "$domain" && -a /var/log/nginx/$domain.error.log ]]; then
|
||||||
sudo tail -f /var/log/nginx/$domain.error.log
|
sudo tail -f /var/log/nginx/$domain.error.log
|
||||||
elif [[ "$opt" == "-wp" && -n "$domain" ]]; then
|
elif [[ "$opt" == "-wp" && -n "$domain" && -a /var/www/$domain/htdocs/wp-content/debug.log ]]; then
|
||||||
if [[ -a /var/www/$domain/htdocs/wp-content/debug.log ]]; then
|
sudo tail -f /var/www/$domain/htdocs/wp-content/debug.log
|
||||||
sudo tail -f /var/www/$domain/htdocs/wp-content/debug.log
|
elif [[ -z "$domain" && -z "$opt" && -a /var/log/nginx/access.log ]]; then
|
||||||
else
|
|
||||||
echo "${red} Seems like debug is not enabled in your wp-config.php file! ${end}"
|
|
||||||
fi
|
|
||||||
elif [[ -z "$domain" && -z "$opt" ]]; then
|
|
||||||
sudo tail -f /var/log/nginx/*access.log
|
sudo tail -f /var/log/nginx/*access.log
|
||||||
elif [[ -n "$domain" && -z "$opt" ]]; then
|
elif [[ -n "$domain" && -z "$opt" && -a /var/log/nginx/$domain.access.log ]]; then
|
||||||
sudo tail -f /var/log/nginx/$domain.access.log
|
sudo tail -f /var/log/nginx/$domain.access.log
|
||||||
|
else
|
||||||
|
error
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -12,6 +12,7 @@ source /opt/webinoly/lib/install
|
||||||
if [ "$opt" == "-update" ]; then
|
if [ "$opt" == "-update" ]; then
|
||||||
app_install
|
app_install
|
||||||
app_purge
|
app_purge
|
||||||
|
webinoly_version
|
||||||
echo ""
|
echo ""
|
||||||
echo "${gre}Webinoly App has been updated successfully!${end}"
|
echo "${gre}Webinoly App has been updated successfully!${end}"
|
||||||
elif [[ "$opt" == "-server-update" || "$opt" == "-server-reset" ]]; then
|
elif [[ "$opt" == "-server-update" || "$opt" == "-server-reset" ]]; then
|
||||||
|
@ -32,7 +33,6 @@ elif [[ "$opt" == "-server-update" || "$opt" == "-server-reset" ]]; then
|
||||||
php_optim
|
php_optim
|
||||||
fi
|
fi
|
||||||
|
|
||||||
webinoly_version
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "${gre}Webinoly Server has been updated successfully!${end}"
|
echo "${gre}Webinoly Server has been updated successfully!${end}"
|
||||||
elif [ "$opt" == "-verify" ]; then
|
elif [ "$opt" == "-verify" ]; then
|
||||||
|
|
2
weby
2
weby
|
@ -31,7 +31,7 @@ sudo mkdir /opt/webinoly
|
||||||
|
|
||||||
# Download and install Webinoly
|
# Download and install Webinoly
|
||||||
# Same as app_install, but manually because is not installed yet.
|
# Same as app_install, but manually because is not installed yet.
|
||||||
sudo curl -o $HOME/webinoly.tar http://dl.qrokes.com/webinoly/webinoly.tar
|
sudo curl -o $HOME/webinoly.tar -L https://qrok.es/wytar
|
||||||
sudo tar -xf $HOME/webinoly.tar -C /opt/webinoly
|
sudo tar -xf $HOME/webinoly.tar -C /opt/webinoly
|
||||||
sudo find /opt/webinoly -type d -exec chmod 755 {} \;
|
sudo find /opt/webinoly -type d -exec chmod 755 {} \;
|
||||||
sudo find /opt/webinoly -type f -exec chmod 644 {} \;
|
sudo find /opt/webinoly -type f -exec chmod 644 {} \;
|
||||||
|
|
Loading…
Reference in a new issue