diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index 001d438a7..347868089 100755 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -52,8 +52,9 @@ then exit $? fi -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" +systemctl reset-failed ncp-update-nc 2>/dev/null ||: +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)$ ]] 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 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/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 && { 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 < /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/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 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/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 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 - + 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