From 94332db835b747a18caff0650eed256214ee9a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 12 Oct 2024 23:07:25 +0200 Subject: [PATCH 1/9] dnsmasq.sh: Don't fix it if it ain't broken 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/CONFIG/nc-datadir.sh | 2 +- bin/ncp/NETWORKING/dnsmasq.sh | 19 ++++++++++++++----- install.sh | 5 ----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/bin/ncp/CONFIG/nc-datadir.sh b/bin/ncp/CONFIG/nc-datadir.sh index 4dfaea035..372c82034 100644 --- a/bin/ncp/CONFIG/nc-datadir.sh +++ b/bin/ncp/CONFIG/nc-datadir.sh @@ -103,7 +103,7 @@ configure() cd /var/www/nextcloud [[ "$BUILD_MODE" == 1 ]] || save_maintenance_mode - echo "moving data directory from ${SRCDIR} to ${BASEDIR}..." + echo "moving data directory from ${SRCDIR} to ${DATADIR}..." # use subvolumes, if BTRFS [[ "$(stat -fc%T "${BASEDIR}")" == "btrfs" ]] && ! is_docker && { diff --git a/bin/ncp/NETWORKING/dnsmasq.sh b/bin/ncp/NETWORKING/dnsmasq.sh index 4f93c89f8..1427a4b06 100644 --- a/bin/ncp/NETWORKING/dnsmasq.sh +++ b/bin/ncp/NETWORKING/dnsmasq.sh @@ -14,30 +14,39 @@ install() set -x apt-get update apt-get install --no-install-recommends -y dnsmasq + sleep 10 rc=0 service dnsmasq status > /dev/null 2>&1 || rc=$? - [[ $rc -eq 3 ]] && ! [[ "$INIT_SYSTEM" =~ ^("chroot"|"unknown")$ ]] && command -v systemd-resolve > /dev/null || { + if [[ $rc -eq 3 ]] && ! [[ "$INIT_SYSTEM" =~ ^("chroot"|"unknown")$ ]] + then echo "Applying workaround for dnsmasq bug (compare issue #1446)" mkdir -p /etc/systemd/resolved.conf.d if systemctl status systemd-resolved then - cat < /etc/systemd/resolved.conf.d/nostublistener.conf + cat < /etc/systemd/resolved.conf.d/nostublistener.conf [Resolve] DNSStubListener=no EOF [[ "$INIT_SYSTEM" != "systemd" ]] || systemctl restart systemd-resolved - else + elif systemctl status resolvconf + then systemctl stop resolvconf systemctl start dnsmasq systemctl status dnsmasq + else + echo "dnsmasq failed to start and no workaround could be found. This means, the installer failed." + false fi # service systemd-resolved stop || true systemctl start dnsmasq systemctl status dnsmasq - } + fi service dnsmasq stop - [[ "$INIT_SYSTEM" != "systemd" ]] || systemctl start systemd-resolved || systemctl start resolvconf + if [[ "$INIT_SYSTEM" == "systemd" ]] && systemctl list-unit-files resolvconf.service + then + systemctl start resolvconf + fi update-rc.d dnsmasq disable || rm /etc/systemd/system/multi-user.target.wants/dnsmasq.service return 0 diff --git a/install.sh b/install.sh index ceafe6597..e77104ab8 100644 --- a/install.sh +++ b/install.sh @@ -74,11 +74,6 @@ cp etc/ncp.cfg /usr/local/etc/ cp -r etc/ncp-templates /usr/local/etc/ install_app lamp.sh -if [[ -d "/run/systemd/system" ]] && is_lxc -then - DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y systemd-resolved - systemctl enable systemd-resolved -fi install_app bin/ncp/CONFIG/nc-nextcloud.sh run_app_unsafe bin/ncp/CONFIG/nc-nextcloud.sh rm /usr/local/etc/ncp-config.d/nc-nextcloud.cfg # armbian overlay is ro From 3cb98599def4380c2f506c0db14b4ff5fbff6ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sun, 13 Oct 2024 02:59:42 +0200 Subject: [PATCH 2/9] Add support for Nextcloud 30 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-config.d/nc-nextcloud.cfg | 2 +- etc/ncp.cfg | 2 +- ncp-app/appinfo/info.xml | 2 +- ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/ncp-config.d/nc-nextcloud.cfg b/etc/ncp-config.d/nc-nextcloud.cfg index a3c428d17..3bf036757 100644 --- a/etc/ncp-config.d/nc-nextcloud.cfg +++ b/etc/ncp-config.d/nc-nextcloud.cfg @@ -9,7 +9,7 @@ { "id": "VER", "name": "Version", - "value": "29.0.4" + "value": "30.0.1" }, { "id": "MAXFILESIZE", diff --git a/etc/ncp.cfg b/etc/ncp.cfg index 19b3afcdd..af87f23ae 100644 --- a/etc/ncp.cfg +++ b/etc/ncp.cfg @@ -1,5 +1,5 @@ { - "nextcloud_version": "29.0.4", + "nextcloud_version": "30.0.1", "php_version": "8.3", "release": "bookworm" } diff --git a/ncp-app/appinfo/info.xml b/ncp-app/appinfo/info.xml index fbf207ddb..1fe880710 100644 --- a/ncp-app/appinfo/info.xml +++ b/ncp-app/appinfo/info.xml @@ -12,7 +12,7 @@ tools https://github.com/nextcloud/nextcloudpi/issues - + diff --git a/ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml b/ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml index 8d09f5387..46b4ed51a 100644 --- a/ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml +++ b/ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml @@ -25,7 +25,7 @@ The first time you install this app, before using a cron job, you properly want - + From 1579f7b2eabc4b38ed06609c54a61dd6eff0fd81 Mon Sep 17 00:00:00 2001 From: Tobias K <6317548+thecalcaholic@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:27:21 +0100 Subject: [PATCH 3/9] ncp-update-nc: Fix resetting job after failed update attempt 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-update-nc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index 001d438a7..4ae12989e 100755 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -52,7 +52,7 @@ then exit $? fi -systemctl reset-failed ncp-encrypt 2>/dev/null ||: +systemctl reset-failed ncp-update-nc 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 From 430e56ee7b8122559be0f2dc0ac17e00ad690060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:47:25 +0100 Subject: [PATCH 4/9] update-nc.sh: Improve informational output during update 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-update-nc.d/update-nc.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/ncp-update-nc.d/update-nc.sh b/bin/ncp-update-nc.d/update-nc.sh index fd9e0d411..ade4393e7 100755 --- a/bin/ncp-update-nc.d/update-nc.sh +++ b/bin/ncp-update-nc.d/update-nc.sh @@ -59,9 +59,15 @@ grep -qP "\d+\.\d+\.\d+" <<<"$TARGET_VERSION" || { echo "Malformed version $TA echo "Current Nextcloud version $CURRENT" echo "Requested Nextcloud version $REQUESTED_VERSION" echo "Selected Nextcloud version $TARGET_VERSION" -if [[ "$TARGET_VERSION" != "$REQUESTED_VERSION" ]] + +if [[ "$REQUESTED_VERSION" == "latest" ]] +then + echo "INFO: You have requested an update to the latest available version that can be performed directly, which is '${TARGET_VERSION}'. Updates can only performed to the next major version (or the latest minor version of the current major version). If you run ncp-update-nc again after this update completes, a new version might be available." + sleep 3 +elif [[ "$TARGET_VERSION" != "$REQUESTED_VERSION" ]] then echo "INFO: You have requested an update to '${REQUESTED_VERSION}', but a direct update to '${REQUESTED_VERSION}' cannot be performed, so the latest available version that can be updated to (${TARGET_VERSION}) has been selected automatically." + sleep 3 fi # make sure that cron.php is not running and there are no pending jobs From 10a5b4e96bf9f4e1a38c6ba4c713d216a921a3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:05:46 +0100 Subject: [PATCH 5/9] nc-init.sh: Add maintenance:repair step to nextcloud initialization 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/CONFIG/nc-init.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/ncp/CONFIG/nc-init.sh b/bin/ncp/CONFIG/nc-init.sh index 0bc62554c..09c9e1c0e 100644 --- a/bin/ncp/CONFIG/nc-init.sh +++ b/bin/ncp/CONFIG/nc-init.sh @@ -189,6 +189,7 @@ EOF # TODO temporary workaround for https://github.com/nextcloud/server/pull/13358 ncc -n db:convert-filecache-bigint ncc db:add-missing-indices + ncc maintenance:repair --include-expensive # Default trusted domain (only from ncp-config) test -f /usr/local/bin/nextcloud-domain.sh && { From 39a05f8ac6c73564af7cff19e0fbd430c8ce1942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Wed, 6 Nov 2024 17:43:33 +0100 Subject: [PATCH 6/9] ncp-update-nc: Use oneshot service type with start and stop timeout for systemd-run 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-update-nc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index 4ae12989e..347868089 100755 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -53,7 +53,8 @@ then fi systemctl reset-failed ncp-update-nc 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" +systemd-run -u 'ncp-update-nc' --service-type=oneshot --no-block -p TimeoutStartSec="24h" -p TimeoutStopSec="1h" \ + 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)$ ]] From c10bf36cbbd7b7c5d64ac2fa0685ac029f0d0c1d Mon Sep 17 00:00:00 2001 From: Moritz Breitbach Date: Wed, 4 Sep 2024 17:17:37 +0200 Subject: [PATCH 7/9] Fix typo in `nc-previews-auto.sh` Signed-off-by: Moritz Breitbach --- bin/ncp/CONFIG/nc-previews-auto.sh | 4 ++-- updates/1.55.0.sh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/ncp/CONFIG/nc-previews-auto.sh b/bin/ncp/CONFIG/nc-previews-auto.sh index c18a10e61..7b09b0028 100644 --- a/bin/ncp/CONFIG/nc-previews-auto.sh +++ b/bin/ncp/CONFIG/nc-previews-auto.sh @@ -23,8 +23,8 @@ configure() grep -qP "^\d+$" <<<"$RUNTIME" || { echo "Invalid RUNTIME value $RUNTIME"; return 1; } RUNTIME=$((RUNTIME*60)) - echo "0 2 * * * root /usr/local/bin/nc-previews" > /etc/cron.d/ncp-previews-auto - chmod 644 /etc/cron.d/ncp-previews-auto + echo "0 2 * * * root /usr/local/bin/nc-previews" > /etc/cron.d/nc-previews-auto + chmod 644 /etc/cron.d/nc-previews-auto cat > /usr/local/bin/nc-previews < Date: Fri, 8 Nov 2024 17:44:23 +0100 Subject: [PATCH 8/9] Move ncp-previews-auto fix to updates/1.55.3.sh 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> --- updates/1.55.0.sh | 2 -- updates/1.55.3.sh | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 updates/1.55.3.sh diff --git a/updates/1.55.0.sh b/updates/1.55.0.sh index b22d0217b..45033e31f 100644 --- a/updates/1.55.0.sh +++ b/updates/1.55.0.sh @@ -2,5 +2,3 @@ apt-get update apt-get install -y --no-install-recommends logrotate - -[ -f /etc/cron.d/ncp-previews-auto ] && mv /etc/cron.d/ncp-previews-auto /etc/cron.d/nc-previews-auto diff --git a/updates/1.55.3.sh b/updates/1.55.3.sh new file mode 100644 index 000000000..78ea8436e --- /dev/null +++ b/updates/1.55.3.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +[ -f /etc/cron.d/ncp-previews-auto ] && mv /etc/cron.d/ncp-previews-auto /etc/cron.d/nc-previews-auto From 776c1903195fc38402235b12371b77817b214c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Fri, 8 Nov 2024 18:14:01 +0100 Subject: [PATCH 9/9] changelog.md: Document v1.55.3 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/changelog.md b/changelog.md index 5af22a78d..b80c2c597 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,17 @@ # NextcloudPi Changelog +## [v1.55.3](https://github.com/nextcloud/nextcloudpi/tree/v1.55.3) (2024-11-08) Nextcloud 30 and fixes + +### Changes + +- Support for Nextcloud 30 ([#1957](https://github.com/nextcloud/nextcloudpi/issues/1957)) + +### Fixes + +- Fix resetting failed state of previous ncp-update-nc job ([#1992](https://github.com/nextcloud/nextcloudpi/issues/1992)) +- Fix installer on systems using resolvconf as DNS manager ([#1926](](https://github.com/nextcloud/nextcloudpi/issues/1926)) +- Fix typo that prevents ncp-previews from being disabled (Thanks @m-breitbach) + ## [v1.55.2](https://github.com/nextcloud/nextcloudpi/tree/v1.55.2) (2024-09-24) Hotfix release ### Fixes