Skip to content

Commit

Permalink
add deSEC menu (#2066)
Browse files Browse the repository at this point in the history
  • Loading branch information
enoch85 committed Jul 29, 2021
1 parent 87c7aff commit 924fe18
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,11 @@ then
DEDYN_TOKEN=$(grep DEDYN_TOKEN "$SCRIPTS"/deSEC/.dedynauth | cut -d '=' -f2)
DEDYN_NAME=$(grep DEDYN_NAME "$SCRIPTS"/deSEC/.dedynauth | cut -d '=' -f2)
return 0
else
fi
else
msg_box "It seems like deSEC isn't configured on this server.
Please run 'sudo bash $SCRIPTS/menu.sh --> Server Configuration --> deSEC' to configure it."
return 1
fi
fi
}

Expand Down
43 changes: 43 additions & 0 deletions menu/desec_menu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# T&M Hansson IT AB © - 2021, https://www.hanssonit.se/

true
SCRIPT_NAME="deSEC Menu"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(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

choice=$(whiptail --title "$TITLE" --menu \
"Please choose one of the deSEC options below.
$MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
"Install deSEC" "(Setup deSEC fully automated: yourdomain.dedyn.io)" \
"deSEC Subdomain" "(Add another subdomain to an existing account)" \
"Remove deSEC" "(Remove your deSEC account - not yet active)" 3>&1 1>&2 2>&3)

case "$choice" in
"Install deSEC")
print_text_in_color "$ICyan" "Downloading the deSEC install script..."
run_script ADDONS desec
;;
"deSEC Subdomain")
print_text_in_color "$ICyan" "Downloading the deSEC subdomain script..."
run_script ADDONS desec_subdomain
;;
"Remove deSEC")
#print_text_in_color "$ICyan" "Downloading the remove deSEC script..."
#run_script ADDONS remove_desec
msg_box "This option is not yet active. Please try again another day."
;;
*)
;;
esac
exit
10 changes: 5 additions & 5 deletions menu/server_configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ choice=$(whiptail --title "$TITLE" --checklist \
$CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
"deSEC" "(Automatically set up a dedyn.io domain, together with DDNS and TLS)" "$STARTUP_SWITCH" \
"DDclient Configuration" "(Use ddclient for automatic DDNS updates)" OFF \
"Activate TLS" "(Enable HTTPS with Let's Encrypt)" "$STARTUP_SWITCH" \
"Activate TLS" "(Enable HTTPS with Let's Encrypt on your domain)" "$STARTUP_SWITCH" \
"SMTP Mail" "(Enable being notified by mail from your server)" OFF \
"Static IP" "(Set static IP in Ubuntu with netplan.io)" OFF \
"Automatic updates" "(Automatically update your server every week on Sundays)" OFF \
Expand All @@ -59,12 +59,12 @@ case "$choice" in
run_script ADDONS security
;;&
*"deSEC"*)
if [ -f $SCRIPTS/desec.sh ]
if [ -f $SCRIPTS/desec_menu.sh ]
then
bash $SCRIPTS/desec.sh
bash $SCRIPTS/desec_menu.sh
else
print_text_in_color "$ICyan" "Downloading the deSEC script..."
run_script ADDONS desec
print_text_in_color "$ICyan" "Downloading the deSEC menu script..."
run_script MENU desec_menu
fi
;;&
*"DDclient Configuration"*)
Expand Down
2 changes: 1 addition & 1 deletion nextcloud_install_production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,6 @@ download_script STATIC history
download_script NETWORK static_ip
# Moved from the startup script 2021-01-04
download_script LETS_ENC activate-tls
download_script ADDONS desec
download_script STATIC temporary-fix
download_script STATIC update
download_script STATIC setup_secure_permissions_nextcloud
Expand All @@ -978,6 +977,7 @@ download_script MENU menu
download_script MENU server_configuration
download_script MENU nextcloud_configuration
download_script MENU additional_apps
download_script MENU desec_menu

# Make $SCRIPTS excutable
chmod +x -R "$SCRIPTS"
Expand Down

0 comments on commit 924fe18

Please sign in to comment.