Skip to content

Commit

Permalink
Minor fixes and tweaks.
Browse files Browse the repository at this point in the history
Log command code refactored, messages improved, HTTPS links, Ondrej repo ppa key fixed, source folder issue.
  • Loading branch information
QROkes committed Oct 22, 2017
1 parent 13d9025 commit 43a90a1
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 52 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ sudo site example.com -wp
```

## Documentation
For complete documentation, please [visit our site](https://qrokes.com/webinoly/).
For complete documentation, please [visit our site](https://webinoly.com/).

## Contributing
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
[![PayPal Donations](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/gold-rect-paypal-60px.png)](https://www.paypal.me/qrokes)
Expand Down
19 changes: 10 additions & 9 deletions lib/install
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source /opt/webinoly/lib/general

webinoly_version() {
conf_write app-version 1.0.0
conf_write app-version 1.0.1
}
server_version() {
conf_write server-version 1.0
Expand Down Expand Up @@ -98,13 +98,13 @@ linux_purge() {

messagend_install() {
echo "${gre}*****************************************************************************************"
echo "************ LA INSTALACIÓN HA FINALIZADO CON ÉXITO ************"
echo "************ INSTALLATION HAS FINISHED SUCCESSFULLY ************"
echo "*****************************************************************************************${end}"
if [[ $1 == "dbpass" ]]; then
local rootpass=$( echo $(conf_read mysql-root) | openssl enc -d -a -salt )
local adminpass=$( echo $(conf_read mysql-admin) | openssl enc -d -a -salt )
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 "*****************************************************************************************"
echo "${end}"
Expand Down Expand Up @@ -134,7 +134,9 @@ php_install() {
fi
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 -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

Expand Down Expand Up @@ -360,7 +362,7 @@ mysql_tool() {
app_install() {

#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 find /opt/webinoly -type d -exec chmod 755 {} \;
sudo find /opt/webinoly -type f -exec chmod 644 {} \;
Expand Down Expand Up @@ -615,17 +617,16 @@ webinoly_verify() {
echo "*******************************************************"
echo "******** ${gre}> > > E R R O R < < <${red} ***********"
echo "******** ${gre}System could not work properly${red} ***********"
echo "*******************************************************"
echo "******************************************************* ${end}"
exit 1
elif [ $warning != 0 ]; then
echo "***********************************************************************************************************"
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
else
echo "${gre} Integrity test passed!!"
echo "${gre} Integrity test passed!! ${end}"
fi
echo "${end}"
}


Expand Down
16 changes: 9 additions & 7 deletions lib/site-ssl
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ site_ssl_on() {
fi

echo "${gre}"
echo "***********************************************************************************************"
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 "** **"
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 "***********************************************************************************************"
echo "*************************************************************************************************"
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 "** **"
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 "** **"
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)
while [[ -z $cermail ]]
Expand Down
9 changes: 6 additions & 3 deletions lib/sites
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ source /opt/webinoly/lib/general

nginx_helper_plugin() {
# 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 unzip /var/www/$domain/htdocs/nginx-helper-plugin.zip -d /var/www/$domain/htdocs/wp-content/plugins/
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 -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
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 ""
}


Expand Down
60 changes: 31 additions & 29 deletions plugins/log
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,39 @@ source /opt/webinoly/lib/general
domain="$1"
opt="$2"

if [[ ! $(conf_read nginx) == "true" ]]; then
error() {
echo ""
echo "${red} NGINX is required to view your logs properly! ${end}"
echo "${red} Log file not found!!! ${end}"
echo ""
exit 1
fi
}

if [[ -z $opt ]]; then
case "$domain" in
"-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")
sudo tail -f /var/log/php/$(conf_read php-ver)/*.log
"-fpm"|"-php")
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")
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
fi
Expand All @@ -40,34 +56,20 @@ fi
if [[ -n "$opt" && "$opt" != "-error" && "$opt" != "-wp" ]]; then
echo "${red} $opt is not a valid option!${end}"
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


# 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
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
elif [[ "$opt" == "-wp" && -n "$domain" ]]; then
if [[ -a /var/www/$domain/htdocs/wp-content/debug.log ]]; then
sudo tail -f /var/www/$domain/htdocs/wp-content/debug.log
else
echo "${red} Seems like debug is not enabled in your wp-config.php file! ${end}"
fi
elif [[ -z "$domain" && -z "$opt" ]]; then
elif [[ "$opt" == "-wp" && -n "$domain" && -a /var/www/$domain/htdocs/wp-content/debug.log ]]; then
sudo tail -f /var/www/$domain/htdocs/wp-content/debug.log
elif [[ -z "$domain" && -z "$opt" && -a /var/log/nginx/access.log ]]; then
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
else
error
fi
2 changes: 1 addition & 1 deletion plugins/webinoly
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ source /opt/webinoly/lib/install
if [ "$opt" == "-update" ]; then
app_install
app_purge
webinoly_version
echo ""
echo "${gre}Webinoly App has been updated successfully!${end}"
elif [[ "$opt" == "-server-update" || "$opt" == "-server-reset" ]]; then
Expand All @@ -32,7 +33,6 @@ elif [[ "$opt" == "-server-update" || "$opt" == "-server-reset" ]]; then
php_optim
fi

webinoly_version
echo ""
echo "${gre}Webinoly Server has been updated successfully!${end}"
elif [ "$opt" == "-verify" ]; then
Expand Down
2 changes: 1 addition & 1 deletion weby
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sudo mkdir /opt/webinoly

# Download and install Webinoly
# 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 find /opt/webinoly -type d -exec chmod 755 {} \;
sudo find /opt/webinoly -type f -exec chmod 644 {} \;
Expand Down

0 comments on commit 43a90a1

Please sign in to comment.