Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add deSEC menu #2066

Merged
merged 5 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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