From aaf75369435024b096a8c23301daded9f8209e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sun, 22 Sep 2024 21:17:34 +0200 Subject: [PATCH 1/3] nc-autoupdate-nc: Fix erroneous update/updated notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> --- bin/ncp-check-nc-version | 5 ++- bin/ncp-update-nc | 11 ++++--- bin/ncp-update-nc.d/update-nc.sh | 2 +- bin/ncp/SECURITY/nc-encrypt.sh | 4 +-- bin/ncp/UPDATES/nc-autoupdate-nc.sh | 2 +- staged_rollouts/v1.55.2.txt | 50 +++++++++++++++++++++++++++++ updates/1.55.2.sh | 6 ++++ 7 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 staged_rollouts/v1.55.2.txt create mode 100644 updates/1.55.2.sh diff --git a/bin/ncp-check-nc-version b/bin/ncp-check-nc-version index 972a5b8a4..1de2474d2 100755 --- a/bin/ncp-check-nc-version +++ b/bin/ncp-check-nc-version @@ -8,7 +8,10 @@ source /usr/local/etc/library.sh # sets NCLATESTVER CURRENT="$(nc_version)" NEXT_VERSION="$(determine_nc_update_version "${CURRENT}" "${NCLATESTVER?}")" -[[ -n "$NEXT_VERSION" ]] || exit 0 +if [[ -z "$NEXT_VERSION" ]] || [[ "$NEXT_VERSION" == "${CURRENT}" ]] +then + exit 0 +fi NOTIFIED=/var/run/.nc-version-notified diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index 337cc8c84..001d438a7 100755 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -26,19 +26,19 @@ VER="$1" connect_to_nc_update() { tail -n 100 -f "/var/log/ncp-update-nc.log" & tail_pid=$! + trap "kill '$tail_pid'" EXIT while [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|activating|deactivating)$ ]] do sleep 3 done - kill "$tail_pid" if [[ "$(systemctl is-active ncp-update-nc ||:)" == "inactive" ]] then echo "Nextcloud update finished successfully." return 0 elif [[ "$(systemctl is-active ncp-update-nc ||:)" == "failed" ]] then - echo "Nextcloud update failed." + echo "Nextcloud update failed (or was installed already)." return 1 else echo "Nextcloud update was not found or failed (unexpected status: '$(systemctl is-active ncp-update-nc ||:)')" @@ -52,15 +52,16 @@ then exit $? fi -systemctl reset-failed ncp-encrypt ||: -systemd-run -u 'ncp-update-nc' bash -c "DBG='${DBG:-}' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER}' |& tee /var/log/ncp-update-nc.log" -sleep 5 +systemctl reset-failed ncp-encrypt 2>/dev/null ||: +systemd-run -u 'ncp-update-nc' bash -c "set -o pipefail; DBG='${DBG:-}' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER}' |& tee /var/log/ncp-update-nc.log" +sleep 1 if ! [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|inactive|activating|deactivating)$ ]] then echo "Failed to start ncp-update-nc" [[ -f /var/log/ncp-update-nc.log ]] && cat /var/log/ncp-update-nc.log systemctl status --no-pager ncp-update-nc ||: + exit 1 fi connect_to_nc_update diff --git a/bin/ncp-update-nc.d/update-nc.sh b/bin/ncp-update-nc.d/update-nc.sh index b8bdd18c3..fd9e0d411 100755 --- a/bin/ncp-update-nc.d/update-nc.sh +++ b/bin/ncp-update-nc.d/update-nc.sh @@ -31,7 +31,7 @@ fi TARGET_VERSION="$(determine_nc_update_version "${CURRENT?}" "${NCLATESTVER}" "${REQUESTED_VERSION}")" [[ "$TARGET_VERSION" == "$CURRENT" ]] && { echo "Nextcloud version ${CURRENT} is already installed. Nothing to do." - exit 0 + exit 1 } [[ -n "$TARGET_VERSION" ]] || { echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update." diff --git a/bin/ncp/SECURITY/nc-encrypt.sh b/bin/ncp/SECURITY/nc-encrypt.sh index efed4d9bb..bde94e6bc 100644 --- a/bin/ncp/SECURITY/nc-encrypt.sh +++ b/bin/ncp/SECURITY/nc-encrypt.sh @@ -58,7 +58,7 @@ configure() export PASSWORD # Just mount already encrypted data if [[ -f "${encdir?}"/gocryptfs.conf ]]; then - systemctl reset-failed ncp-encrypt ||: + systemctl reset-failed ncp-encrypt 2>/dev/null ||: systemd-run -u ncp-encrypt -E PASSWORD bash -c "gocryptfs -fg -allow_other -q '${encdir}' '${datadir}' <<<\"\${PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log" # switch to the regular virtual hosts after we decrypt, so we can access NC and ncp-web @@ -88,7 +88,7 @@ configure() mv "${datadir?}" "${tmpdir?}" mkdir "${datadir}" - systemctl reset-failed ncp-encrypt ||: + systemctl reset-failed ncp-encrypt 2>/dev/null ||: systemd-run -u ncp-encrypt -E PASSWORD bash -c "gocryptfs -fg -allow_other -q '${encdir}' '${datadir}' <<<\"\${PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log" maxtries=5 diff --git a/bin/ncp/UPDATES/nc-autoupdate-nc.sh b/bin/ncp/UPDATES/nc-autoupdate-nc.sh index ee95ee238..3a750988a 100644 --- a/bin/ncp/UPDATES/nc-autoupdate-nc.sh +++ b/bin/ncp/UPDATES/nc-autoupdate-nc.sh @@ -23,7 +23,7 @@ configure() source /usr/local/etc/library.sh echo -e "[ncp-update-nc]" >> /var/log/ncp.log -/usr/local/bin/ncp-update-nc "$NCLATESTVER" 2>&1 | tee -a /var/log/ncp.log +/usr/local/bin/ncp-update-nc "latest" 2>&1 | tee -a /var/log/ncp.log if [[ \${PIPESTATUS[0]} -eq 0 ]]; then diff --git a/staged_rollouts/v1.55.2.txt b/staged_rollouts/v1.55.2.txt new file mode 100644 index 000000000..ebefaca78 --- /dev/null +++ b/staged_rollouts/v1.55.2.txt @@ -0,0 +1,50 @@ +0 +1 +2 +3 +4 +5 +6 +9 +10 +13 +15 +26 +29 +30 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +51 +54 +55 +59 +60 +62 +63 +64 +68 +69 +70 +73 +74 +75 +76 +84 +89 +92 +96 \ No newline at end of file diff --git a/updates/1.55.2.sh b/updates/1.55.2.sh new file mode 100644 index 000000000..3321c3bc7 --- /dev/null +++ b/updates/1.55.2.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +source /usr/local/etc/library.sh + +run_app nc-autoupdate-nc From 9890d68532e24304433788b92a2aea9c0d028990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:18:41 +0200 Subject: [PATCH 2/3] 91-ncp.cnf.sh: Increase allowed packet size for mysqldump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> --- etc/ncp-templates/mysql/91-ncp.cnf.sh | 3 +++ updates/1.55.2.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/etc/ncp-templates/mysql/91-ncp.cnf.sh b/etc/ncp-templates/mysql/91-ncp.cnf.sh index 0a1ccd9dd..c65717122 100644 --- a/etc/ncp-templates/mysql/91-ncp.cnf.sh +++ b/etc/ncp-templates/mysql/91-ncp.cnf.sh @@ -19,6 +19,9 @@ innodb_file_per_table=1 innodb_file_format=barracuda max_allowed_packet=256M +[mysqldump] +max_allowed_packet = 256M + [server] # innodb settings skip-name-resolve diff --git a/updates/1.55.2.sh b/updates/1.55.2.sh index 3321c3bc7..608718fcb 100644 --- a/updates/1.55.2.sh +++ b/updates/1.55.2.sh @@ -4,3 +4,6 @@ set -e source /usr/local/etc/library.sh run_app nc-autoupdate-nc + +install_template "mysql/91-ncp.cnf.sh" "/etc/mysql/mariadb.conf.d/91-ncp.cnf" +service mariadb reload From 50e1adf6c062474066bbb66e21ae8eb7bf99f792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Tue, 24 Sep 2024 19:35:11 +0200 Subject: [PATCH 3/3] changelog.md: Document v1.55.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> --- changelog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changelog.md b/changelog.md index a53252dfa..5af22a78d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # NextcloudPi Changelog +## [v1.55.2](https://github.com/nextcloud/nextcloudpi/tree/v1.55.2) (2024-09-24) Hotfix release + +### Fixes + +- Increase the maximum package size for mysqldump to 256M (fixes [#1979](https://github.com/nextcloud/nextcloudpi/issues/1979)) +- Fix repeated erroneous update success messages for auto updates (fixes [#1979](https://github.com/nextcloud/nextcloudpi/issues/1979), [#1981](https://github.com/nextcloud/nextcloudpi/issues/1981)) + ## [v1.55.1](https://github.com/nextcloud/nextcloudpi/tree/v1.55.1) (2024-09-08) Hotfix release ### Fixes