diff --git a/docker/README.md b/docker/README.md index 267f02a31..bb0632533 100644 --- a/docker/README.md +++ b/docker/README.md @@ -20,6 +20,8 @@ The following env variables can be set to configure your Roundcube Docker instan `ROUNDCUBEMAIL_PLUGINS` - List of built-in plugins to activate. Defaults to `archive,zipdownload` +`ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE` - File upload size limit; defaults to `5M` + By default, the image will use a local SQLite database for storing user account metadata. It'll be created inside the `/var/www/html` volume and can be backed up from there. Please note that this option should not be used for production environments. diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index caa65adf8..a7d52946b 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -85,6 +85,10 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then echo "WARNING: $PWD/config/config.inc.php already exists." echo "ROUNDCUBEMAIL_* environment variables have been ignored." fi + + if [ ! -z "${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" ]; then + sed -i -E "s/(upload_max_filesize|post_max_size) +[0-9BKMG]+/\1 ${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}/g" $PWD/.htaccess + fi fi exec "$@"