Docker: nextcloud:12-apache: Maximal upload size not changeable & persisted

Created on 12 Aug 2017  路  4Comments  路  Source: nextcloud/docker

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.

bug help wanted

Most helpful comment

PR #131 should fix the permissions.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings