diff --git a/CHANGELOG.md b/CHANGELOG.md index ed96bacfd5..a5bbfc2eee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,46 @@ If you run Hyper-V or want 500 GB, 1 TB or 2 TB VM you can download it from [T&M PR's are more than welcome. Happy Nextclouding! +## 22.0.0 + +### Small changelog: +- Add SMTP2GO to SMTP-Relay +- Remove APCu and replace with Redis instead +- Made it possible to add subdomains to deSEC +- Improved spinner_loading +- Added dates to automatic updates log +- Added regular ZFS snapshot prune +- Added retention for Nextclouds user activities +- Previewgenerator - allow to clear all previews +- Update script - update Nextclouds mimetype list +- Moved mimteype update to nextcloud_configuration menu +- Reworked office scripts +- Update script - change crontab on all installations to 5 minutes +- Fixed a bug with Netdata +- Geoblock - updated link to csv file +- Refactored the bitwarden_mailconfig script +- Added more functionality to curl_to_dir +- Docker documentserver - don't restart docker daemon upon installation +- Restart notify push in some situations +- Make sure sudo and software-properties-common is installed +- Fixed password generation in edge cases +- Reworked the cookielifetime script +- Updated geoblock database - June 2021 +- Added option to check for 0-byte files +- Changed from apt to apt-get +- Simplified ClamAV notifications and small fix to fail2ban notification +- Harden-SSH script - allow to set up 2FA authentication +- SMB-server - added option to automatically empty recylce bins +- SMB-server - added option to empty all recycle bins +- SMB-server - Create the files directory for new users directly during the user creation +- Reworked system-restore +- Minor bugfixes and improvements +- And more... + +### Full changelog: +- https://github.com/nextcloud/vm/compare/21.0.2..21.0.3 +- https://nextcloud.com/changelog/#latest21 + ## 21.0.2 ### Small changelog: diff --git a/apps/collabora_docker.sh b/apps/collabora_docker.sh index 1632d46d12..35e3d486f0 100644 --- a/apps/collabora_docker.sh +++ b/apps/collabora_docker.sh @@ -17,66 +17,6 @@ debug_mode # Check if root root_check -# TODO: remove all functions with NC21.0.3 release -remove_all_office_apps() { - # remove OnlyOffice-documentserver if installed - if is_app_installed documentserver_community - then - nextcloud_occ app:remove documentserver_community - fi - - # Disable OnlyOffice App if installed - if is_app_installed onlyoffice - then - nextcloud_occ app:remove onlyoffice - fi - - # remove richdocumentscode-documentserver if installed - if is_app_installed richdocumentscode - then - nextcloud_occ app:remove richdocumentscode - fi - - # Disable RichDocuments (Collabora App) if installed - if is_app_installed richdocuments - then - nextcloud_occ app:remove richdocuments - fi -} -add_to_trusted_domains() { - local element="$1" - local count=0 - print_text_in_color "$ICyan" "Adding $element to trusted domains..." - while [ "$count" -le 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ] - then - break - elif [ -z "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" ] - then - nextcloud_occ_no_check config:system:set trusted_domains "$count" --value="$element" - break - else - count=$((count+1)) - fi - done -} -remove_from_trusted_domains() { - local element="$1" - local count=0 - print_text_in_color "$ICyan" "Removing $element from trusted domains..." - while [ "$count" -lt 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ] - then - nextcloud_occ_no_check config:system:delete trusted_domains "$count" - break - else - count=$((count+1)) - fi - done -} - # Check if Collabora is already installed print_text_in_color "$ICyan" "Checking if Collabora is already installed..." if ! does_this_docker_exist 'collabora/code' @@ -87,33 +27,7 @@ else # Ask for removal or reinstallation reinstall_remove_menu "$SCRIPT_NAME" # Removal - # Check if Collabora is previously installed - # If yes, then stop and prune the docker container - docker_prune_this 'collabora/code' - # Revoke LE - SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com") - if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] - then - yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" - REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" - for remove in $REMOVE_OLD - do rm -rf "$remove" - done - fi - # Remove Apache2 config - if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] - then - a2dissite "$SUBDOMAIN".conf - restart_webserver - rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" - fi - # Disable RichDocuments (Collabora App) if activated - if is_app_installed richdocuments - then - nextcloud_occ app:remove richdocuments - fi - # Remove trusted domain - remove_from_trusted_domains "$SUBDOMAIN" + remove_collabora_docker # Show successful uninstall if applicable removal_popup "$SCRIPT_NAME" fi @@ -122,26 +36,8 @@ fi # If yes, then stop and prune the docker container if does_this_docker_exist 'onlyoffice/documentserver' then - docker_prune_this 'onlyoffice/documentserver' - # Revoke LE - SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com") - if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] - then - yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" - REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" - for remove in $REMOVE_OLD - do rm -rf "$remove" - done - fi - # Remove Apache2 config - if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] - then - a2dissite "$SUBDOMAIN".conf - restart_webserver - rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" - fi - # Remove trusted domain - remove_from_trusted_domains "$SUBDOMAIN" + # Removal + remove_onlyoffice_docker fi # Remove all office apps diff --git a/apps/collabora_integrated.sh b/apps/collabora_integrated.sh index 87843cbcb2..b57a95a17b 100644 --- a/apps/collabora_integrated.sh +++ b/apps/collabora_integrated.sh @@ -20,48 +20,6 @@ debug_mode # Check if root root_check -# TODO: remove all functions with NC21.0.3 release -remove_all_office_apps() { - # remove OnlyOffice-documentserver if installed - if is_app_installed documentserver_community - then - nextcloud_occ app:remove documentserver_community - fi - - # Disable OnlyOffice App if installed - if is_app_installed onlyoffice - then - nextcloud_occ app:remove onlyoffice - fi - - # remove richdocumentscode-documentserver if installed - if is_app_installed richdocumentscode - then - nextcloud_occ app:remove richdocumentscode - fi - - # Disable RichDocuments (Collabora App) if installed - if is_app_installed richdocuments - then - nextcloud_occ app:remove richdocuments - fi -} -remove_from_trusted_domains() { - local element="$1" - local count=0 - print_text_in_color "$ICyan" "Removing $element from trusted domains..." - while [ "$count" -lt 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ] - then - nextcloud_occ_no_check config:system:delete trusted_domains "$count" - break - else - count=$((count+1)) - fi - done -} - # Check if Collabora is installed using the new method if ! is_app_installed richdocumentscode then @@ -84,56 +42,15 @@ fi # Check if Collabora is installed using the old method if does_this_docker_exist 'collabora/code' then - msg_box "Your server is compatible with the new way of installing Collabora. \ -We will now remove the old docker and install the app from Nextcloud instead." - # Remove docker image - docker_prune_this 'collabora/code' - # Revoke LE - SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com") - if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] - then - yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" - REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" - for remove in $REMOVE_OLD - do rm -rf "$remove" - done - fi - # Remove Apache2 config - if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] - then - a2dissite "$SUBDOMAIN".conf - restart_webserver - rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" - fi - # Remove trusted domain - remove_from_trusted_domains "$SUBDOMAIN" + # Removal + remove_collabora_docker fi # Check if Onlyoffice is installed and remove every trace of it if does_this_docker_exist 'onlyoffice/documentserver' then - msg_box "You can't run both Collabora and OnlyOffice on the same VM. We will now remove Onlyoffice from the server." - # Remove docker image - docker_prune_this 'onlyoffice/documentserver' - # Revoke LE - SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Onlyoffice, e.g: office.yourdomain.com") - if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] - then - yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" - REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" - for remove in $REMOVE_OLD - do rm -rf "$remove" - done - fi - # Remove Apache2 config - if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] - then - a2dissite "$SUBDOMAIN".conf - restart_webserver - rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" - fi - # Remove trusted domain - remove_from_trusted_domains "$SUBDOMAIN" + # Removal + remove_onlyoffice_docker fi # Remove all office apps diff --git a/apps/onlyoffice_docker.sh b/apps/onlyoffice_docker.sh index 897582f327..2fb877ff53 100644 --- a/apps/onlyoffice_docker.sh +++ b/apps/onlyoffice_docker.sh @@ -17,66 +17,6 @@ debug_mode # Check if root root_check -# TODO: remove all functions with NC21.0.3 release -remove_all_office_apps() { - # remove OnlyOffice-documentserver if installed - if is_app_installed documentserver_community - then - nextcloud_occ app:remove documentserver_community - fi - - # Disable OnlyOffice App if installed - if is_app_installed onlyoffice - then - nextcloud_occ app:remove onlyoffice - fi - - # remove richdocumentscode-documentserver if installed - if is_app_installed richdocumentscode - then - nextcloud_occ app:remove richdocumentscode - fi - - # Disable RichDocuments (Collabora App) if installed - if is_app_installed richdocuments - then - nextcloud_occ app:remove richdocuments - fi -} -add_to_trusted_domains() { - local element="$1" - local count=0 - print_text_in_color "$ICyan" "Adding $element to trusted domains..." - while [ "$count" -le 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ] - then - break - elif [ -z "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" ] - then - nextcloud_occ_no_check config:system:set trusted_domains "$count" --value="$element" - break - else - count=$((count+1)) - fi - done -} -remove_from_trusted_domains() { - local element="$1" - local count=0 - print_text_in_color "$ICyan" "Removing $element from trusted domains..." - while [ "$count" -lt 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ] - then - nextcloud_occ_no_check config:system:delete trusted_domains "$count" - break - else - count=$((count+1)) - fi - done -} - # Check if collabora is already installed if ! does_this_docker_exist 'onlyoffice/documentserver' then @@ -86,28 +26,7 @@ else # Ask for removal or reinstallation reinstall_remove_menu "$SCRIPT_NAME" # Removal - # Check if Collabora is previously installed - # If yes, then stop and prune the docker container - docker_prune_this 'onlyoffice/documentserver' - # Revoke LE - SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com") - if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] - then - yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" - REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" - for remove in $REMOVE_OLD - do rm -rf "$remove" - done - fi - # Remove Apache2 config - if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] - then - a2dissite "$SUBDOMAIN".conf - restart_webserver - rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" - fi - # Remove trusted domain - remove_from_trusted_domains "$SUBDOMAIN" + remove_onlyoffice_docker # Show successful uninstall if applicable removal_popup "$SCRIPT_NAME" fi @@ -115,28 +34,8 @@ fi # Check if collabora is installed and remove every trace of it if does_this_docker_exist 'collabora/code' then - msg_box "You can't run both Collabora and OnlyOffice on the same VM. We will now remove Collabora from the server." - # Remove docker image - docker_prune_this 'collabora/code' - # Revoke LE - SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com") - if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] - then - yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" - REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" - for remove in $REMOVE_OLD - do rm -rf "$remove" - done - fi - # Remove Apache2 config - if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] - then - a2dissite "$SUBDOMAIN".conf - restart_webserver - rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" - fi - # Remove trusted domain - remove_from_trusted_domains "$SUBDOMAIN" + # Removal + remove_collabora_docker fi # Remove all office apps diff --git a/apps/onlyoffice_integrated.sh b/apps/onlyoffice_integrated.sh index 541ac0064c..2a42c78844 100644 --- a/apps/onlyoffice_integrated.sh +++ b/apps/onlyoffice_integrated.sh @@ -20,48 +20,6 @@ debug_mode # Check if root root_check -# TODO: remove all functions with NC21.0.3 release -remove_all_office_apps() { - # remove OnlyOffice-documentserver if installed - if is_app_installed documentserver_community - then - nextcloud_occ app:remove documentserver_community - fi - - # Disable OnlyOffice App if installed - if is_app_installed onlyoffice - then - nextcloud_occ app:remove onlyoffice - fi - - # remove richdocumentscode-documentserver if installed - if is_app_installed richdocumentscode - then - nextcloud_occ app:remove richdocumentscode - fi - - # Disable RichDocuments (Collabora App) if installed - if is_app_installed richdocuments - then - nextcloud_occ app:remove richdocuments - fi -} -remove_from_trusted_domains() { - local element="$1" - local count=0 - print_text_in_color "$ICyan" "Removing $element from trusted domains..." - while [ "$count" -lt 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ] - then - nextcloud_occ_no_check config:system:delete trusted_domains "$count" - break - else - count=$((count+1)) - fi - done -} - # Check if Collabora is installed using the new method if ! is_app_installed documentserver_community then @@ -84,61 +42,15 @@ fi # Check if collabora is installed and remove every trace of it if does_this_docker_exist 'collabora/code' then - msg_box "You can't run both Collabora and OnlyOffice on the same VM. \ -We will now remove Collabora from the server." - # Remove docker image - docker_prune_this 'collabora/code' - # Revoke LE - SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com") - if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] - then - yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" - REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" - for remove in $REMOVE_OLD - do rm -rf "$remove" - done - fi - # Remove Apache2 config - if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] - then - a2dissite "$SUBDOMAIN".conf - restart_webserver - rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" - fi - # Disable Collabora App if activated - if is_app_installed richdocuments - then - nextcloud_occ app:remove richdocuments - fi - # Remove trusted domain - remove_from_trusted_domains "$SUBDOMAIN" + # Removal + remove_collabora_docker fi # Check if Onlyoffice is installed and remove every trace of it if does_this_docker_exist 'onlyoffice/documentserver' then - msg_box "You can't run both Collabora and OnlyOffice on the same VM. We will now remove Onlyoffice from the server." - # Remove docker image - docker_prune_this 'onlyoffice/documentserver' - # Revoke LE - SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Onlyoffice, e.g: office.yourdomain.com") - if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] - then - yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" - REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" - for remove in $REMOVE_OLD - do rm -rf "$remove" - done - fi - # Remove Apache2 config - if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] - then - a2dissite "$SUBDOMAIN".conf - restart_webserver - rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" - fi - # Remove trusted domain - remove_from_trusted_domains "$SUBDOMAIN" + # Removal + remove_onlyoffice_docker fi # Remove all office apps diff --git a/apps/pico_cms.sh b/apps/pico_cms.sh index 3dc8f95a61..81c47023f5 100644 --- a/apps/pico_cms.sh +++ b/apps/pico_cms.sh @@ -18,41 +18,6 @@ debug_mode # Check if root root_check -# TODO: remove both functions with NC21.0.3 release -add_to_trusted_domains() { - local element="$1" - local count=0 - print_text_in_color "$ICyan" "Adding $element to trusted domains..." - while [ "$count" -le 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ] - then - break - elif [ -z "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" ] - then - nextcloud_occ_no_check config:system:set trusted_domains "$count" --value="$element" - break - else - count=$((count+1)) - fi - done -} -remove_from_trusted_domains() { - local element="$1" - local count=0 - print_text_in_color "$ICyan" "Removing $element from trusted domains..." - while [ "$count" -lt 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ] - then - nextcloud_occ_no_check config:system:delete trusted_domains "$count" - break - else - count=$((count+1)) - fi - done -} - # Nextcloud Main Domain NCDOMAIN=$(nextcloud_occ_no_check config:system:get overwrite.cli.url | sed 's|https://||;s|/||') diff --git a/lib.sh b/lib.sh index ee53672ba0..7d388c8263 100644 --- a/lib.sh +++ b/lib.sh @@ -1460,6 +1460,66 @@ else fi } +remove_collabora_docker() { + # Check if Collabora is previously installed + # If yes, then stop and prune the docker container + docker_prune_this 'collabora/code' + # Revoke LE + SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com") + if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] + then + yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" + REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" + for remove in $REMOVE_OLD + do rm -rf "$remove" + done + fi + # Remove Apache2 config + if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] + then + a2dissite "$SUBDOMAIN".conf + restart_webserver + rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" + fi + # Disable RichDocuments (Collabora App) if activated + if is_app_installed richdocuments + then + nextcloud_occ app:remove richdocuments + fi + # Remove trusted domain + remove_from_trusted_domains "$SUBDOMAIN" +} + +remove_onlyoffice_docker() { + # Check if Onlyoffice is previously installed + # If yes, then stop and prune the docker container + docker_prune_this 'onlyoffice/documentserver' + # Revoke LE + SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com") + if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] + then + yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" + REMOVE_OLD="$(find "$LETSENCRYPTPATH/" -name "$SUBDOMAIN*")" + for remove in $REMOVE_OLD + do rm -rf "$remove" + done + fi + # Remove Apache2 config + if [ -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" ] + then + a2dissite "$SUBDOMAIN".conf + restart_webserver + rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" + fi + # Disable onlyoffice if activated + if is_app_installed onlyoffice + then + nextcloud_occ app:remove onlyoffice + fi + # Remove trusted domain + remove_from_trusted_domains "$SUBDOMAIN" +} + # Remove all office apps remove_all_office_apps() { # remove OnlyOffice-documentserver if installed diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh index ed7fd1f414..3b4ab10b16 100644 --- a/nextcloud-startup-script.sh +++ b/nextcloud-startup-script.sh @@ -161,22 +161,18 @@ nc_update DEBUG=0 debug_mode -# Nextcloud 20 is required until 21.0.3 is out. Then NC 21 will be required. -lowest_compatible_nc 20 +# Nextcloud 21 is required +lowest_compatible_nc 21 # Import if missing and export again to import it with UUID zpool_import_if_missing -# Set phone region -if [ "${CURRENTVERSION%%.*}" -ge "21" ] +# Set phone region (needs the latest KEYBOARD_LAYOUT from lib) +# shellcheck source=lib.sh +source /var/scripts/fetch_lib.sh +if [ -n "$KEYBOARD_LAYOUT" ] then - # Set phone region (needs the latest KEYBOARD_LAYOUT from lib) - # shellcheck source=lib.sh - source /var/scripts/fetch_lib.sh - if [ -n "$KEYBOARD_LAYOUT" ] - then - nextcloud_occ config:system:set default_phone_region --value="$KEYBOARD_LAYOUT" - fi + nextcloud_occ config:system:set default_phone_region --value="$KEYBOARD_LAYOUT" fi # Is this run as a pure root user?