mirror of
https://github.com/nextcloud/vm.git
synced 2025-10-26 11:27:32 +00:00
add menus for Talk and Fail2ban (#1443)
Signed-off-by: enoch85 <github@hanssonit.se>
This commit is contained in:
parent
b371ad1781
commit
40f0348807
@ -30,7 +30,6 @@ choice=$(whiptail --title "$TITLE" --checklist "Which apps do you want to instal
|
||||
"Documentserver" "(OnlyOffice or Collabora - Docker or Integrated)" OFF \
|
||||
"Bitwarden" "(External password manager)" OFF \
|
||||
"Fail2ban " "(Extra Bruteforce protection)" "$STARTUP_SWITCH" \
|
||||
"Fail2ban Statuscheck" "(Check status of banned IPs in iptables and Fail2ban)" OFF \
|
||||
"Adminer" "(PostgreSQL GUI)" OFF \
|
||||
"Netdata" "(Real-time server monitoring in Web GUI)" OFF \
|
||||
"BPYTOP" "(Real-time server monitoring in CLI)" OFF \
|
||||
@ -55,17 +54,7 @@ case "$choice" in
|
||||
*"Fail2ban "*)
|
||||
clear
|
||||
print_text_in_color "$ICyan" "Downloading the Fail2ban script..."
|
||||
run_script APP fail2ban
|
||||
;;&
|
||||
*"Fail2ban Statuscheck"*)
|
||||
clear
|
||||
SUBTITLE="Fail2ban Statuscheck"
|
||||
if is_this_installed fail2ban && [ -f "/etc/fail2ban/filter.d/nextcloud.conf" ]
|
||||
then
|
||||
msg_box "$(fail2ban-client status nextcloud && fail2ban-client status sshd && iptables -L -n)" "$SUBTITLE"
|
||||
else
|
||||
msg_box "Fail2ban isn't installed. Please run 'sudo bash /var/scripts/menu.sh' to install it." "$SUBTITLE"
|
||||
fi
|
||||
run_script MENU fail2ban_menu
|
||||
;;&
|
||||
*"Adminer"*)
|
||||
clear
|
||||
@ -124,7 +113,7 @@ case "$choice" in
|
||||
*"Talk"*)
|
||||
clear
|
||||
print_text_in_color "$ICyan" "Downloading the Talk script..."
|
||||
run_script APP talk_signaling
|
||||
run_script MENU talk_menu
|
||||
;;&
|
||||
*"Webmin"*)
|
||||
clear
|
||||
|
||||
52
menu/fail2ban_menu.sh
Normal file
52
menu/fail2ban_menu.sh
Normal file
@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
|
||||
|
||||
# shellcheck disable=2034,2059
|
||||
true
|
||||
SCRIPT_NAME="Fail2ban Menu"
|
||||
# shellcheck source=lib.sh
|
||||
. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
|
||||
|
||||
# Check for errors + debug code and abort if something isn't right
|
||||
# 1 = ON
|
||||
# 0 = OFF
|
||||
DEBUG=0
|
||||
debug_mode
|
||||
|
||||
# Must be root
|
||||
root_check
|
||||
|
||||
# Set the startup switch
|
||||
if [ -f "$SCRIPTS/nextcloud-startup-script.sh" ]
|
||||
then
|
||||
STARTUP_SWITCH="ON"
|
||||
else
|
||||
STARTUP_SWITCH="OFF"
|
||||
fi
|
||||
|
||||
choice=$(whiptail --title "$TITLE" --checklist "Automatically install and configure Fail2ban.\n$CHECKLIST_GUIDE\n$MENU_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||
"Install-Fail2ban" "(Install Fail2ban and protect Nextcloud + SSH)" "$STARTUP_SWITCH" \
|
||||
"Fail2ban-Statuscheck" "(Check status of currently blocked attacks)" OFF 3>&1 1>&2 2>&3)
|
||||
|
||||
case "$choice" in
|
||||
*"Install-Fail2ban"*)
|
||||
clear
|
||||
print_text_in_color "$ICyan" "Downloading the Fail2ban install script..."
|
||||
run_script APP fail2ban
|
||||
;;&
|
||||
*"Fail2ban-Statuscheck"*)
|
||||
clear
|
||||
SUBTITLE="Fail2ban Statuscheck"
|
||||
if is_this_installed fail2ban && [ -f "/etc/fail2ban/filter.d/nextcloud.conf" ]
|
||||
then
|
||||
msg_box "$(fail2ban-client status nextcloud && fail2ban-client status sshd && iptables -L -n)" "$SUBTITLE"
|
||||
else
|
||||
msg_box "Fail2ban isn't installed. Please run 'sudo bash /var/scripts/menu.sh' to install it." "$SUBTITLE"
|
||||
fi
|
||||
;;&
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
exit
|
||||
|
||||
47
menu/talk_menu.sh
Normal file
47
menu/talk_menu.sh
Normal file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/
|
||||
|
||||
# shellcheck disable=2034,2059
|
||||
true
|
||||
SCRIPT_NAME="Talk Menu"
|
||||
# shellcheck source=lib.sh
|
||||
. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
|
||||
|
||||
# Check for errors + debug code and abort if something isn't right
|
||||
# 1 = ON
|
||||
# 0 = OFF
|
||||
DEBUG=0
|
||||
debug_mode
|
||||
|
||||
# Must be root
|
||||
root_check
|
||||
|
||||
# Set the startup switch
|
||||
if [ -f "$SCRIPTS/nextcloud-startup-script.sh" ]
|
||||
then
|
||||
STARTUP_SWITCH="ON"
|
||||
else
|
||||
STARTUP_SWITCH="OFF"
|
||||
fi
|
||||
|
||||
choice=$(whiptail --title "$TITLE" --checklist "Automatically install and configure Talk.\n$CHECKLIST_GUIDE\n$MENU_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||
"Talk " "(Install Talk standalone - no subdomain required)" OFF \
|
||||
"Talk-Signaling" "(Install Talk + Signaling Server - subdomain required)" OFF 3>&1 1>&2 2>&3)
|
||||
|
||||
case "$choice" in
|
||||
*"Talk "*)
|
||||
clear
|
||||
print_text_in_color "$ICyan" "Downloading the Talk script..."
|
||||
run_script APP talk
|
||||
;;&
|
||||
*"Talk-Signaling"*)
|
||||
clear
|
||||
print_text_in_color "$ICyan" "Downloading the Talk Signaling script..."
|
||||
run_script APP talk_signaling
|
||||
;;&
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
exit
|
||||
|
||||
Loading…
Reference in New Issue
Block a user