Browse Source

Virtualhost destroy fix + fail2ban improvements

Andrea Pollastri 5 years ago
parent
commit
fff56555d0

+ 6 - 0
CHANGELOG.md

@@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 (no unreleased versions)
 
+## [2.4.1] - 2020-05-11
+### Fixed
+- Bug fix on `ApplicationsController.php` and `host-del.sh` to fix host destroy
+### Changed
+- Improvements of file2ban's security policies in `install.sh`
+
 ## [2.4.0] - 2020-05-11
 ### Fixed
 - Bug fix on `install.sh` to fix nginx lock and phpmyadmin configuration

+ 1 - 1
app/Http/Controllers/ApplicationsController.php

@@ -115,7 +115,7 @@ class ApplicationsController extends Controller {
             $ssh->exec('echo '.$application->server->password.' | sudo -S unlink /etc/nginx/sites-enabled/'.$alias->domain.'.conf');
             $ssh->exec('echo '.$application->server->password.' | sudo -S unlink /etc/nginx/sites-available/'.$alias->domain.'.conf');
         }
-        $ssh->exec('echo '.$application->server->password.' | sudo -S sudo sh /cipi/host-del.sh -u '.$application->username);
+        $ssh->exec('echo '.$application->server->password.' | sudo -S sudo sh /cipi/host-del.sh -u '.$application->username.' -p '.$application->php);
         $application->delete();
         $request->session()->flash('alert-success', 'Application has been removed!');
         return redirect('/applications');

+ 7 - 0
storage/app/scripts/hostdel.sh

@@ -1,5 +1,6 @@
 #!/usr/bin/env bash
 
+PHP=
 USER_NAME=
 DBROOT=???
 
@@ -9,6 +10,10 @@ while [ -n "$1" ] ; do
         shift
         USER_NAME=$1
         ;;
+    -p | --php* )
+        shift
+        PHP=$1
+        ;;
     * )
         echo "ERROR: Unknown option: $1"
         exit -1
@@ -17,6 +22,8 @@ while [ -n "$1" ] ; do
     shift
 done
 
+sudo rm /etc/php/$PHP/fpm/pool.d/$USER_NAME.conf
+sudo service php$PHP-fpm restart
 
 sudo userdel -r $USER_NAME
 

+ 4 - 2
storage/app/scripts/install.sh

@@ -217,12 +217,14 @@ sudo unlink JAIL
 sudo touch $JAIL
 sudo cat > "$JAIL" <<EOF
 [DEFAULT]
-bantime = 3600
+bantime = 14400
+ignoreip = 127.0.0.1/8
 banaction = iptables-multiport
 
 [sshd]
 enabled = true
-logpath  = /var/log/auth.log
+logpath = /var/log/auth.log
+maxretry = 6
 
 [nginx-req-limit]
 enabled = true