In order to change the maximal upload size via the UI (Admin -> Additional Settings -> File handling), Nextcloud must have write access to the .htaccess (and the .user.ini) in the webroot directory. In the container, the file belongs to root:www-data, but is 0x640 so it can't be modified by the apache process.
Also, as being part of the image, the modified .htaccess doesn't survive container re-creation.
I understand that this settings needs to be part of the .htaccess, but the information should be stored somewhere else too and written to .htaccess during container launch.
A temporary fix I came up with using docker compose is to use the build key in your nextcloud service configuration settings to set a custom build folder containing an alternate Dockerfile
In docker-compose.yaml I have this
app:
build: <Path to build directory containing Dockerfile>
instead of this
app:
image: nextcloud:latest
in the Dockerfile I have
FROM nextcloud:latest
RUN /bin/bash -c 'chmod g+w /usr/src/nextcloud/.htaccess'
RUN /bin/bash -c 'chmod g+w /usr/src/nextcloud/.user.ini'
It isn't exactly pretty but it will at least take care of the problem until it is fixed in the image.
PR #131 should fix the permissions.
@CoryTee
Clear, but I'd rather do it like this:
FROM nextcloud:latest
RUN /bin/bash -c 'chmod g+w /usr/src/nextcloud/.htaccess /usr/src/nextcloud/.user.ini'
;-)
I have the same issue. Given that there are options out of the box to change max upload filesize and htaccess rewrite rule, it is not expected that such changes are blocked by file permissions.
Most helpful comment
PR #131 should fix the permissions.