From 9db35d138ceb4393570f3f29fe935bff53412a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Wed, 2 Jun 2021 11:25:26 -0600 Subject: [PATCH] minor issues Fixed some minor issues after testing. README updated. --- README.md | 17 +++++++++++------ lib/install | 4 ++-- lib/sites | 5 +++-- lib/verify | 8 ++++---- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 10b0d24..1dfa829 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,19 @@ A powerful set of commands for doing just about anything you could wish. Linux Ubuntu + Nginx + MariaDB (MySQL) + PHP is one of the most reliable and powerful configurations to host your websites. **With Webinoly you can set up your web server in just one step.** -Webinoly provides a set of tools and commands that facilitate the web server administration. +Webinoly provides a set of tools and commands that facilitate web server administration. - Unique commands to create, delete, disable sites. - Free SSL certificates for your sites with Let’s Encrypt and automatic server configuration. -- HTTP/2 dramatically increase the speed of serving your content. +- HTTP/2 dramatically increases the speed of serving your content. - PHP v7.4 and support for earlier versions if needed 7.3 and the newest 8.0. -- FastCgi Cache and Redis Object Cache for your WordPress sites. -- Install WP in any subfolder, Clone a WP site and support for external databases. -- Nginx redirection manager, Backups, SMTP and a lot more features. +- FastCGI Cache and Redis Object Cache for your WordPress sites. +- Install WP in any subfolder and support for external databases, multisite and domain mapping. +- Reverse Proxy for any app (Java, React, Node, Angular, Vue, etc) or to use your own domain with any external file repo like S3. +- A complete suite of tools for backups. Moving a site or the whole server has never been so easy. +- Protect your site, folder or file with HTTP Authentication. +- Advanced support for cloning your sites for testing. +- Custom FastCGI Cache support for any dynamic site. +- Nginx redirection manager, native SMTP for emails and a lot more features. - Datadog native integration for monitoring and analytics. - Get an A+ grade on [Qualys (SSL Labs) Test](https://www.ssllabs.com/ssltest/). - Log viewer in real time. @@ -52,7 +57,7 @@ You don't need developer skills to help, visit our site to know [How to Contribu If you like Webinoly, buy me a coffee or a beer to show support. -**_Your regular donations keeps this project moving forward._** +**_Your regular donations keep this project moving forward._** ## License [GNU GPLv3](https://choosealicense.com/licenses/gpl-3.0/) \ No newline at end of file diff --git a/lib/install b/lib/install index 464507a..6489797 100644 --- a/lib/install +++ b/lib/install @@ -312,11 +312,11 @@ fastcgi_param HTTP_ACCEPT_ENCODING ""; # Create Direct Access for easy navigation if [[ ! -L $CURRENT_HOME/sites-available ]]; then ln -s /etc/nginx/sites-available $CURRENT_HOME - sudo chown ${CURRENT_USER}:${CURRENT_USER} $CURRENT_HOME/sites-available + sudo chown -h ${CURRENT_USER}:${CURRENT_USER} $CURRENT_HOME/sites-available fi if [[ ! -L $CURRENT_HOME/www ]]; then ln -s /var/www $CURRENT_HOME - sudo chown ${CURRENT_USER}:${CURRENT_USER} $CURRENT_HOME/www + sudo chown -h ${CURRENT_USER}:${CURRENT_USER} $CURRENT_HOME/www fi # www-data sftp default uploads permissions 755 and 644, instead of 775 and 664. diff --git a/lib/sites b/lib/sites index 28c9f44..4b8ac54 100644 --- a/lib/sites +++ b/lib/sites @@ -209,7 +209,7 @@ wpinstall() { check_for_mysql_client echo "${blu}" - if [[ $dbhost != "localhost" && $type == 1 || ($type == [35] && ( -z $dburoot || -z $dbproot )) ]]; then + if [[ $dbhost != "localhost" && ( $type == 1 || ( $type == [35] && ( -z $dburoot || -z $dbproot ))) ]]; then read -p "External DB username: " dburoot read -p "External DB password: " dbproot echo "" @@ -217,6 +217,7 @@ wpinstall() { if [[ -n $retry && $retry -ge 3 ]]; then setupmysql="N" + local db_error_flag="true" echo "${red}[ERROR] Database creation failed after 3 retries! ${blu}" elif [[ ( $dbhost == "localhost" && $(check_mysql_connection localhost) != "true" ) || ( $dbhost != "localhost" && $(check_mysql_connection $dburl $dbport $dburoot $dbproot) != "true" ) ]]; then # Reset variables @@ -457,7 +458,7 @@ _EOF_ fi # Display data just to confirm the DB creation. - if [[ $type == [45] ]]; then + if [[ $type == [45] && $db_error_flag != "true" ]]; then echo "${blu}" echo "Database Host: $dbhost" echo "Database Name: $dbname" diff --git a/lib/verify b/lib/verify index bcbac3b..a734634 100644 --- a/lib/verify +++ b/lib/verify @@ -612,10 +612,10 @@ elif [[ $(check_ubuntu_release) != "true" ]]; then elif [[ $(lsb_release -c | cut -d':' -f 2 | xargs) == "bionic" ]]; then echo "${blu}${dim}- [INFO] You should start considering moving to Ubuntu 20.04 ${end}${red}" fi -# Check for sudo/root privileges -if ! $(groups $USERNAME | grep &>/dev/null '\bsudo\b' || groups $USERNAME | grep &>/dev/null '\broot\b'); then - echo "${dim}- [WARNING] This user has no Sudo/Root privileges!${end}${red}" - ver_six_war="1" +# Double-Check for sudo/root privileges +if [[ $(whoami) != "root" ]]; then + echo "- [ERROR] This user has no sudo/root privileges!" + ver_six_err="1" fi # Check disk usage