add a SUBTITLE to sensible places and other small fixes (#1429)
Co-authored-by: Daniel Hansson <github@hanssonit.se>
This commit is contained in:
Родитель
5b45ba36a8
Коммит
a3932b0728
|
@ -21,6 +21,7 @@ fi
|
|||
msg_box "To make downloads as fast as possible when updating Ubuntu you should have download mirrors that are as close to you as possible.
|
||||
|
||||
Please note that there are no gurantees that the download mirrors this script will find are staying up for the lifetime of this server.
|
||||
Because of this, we don't recommend to change the mirror, except you live far away from the default mirror.
|
||||
|
||||
This is the method used: https://github.com/jblakeman/apt-select"
|
||||
msg_box "Your current server repository is: $REPO"
|
||||
|
@ -50,5 +51,6 @@ else
|
|||
then
|
||||
sudo mv sources.list /etc/apt/
|
||||
fi
|
||||
msg_box "The apt-mirror was successfully changed."
|
||||
fi
|
||||
clear
|
||||
|
|
|
@ -26,7 +26,7 @@ lowest_compatible_nc 13
|
|||
|
||||
# Check if fail2ban is already installed
|
||||
print_text_in_color "$ICyan" "Checking if Fail2Ban is already installed..."
|
||||
if is_this_installed fail2ban
|
||||
if is_this_installed fail2ban && [ -f "/etc/fail2ban/filter.d/nextcloud.conf" ]
|
||||
then
|
||||
choice=$(whiptail --title "$TITLE" --menu "It seems like 'Fail2Ban' is already installed.\nChoose what you want to do." "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||
"Reinstall Fail2Ban" "" \
|
||||
|
|
|
@ -59,12 +59,12 @@ case "$choice" in
|
|||
;;&
|
||||
*"Fail2ban Statuscheck"*)
|
||||
clear
|
||||
if is_this_installed fail2ban
|
||||
SUBTITLE="Fail2ban Statuscheck"
|
||||
if is_this_installed fail2ban && [ -f "/etc/fail2ban/filter.d/nextcloud.conf" ]
|
||||
then
|
||||
fail2ban-client status nextcloud && fail2ban-client status sshd
|
||||
iptables -L -n
|
||||
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."
|
||||
msg_box "Fail2ban isn't installed. Please run 'sudo bash /var/scripts/menu.sh' to install it." "$SUBTITLE"
|
||||
fi
|
||||
;;&
|
||||
*"Adminer"*)
|
||||
|
@ -79,20 +79,25 @@ case "$choice" in
|
|||
;;&
|
||||
*"BPYTOP"*)
|
||||
clear
|
||||
print_text_in_color "$ICyan" "Installing BPYTOP..."
|
||||
install_if_not snapd
|
||||
if snap install bpytop
|
||||
SUBTITLE="BPYTOP"
|
||||
msg_box "BPYTOP is an amazing alternative to ressource-monitor software like htop." "$SUBTITLE"
|
||||
if yesno_box_yes "Do you want to install BPYTOP?" "$SUBTITLE"
|
||||
then
|
||||
snap connect bpytop:mount-observe
|
||||
snap connect bpytop:network-control
|
||||
snap connect bpytop:hardware-observe
|
||||
snap connect bpytop:system-observe
|
||||
snap connect bpytop:process-control
|
||||
snap connect bpytop:physical-memory-observe
|
||||
hash -r
|
||||
msg_box "BPYTOP is now installed! Check out the amazing stats by runnning 'bpytop' from your CLI.\n\nYou can check out their Gihub repo here: https://github.com/aristocratos/bpytop/blob/master/README.md"
|
||||
else
|
||||
msg_box "It seems like the installation failed. Please try again."
|
||||
print_text_in_color "$ICyan" "Installing BPYTOP..."
|
||||
install_if_not snapd
|
||||
if snap install bpytop
|
||||
then
|
||||
snap connect bpytop:mount-observe
|
||||
snap connect bpytop:network-control
|
||||
snap connect bpytop:hardware-observe
|
||||
snap connect bpytop:system-observe
|
||||
snap connect bpytop:process-control
|
||||
snap connect bpytop:physical-memory-observe
|
||||
hash -r
|
||||
msg_box "BPYTOP is now installed! Check out the amazing stats by runnning 'bpytop' from your CLI.\n\nYou can check out their Gihub repo here: https://github.com/aristocratos/bpytop/blob/master/README.md" "$SUBTITLE"
|
||||
else
|
||||
msg_box "It seems like the installation of BPYTOP failed. Please try again." "$SUBTITLE"
|
||||
fi
|
||||
fi
|
||||
;;&
|
||||
*"FullTextSearch"*)
|
||||
|
|
|
@ -38,51 +38,59 @@ choice=$(whiptail --title "$TITLE" --checklist "Which settings do you want to co
|
|||
|
||||
case "$choice" in
|
||||
*"CookieLifetime"*)
|
||||
print_text_in_color "$ICyan" "Downloading the CookieLifetime script..."
|
||||
run_script STATIC cookielifetime
|
||||
;;&
|
||||
*"Share-folder"*)
|
||||
clear
|
||||
msg_box "This option will make all Nextcloud shares from other users appear in a folder named 'Shared' in the Nextcloud GUI.\n\nIf you don't enable this option, all shares will appear directly in the Nextcloud GUI root folder, which is the default behaviour."
|
||||
if yesno_box_yes "Do you want to enable this option?"
|
||||
SUBTITLE="Share-folder"
|
||||
msg_box "This option will make all Nextcloud shares from other users appear in a folder named 'Shared' in the Nextcloud GUI.\n\nIf you don't enable this option, all shares will appear directly in the Nextcloud GUI root folder, which is the default behaviour." "$SUBTITLE"
|
||||
if yesno_box_yes "Do you want to enable this option?" "$SUBTITLE"
|
||||
then
|
||||
occ_command config:system:set share_folder --value="/Shared"
|
||||
msg_box "All new Nextcloud shares from other users will appear in the 'Shared' folder from now on."
|
||||
msg_box "All new Nextcloud shares from other users will appear in the 'Shared' folder from now on." "$SUBTITLE"
|
||||
fi
|
||||
;;&
|
||||
*"Disable workspaces"*)
|
||||
msg_box "This option will will disable a feature named 'rich workspaces'. It will disable the top notes in GUI."
|
||||
if yesno_box_yes "Do you want to disable rich workspaces?"
|
||||
clear
|
||||
SUBTITLE="Disable workspaces"
|
||||
msg_box "This option will will disable a feature named 'rich workspaces'. It will disable the top notes in GUI." "$SUBTITLE"
|
||||
if yesno_box_yes "Do you want to disable rich workspaces?" "$SUBTITLE"
|
||||
then
|
||||
# Check if text is enabled
|
||||
if ! is_app_enabled text
|
||||
then
|
||||
msg_box "The text app isn't enabled - unable to disable rich workspaces."
|
||||
msg_box "The text app isn't enabled - unable to disable rich workspaces." "$SUBTITLE"
|
||||
sleep 1
|
||||
else
|
||||
# Disable workspaces
|
||||
occ_command config:app:set text workspace_available --value=0
|
||||
msg_box "Rich workspaces are now disabled."
|
||||
msg_box "Rich workspaces are now disabled." "$SUBTITLE"
|
||||
fi
|
||||
fi
|
||||
;;&
|
||||
*"Disable user flows"*)
|
||||
clear
|
||||
SUBTITLE="Disable user flows"
|
||||
# Greater than 18.0.3 is 18.0.4 which is required
|
||||
if version_gt "$CURRENTVERSION" "18.0.3"
|
||||
then
|
||||
msg_box "This option will disable the with Nextcloud 18 introduced user flows. It will disable the user flow settings. Admin flows will continue to work."
|
||||
if yesno_box_yes "Do you want to disable user flows?"
|
||||
msg_box "This option will disable the with Nextcloud 18 introduced user flows. It will disable the user flow settings. Admin flows will continue to work." "$SUBTITLE"
|
||||
if yesno_box_yes "Do you want to disable user flows?" "$SUBTITLE"
|
||||
then
|
||||
occ_command config:app:set workflowengine user_scope_disabled --value yes
|
||||
msg_box "User flow settings are now disabled."
|
||||
msg_box "User flow settings are now disabled." "$SUBTITLE"
|
||||
fi
|
||||
else
|
||||
msg_box "'Disable user flows' is only available on Nextcloud 18.0.4 and above.\nPlease upgrade by running 'sudo bash /var/scripts/update.sh'"
|
||||
msg_box "'Disable user flows' is only available on Nextcloud 18.0.4 and above.\nPlease upgrade by running 'sudo bash /var/scripts/update.sh'" "$SUBTITLE"
|
||||
sleep 1
|
||||
fi
|
||||
;;&
|
||||
*"Enable logrotate"*)
|
||||
msg_box "This option enables logrotate for Nextcloud logs to keep all logs for 10 days"
|
||||
if yesno_box_yes "Do you want to enable logrotate for Nextcloud logs?"
|
||||
clear
|
||||
SUBTITLE="Enable logrotate"
|
||||
msg_box "This option enables logrotate for Nextcloud logs to keep all logs for 10 days" "$SUBTITLE"
|
||||
if yesno_box_yes "Do you want to enable logrotate for Nextcloud logs?" "$SUBTITLE"
|
||||
then
|
||||
# Set logrotate (without size restriction)
|
||||
occ_command config:system:set log_rotate_size --value=0
|
||||
|
@ -97,6 +105,8 @@ NEXTCLOUD_CONF
|
|||
|
||||
# Set needed ownerchip for the nextcloud log folder to work correctly
|
||||
chown www-data:www-data "${VMLOGS}"/
|
||||
|
||||
msg_box "Logrotate was successfully enabled." "$SUBTITLE"
|
||||
fi
|
||||
;;&
|
||||
*)
|
||||
|
|
|
@ -60,14 +60,15 @@ case "$choice" in
|
|||
;;&
|
||||
*"Activate TLS"*)
|
||||
clear
|
||||
SUBTITLE="Activate TLS"
|
||||
msg_box "The following script will install a trusted
|
||||
TLS certificate through Let's Encrypt.
|
||||
It's recommended to use TLS (https) together with Nextcloud.
|
||||
Please open port 80 and 443 to this servers IP before you continue.
|
||||
More information can be found here:
|
||||
https://www.techandme.se/open-port-80-443/"
|
||||
https://www.techandme.se/open-port-80-443/" "$SUBTITLE"
|
||||
|
||||
if yesno_box_yes "Do you want to install TLS?"
|
||||
if yesno_box_yes "Do you want to install TLS?" "$SUBTITLE"
|
||||
then
|
||||
if [ -f $SCRIPTS/activate-tls.sh ]
|
||||
then
|
||||
|
|
|
@ -51,8 +51,9 @@ choice=$(whiptail --title "$TITLE" --checklist "Choose what you want to change.\
|
|||
case "$choice" in
|
||||
*"Keyboard Layout"*)
|
||||
clear
|
||||
msg_box "Current keyboard layout is $KEYBOARD_LAYOUT."
|
||||
if ! yesno_box_yes "Do you want to change keyboard layout?"
|
||||
SUBTITLE="Keyboard Layout"
|
||||
msg_box "Current keyboard layout is $KEYBOARD_LAYOUT." "$SUBTITLE"
|
||||
if ! yesno_box_yes "Do you want to change keyboard layout?" "$SUBTITLE"
|
||||
then
|
||||
print_text_in_color "$ICyan" "Not changing keyboard layout..."
|
||||
sleep 1
|
||||
|
@ -65,8 +66,8 @@ case "$choice" in
|
|||
then
|
||||
run_script ADDONS locales
|
||||
fi
|
||||
input_box "Please try out all buttons (e.g: @ # \$ : y n) to find out if the keyboard settings were correctly applied.\nIf the keyboard is still wrong, you will be offered to reboot the server in the next step.\n\nPlease continue by hitting [ENTER]" >/dev/null
|
||||
if ! yesno_box_yes "Did the keyboard work as expected??\n\nIf you choose 'No' the server will be rebooted. After the reboot, please login as usual and run this script again."
|
||||
input_box "The Keyboard Layout was changed.\nPlease try out all buttons (e.g: @ # \$ : y n) to find out if the keyboard settings were correctly applied.\nIf the keyboard is still wrong, you will be offered to reboot the server in the next step.\n\nPlease continue by hitting [ENTER]" "$SUBTITLE" >/dev/null
|
||||
if ! yesno_box_yes "Did the keyboard work as expected??\n\nIf you choose 'No' the server will be rebooted. After the reboot, please login as usual and run this script again." "$SUBTITLE"
|
||||
then
|
||||
reboot
|
||||
fi
|
||||
|
@ -74,8 +75,9 @@ case "$choice" in
|
|||
;;&
|
||||
*"Timezone"*)
|
||||
clear
|
||||
msg_box "Current timezone is $(cat /etc/timezone)"
|
||||
if ! yesno_box_yes "Do you want to change the timezone?"
|
||||
SUBTITLE="Timezone"
|
||||
msg_box "Current timezone is $(cat /etc/timezone)" "$SUBTITLE"
|
||||
if ! yesno_box_yes "Do you want to change the timezone?" "$SUBTITLE"
|
||||
then
|
||||
print_text_in_color "$ICyan" "Not changing timezone..."
|
||||
sleep 1
|
||||
|
@ -91,6 +93,7 @@ case "$choice" in
|
|||
|
||||
# Change timezone for logging
|
||||
occ_command config:system:set logtimezone --value="$(cat /etc/timezone)"
|
||||
msg_box "The timezone was changed successfully." "$SUBTITLE"
|
||||
clear
|
||||
fi
|
||||
;;&
|
||||
|
|
Загрузка…
Ссылка в новой задаче