diff --git a/nextcloud/docker-compose.yml b/nextcloud/docker-compose.yml index 7f7b7e42..804caaac 100644 --- a/nextcloud/docker-compose.yml +++ b/nextcloud/docker-compose.yml @@ -50,6 +50,7 @@ services: - NEXTCLOUD_ADMIN_USER=umbrel - NEXTCLOUD_ADMIN_PASSWORD=${APP_PASSWORD} - NEXTCLOUD_TRUSTED_DOMAINS=${APP_DOMAIN}:${APP_NEXTCLOUD_PORT} ${APP_HIDDEN_SERVICE} ${DEVICE_HOSTNAME}:${APP_NEXTCLOUD_PORT} ${APP_NEXTCLOUD_LOCAL_IPS} + - PHP_UPLOAD_LIMIT=1024G depends_on: - db - redis diff --git a/nextcloud/hooks/post-start b/nextcloud/hooks/post-start new file mode 100755 index 00000000..a96c4e0b --- /dev/null +++ b/nextcloud/hooks/post-start @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail + +# To allow large files to be uploaded, Nextcloud's +# Apache instance must be configured with 'LimitRequestBody 0' +# inside the .htaccess file + +APP_DATA_DIR="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/..)" +DOT_HTACCESS_FILE="${APP_DATA_DIR}/data/nextcloud/.htaccess" + +echo "Waiting for file (${DOT_HTACCESS_FILE}) to exist..." + +# Wait up to 30 seconds... +for attempt in $(seq 1 300); do + if [[ -f "${DOT_HTACCESS_FILE}" ]]; then + echo ".htaccess file exists" + break + fi + sleep 0.1 +done + +if [[ ! -f "${DOT_HTACCESS_FILE}" ]]; then + echo ".htaccess was never created. Something is likely wrong with the Nextcloud app" + exit +fi + +# Now check if `LimitRequestBody 0` already exists within the .htaccess file +if ! cat "${DOT_HTACCESS_FILE}" | grep --quiet '^LimitRequestBody' +then + echo "Writing 'LimitRequestBody 0' config. to .htaccess" + + echo >> "${DOT_HTACCESS_FILE}" + echo "LimitRequestBody 0" >> "${DOT_HTACCESS_FILE}" +fi \ No newline at end of file diff --git a/nextcloud/umbrel-app.yml b/nextcloud/umbrel-app.yml index a07d0106..084a4a25 100644 --- a/nextcloud/umbrel-app.yml +++ b/nextcloud/umbrel-app.yml @@ -1,8 +1,8 @@ -manifestVersion: 1 +manifestVersion: 1.1 id: nextcloud category: Files name: Nextcloud -version: "22.2.10" +version: "22.2.10-build-2" tagline: Productivity platform that keeps you in control description: >- Nextcloud puts your data at your fingertips, under your control. @@ -25,7 +25,7 @@ description: >- Note: After logging in to Nextcloud please change the password to something secure before sharing the address with anyone. releaseNotes: >- - - This release fixes a critical bug in Nextcloud. + - Increase upload limit to 1TB developer: Nextcloud GmbH website: https://nextcloud.com dependencies: []