From b75074f30d6c2872c54fccfb3b98578a9eed0677 Mon Sep 17 00:00:00 2001 From: szaimen Date: Mon, 22 Aug 2022 11:14:19 +0200 Subject: [PATCH] Configure tempdirectory automatically Signed-off-by: szaimen --- Containers/nextcloud/entrypoint.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index c1c4b7e4..dd08ed0c 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -271,6 +271,15 @@ if [ -z "$(find "/mnt/ncdata/" -maxdepth 1 -mindepth 1 -type d -name "appdata_*" exit 1 fi +# Configure tempdirectory +if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then + mkdir -p "/mnt/ncdata/tmp/" + if ! grep -q upload_tmp_dir /usr/local/etc/php/conf.d/nextcloud.ini; then + echo "upload_tmp_dir = /mnt/ncdata/tmp/" >> /usr/local/etc/php/conf.d/nextcloud.ini + fi + php /var/www/html/occ config:system:set tempdirectory --value="/mnt/ncdata/tmp/" +fi + # Perform fingerprint update if instance was restored if [ -f "/mnt/ncdata/fingerprint.update" ]; then php /var/www/html/occ maintenance:data-fingerprint