From e26123b56e4a1ebcf7bcc74b539095a01d9257b9 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 6 Apr 2023 15:12:59 +0200 Subject: [PATCH 1/9] NC 26.0.0 Signed-off-by: Daniel Hansson --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27949c6d..73b413bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ PR's are more than welcome. Happy Nextclouding! ### Different versions If you run Hyper-V or want 500 GB, 1 TB or 2 TB VM you can download it from [T&M Hansson IT's shop](https://shop.hanssonit.se/product-category/virtual-machine/nextcloud/). +## 26.0.0 + +### Full changelog: +- [VM](https://github.com/nextcloud/vm/releases/tag/26.0.0) +- [Nextcloud](https://nextcloud.com/changelog/#latest26) + ## 25.0.2 ### Small changelog: From 476c0bce1e578dd02136bbea5b1de55afc1b97fb Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 6 Apr 2023 17:40:09 +0200 Subject: [PATCH 2/9] stealth! Signed-off-by: Daniel Hansson --- nextcloud_update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nextcloud_update.sh b/nextcloud_update.sh index 5b049186..38278711 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -35,10 +35,10 @@ is_process_running dpkg # Automatically restart services (Ubuntu 22.04) if ! version 16.04.10 "$DISTRO" 20.04.10 then - if ! grep -r "{restart} = 'a'" /etc/needrestart/needrestart.conf + if ! grep -rq "{restart} = 'a'" /etc/needrestart/needrestart.conf then # Restart mode: (l)ist only, (i)nteractive or (a)utomatically. - sed -i "s|#\$nrconf{restart} = .*|\$nrconf{restart} = 'a';|g" /etc/needrestart/needrestart.conf + sed -i "s|#\$nrconf{restart} =.*|\$nrconf{restart} = 'a'\;|g" /etc/needrestart/needrestart.conf fi fi From bb4554a654367e6ba2efd8ad9e1ce59fa5c18224 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 6 Apr 2023 17:40:27 +0200 Subject: [PATCH 3/9] Install imaginary during first setup instead (#2469) --- menu/additional_apps.sh | 6 +++--- nextcloud_install_production.sh | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/menu/additional_apps.sh b/menu/additional_apps.sh index 29c1b2e3..129cafc1 100644 --- a/menu/additional_apps.sh +++ b/menu/additional_apps.sh @@ -39,10 +39,10 @@ choice=$(whiptail --title "$TITLE" --checklist \ "Which apps do you want to install?\n\nAutomatically configure and install selected apps $CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \ "Documentserver" "(OnlyOffice or Collabora - Docker or Integrated)" OFF \ -"Bitwarden" "(External password manager)" OFF \ +"Bitwarden" "(External password manager) [4GB RAM]" OFF \ "Fail2ban " "(Extra Bruteforce protection)" "$STARTUP_SWITCH" \ -"Recognize" "(Use [local] AI on your photos in Nextcloud)" OFF \ -"Imaginary" "(Generate image previews for Nextcloud) [4GB RAM + 4 CPU]" "OFF" \ +"Recognize" "(Use [local] AI on your photos in Nextcloud) [8GB RAM]" OFF \ +"Imaginary" "(Generate image previews for Nextcloud) [4GB RAM]" "$STARTUP_SWITCH" \ "Webmin" "(Server GUI like Cpanel)" OFF \ "Talk" "(Video calls and chat for Nextcloud - requires port 3478)" "$STARTUP_SWITCH" \ "SMB-mount" "(Mount SMB-shares from your local network)" OFF \ diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index 15e32a4f..36e0000d 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -920,7 +920,6 @@ $CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \ "Deck" "" ON \ "Collectives" "" ON \ "Suspicios Login detetion" "" ON \ -"Imaginary" "" ON \ "IssueTemplate" "" OFF \ "Group-Folders" "" OFF 3>&1 1>&2 2>&3) fi @@ -965,9 +964,6 @@ case "$choice" in *"Suspicios Login detetion"*) install_and_enable_app suspicios_login ;;& - *"Imaginary"*) - run_script APP imaginary - ;;& *"Group-Folders"*) install_and_enable_app groupfolders ;;& From bab1a907dcc04ac9e2952749b0081cb3dd8ac87e Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 6 Apr 2023 22:33:19 +0200 Subject: [PATCH 4/9] Wording Signed-off-by: Daniel Hansson --- apps/talk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/talk.sh b/apps/talk.sh index 321bfb2a..4c8c3c76 100644 --- a/apps/talk.sh +++ b/apps/talk.sh @@ -4,8 +4,8 @@ true SCRIPT_NAME="Nextcloud Talk" -SCRIPT_EXPLAINER="This script installs Nextcloud Talk and also offers the possibility \ -to install the so-called High-Performance-Backend, which makes it possible to host more video calls than it would be with the standard Talk app. \ +SCRIPT_EXPLAINER="This script installs Nextcloud Talk whcih is a replacement for Teams/Skype and similar.\ +You will also be offered the possibility to install the so-called High-Performance-Backend, which makes it possible to host more video calls than it would be with the standard Talk app. \ It's called 'Talk Signaling' and you will be offered to install it as part two of this script." # shellcheck source=lib.sh source /var/scripts/fetch_lib.sh From 419239be98177c84cc99e6678b110ba2f6e0f8b5 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 6 Apr 2023 23:06:38 +0200 Subject: [PATCH 5/9] fix msg_box to show correct path in menu script Signed-off-by: Daniel Hansson --- lib.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib.sh b/lib.sh index 421d0936..bb35eaf4 100644 --- a/lib.sh +++ b/lib.sh @@ -761,13 +761,24 @@ fi check_nextcloud_https() { if ! nextcloud_occ_no_check config:system:get overwrite.cli.url | grep -q "https" then - msg_box "Sorry, but Nextcloud needs to be run on HTTPS. + if [ "$1" == 'Collabora (Docker)' ] || [ "$1" == 'OnlyOffice (Docker)' ] + then + msg_box "Sorry, but Nextcloud needs to be run on HTTPS. You can easily activate TLS (HTTPS) by running the Let's Encrypt script. More info here: https://bit.ly/37wRCin To run this script again, just exectue 'sudo bash $SCRIPTS/menu.sh' and choose: Additional Apps --> Documentserver --> $1." - exit + exit + else + msg_box "Sorry, but Nextcloud needs to be run on HTTPS. +You can easily activate TLS (HTTPS) by running the Let's Encrypt script. +More info here: https://bit.ly/37wRCin + +To run this script again, just exectue 'sudo bash $SCRIPTS/menu.sh' and choose: +Additional Apps --> $1." + exit + fi fi } From 603b99c1e0f4a6d90f7bb2937f05f31d86b4f9ae Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 6 Apr 2023 23:50:55 +0200 Subject: [PATCH 6/9] inform about restarting webserver Signed-off-by: Daniel Hansson --- lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib.sh b/lib.sh index bb35eaf4..639e64c3 100644 --- a/lib.sh +++ b/lib.sh @@ -785,6 +785,7 @@ Additional Apps --> $1." restart_webserver() { # https://github.com/nextcloud/vm/issues/2358 sleep 2 +print_text_in_color "$ICyan" "Restarting Apache2 and PHP-FPM..." check_command systemctl restart apache2.service check_php if is_this_installed php"$PHPVER"-fpm From 6a5b85fddddd456d71f17ae7345b92206dfcb40f Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 6 Apr 2023 23:53:15 +0200 Subject: [PATCH 7/9] remove whitespace Signed-off-by: Daniel Hansson --- nextcloud-startup-script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh index 6bfbeff6..d497129a 100644 --- a/nextcloud-startup-script.sh +++ b/nextcloud-startup-script.sh @@ -369,7 +369,7 @@ else then msg_box "The new password for the current CLI user in Ubuntu ($UNIXUSER) is now set to: $UNIX_PASSWORD - This is used when you login to the Ubuntu CLI." +This is used when you login to the Ubuntu CLI." fi fi unset UNIX_PASSWORD From 84ed27c155a2d5410aa28bb48128f30689acd54a Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Fri, 7 Apr 2023 16:39:41 +0200 Subject: [PATCH 8/9] Fix PostgreSQL bug (regression) (#2471) --- nextcloud_update.sh | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/nextcloud_update.sh b/nextcloud_update.sh index 38278711..2642a34e 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -906,15 +906,34 @@ fi if is_this_installed postgresql-common then cd /tmp - if sudo -u postgres psql -c "SELECT 1 AS result FROM pg_database WHERE datname='$NCDB'" | grep "1 row" > /dev/null + # Test connection to PostgreSQL + if ! sudo -u postgres psql -c "\q" then - print_text_in_color "$ICyan" "Doing pgdump of $NCDB..." - check_command sudo -u postgres pg_dump -Fc "$NCDB" > "$BACKUP"/nextclouddb.dump - # Import: - # sudo -u postgres pg_restore --verbose --clean --no-acl --no-owner -h localhost -U ncadmin -d nextcloud_db "$BACKUP"/nextclouddb.dump + # If it fails, trust the 'postgres' user to be able to perform backup + sed -i "s|local all postgres .*|local all postgres trust|g" /etc/postgresql/*/main/pg_hba.conf + systemctl restart postgresql.service + if sudo -u postgres psql -c "SELECT 1 AS result FROM pg_database WHERE datname='$NCDB'" | grep "1 row" > /dev/null + then + print_text_in_color "$ICyan" "Doing pgdump of $NCDB..." + check_command sudo -u postgres pg_dump -Fc "$NCDB" > "$BACKUP"/nextclouddb.dump + # Import: + # sudo -u postgres pg_restore --verbose --clean --no-acl --no-owner -h localhost -U ncadmin -d nextcloud_db "$BACKUP"/nextclouddb.dump + else + print_text_in_color "$ICyan" "Doing pgdump of all databases..." + check_command sudo -u postgres pg_dumpall > "$BACKUP"/alldatabases.dump + fi else - print_text_in_color "$ICyan" "Doing pgdump of all databases..." - check_command sudo -u postgres pg_dumpall > "$BACKUP"/alldatabases.dump + # If there's no issues, then continue as normal + if sudo -u postgres psql -c "SELECT 1 AS result FROM pg_database WHERE datname='$NCDB'" | grep "1 row" > /dev/null + then + print_text_in_color "$ICyan" "Doing pgdump of $NCDB..." + check_command sudo -u postgres pg_dump -Fc "$NCDB" > "$BACKUP"/nextclouddb.dump + # Import: + # sudo -u postgres pg_restore --verbose --clean --no-acl --no-owner -h localhost -U ncadmin -d nextcloud_db "$BACKUP"/nextclouddb.dump + else + print_text_in_color "$ICyan" "Doing pgdump of all databases..." + check_command sudo -u postgres pg_dumpall > "$BACKUP"/alldatabases.dump + fi fi fi From f1ff45f0e28faf31ab4ea9c8cbb6bb69c99d263a Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Fri, 7 Apr 2023 17:13:25 +0200 Subject: [PATCH 9/9] backup the original file just in case Signed-off-by: Daniel Hansson --- nextcloud_update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/nextcloud_update.sh b/nextcloud_update.sh index 2642a34e..a6acd649 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -910,6 +910,7 @@ then if ! sudo -u postgres psql -c "\q" then # If it fails, trust the 'postgres' user to be able to perform backup + rsync -a /etc/postgresql/*/main/pg_hba.conf "$BACKUP"/pg_hba.conf_BACKUP sed -i "s|local all postgres .*|local all postgres trust|g" /etc/postgresql/*/main/pg_hba.conf systemctl restart postgresql.service if sudo -u postgres psql -c "SELECT 1 AS result FROM pg_database WHERE datname='$NCDB'" | grep "1 row" > /dev/null