Skip to content

Commit

Permalink
Virtualhost destroy fix + fail2ban improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
andreapollastri committed May 11, 2020
1 parent 11ac30f commit fff5655
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ApplicationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function destroy(Request $request) {
$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');
Expand Down
7 changes: 7 additions & 0 deletions storage/app/scripts/hostdel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

PHP=
USER_NAME=
DBROOT=???

Expand All @@ -9,6 +10,10 @@ while [ -n "$1" ] ; do
shift
USER_NAME=$1
;;
-p | --php* )
shift
PHP=$1
;;
* )
echo "ERROR: Unknown option: $1"
exit -1
Expand All @@ -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

Expand Down
6 changes: 4 additions & 2 deletions storage/app/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fff5655

Please sign in to comment.