Merge pull request #254 from nextcloud/enh/76/allow-to-define-a-nextcloud-mountpoint

allow nextcloud to access outside directories
This commit is contained in:
Simon L 2022-02-23 18:11:35 +01:00 committed by GitHub
commit af93aeebd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 0 deletions

View file

@ -54,6 +54,21 @@ else
sleep 10
fi
# Check for other options
if [ -n "$NEXTCLOUD_MOUNT" ]; then
if ! echo "$NEXTCLOUD_MOUNT" | grep -q "^/mnt/" \
&& ! echo "$NEXTCLOUD_MOUNT" | grep -q "^/media/" \
&& ! echo "$NEXTCLOUD_MOUNT" | grep -q "^/var/backups$"
then
echo "You've set NEXCLOUD_MOUNT but not to an allowed value.
The string must be equal to/start with '/mnt/' or '/media/' or be equal to '/var/backups'."
exit 1
elif [ "$NEXTCLOUD_MOUNT" = "/mnt/ncdata" ] || echo "$NEXTCLOUD_MOUNT" | grep -q "^/mnt/ncdata/"; then
echo "/mnt/ncdata and /mnt/ncdata/ are not allowed for NEXTCLOUD_MOUNT."
exit 1
fi
fi
# Add important folders
mkdir -p /mnt/docker-aio-config/data/
mkdir -p /mnt/docker-aio-config/session/