From c6de7c6a353ddc73764c27ebd38b8fa22cff8521 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:30:30 +0100 Subject: [PATCH] option skip permissions https://github.com/alexbelgium/hassio-addons/issues/1807#issuecomment-2721206933 --- nextcloud/CHANGELOG.md | 1 + nextcloud/config.json | 3 ++- nextcloud/rootfs/etc/cont-init.d/01-folders.sh | 13 +++++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/nextcloud/CHANGELOG.md b/nextcloud/CHANGELOG.md index 3eb8ccc91..747538184 100644 --- a/nextcloud/CHANGELOG.md +++ b/nextcloud/CHANGELOG.md @@ -1,3 +1,4 @@ +- New option : skip_permissions_check to skip permissions check ## 31.0.0 (01-03-2025) - Update to latest version from linuxserver/docker-nextcloud (changelog : https://github.com/linuxserver/docker-nextcloud/releases) diff --git a/nextcloud/config.json b/nextcloud/config.json index 53017aff1..df32c8b7b 100644 --- a/nextcloud/config.json +++ b/nextcloud/config.json @@ -148,6 +148,7 @@ "keyfile": "str", "localdisks": "str?", "networkdisks": "str?", + "skip_permissions_check": "bool?", "trusted_domains": "str?", "use_own_certs": "bool" }, @@ -158,6 +159,6 @@ "uart": true, "udev": true, "url": "https://github.com/alexbelgium/hassio-addons/tree/master/nextcloud", - "version": "31.0.0", + "version": "31.0.0-2", "webui": "https://[HOST]:[PORT:443]" } diff --git a/nextcloud/rootfs/etc/cont-init.d/01-folders.sh b/nextcloud/rootfs/etc/cont-init.d/01-folders.sh index 0b22884eb..615b89e04 100755 --- a/nextcloud/rootfs/etc/cont-init.d/01-folders.sh +++ b/nextcloud/rootfs/etc/cont-init.d/01-folders.sh @@ -42,9 +42,18 @@ if [ -f /data/config/nginx/site-confs/default.conf ]; then sed -i "s|front_controller_active true|front_controller_active false|g" /defaults/nginx/site-confs/default.conf.sample fi +# Set permissions mkdir -p "$datadirectory" -if [[ "$PUID" != "0" ]] && [[ "$PGID" != "0" ]]; then - echo "... setting permissions" +if bashio::config.true "skip_permissions_check"; then + bashio::log.yellow "--------------------------------------------" + bashio::log.yellow "Permissions check skipped : \"skip_permissions_check\" is true" + bashio::log.yellow "--------------------------------------------" +elif [[ "$PUID" != "0" ]] && [[ "$PGID" != "0" ]]; then + bashio::log.yellow "--------------------------------------------" + bashio::log.yellow "Permissions check skipped : \"PUID and PGID are 0\" is true" + bashio::log.yellow "--------------------------------------------" +else + bashio::log.yellow "... setting permissions, this might take a long time. If it takes too long at each boot, you could instead activate skip_permissions_check in the addon options" chmod 755 -R "$datadirectory" || true chown -R "$PUID:$PGID" "$datadirectory" || true fi