From: Dirk Weise Date: Fri, 12 Apr 2019 18:14:10 +0000 (+0200) Subject: Always create and chown ROUNDCUBEMAIL_TEMP_DIR X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=8c85cbb47cb0f2003f35f82d3d8e954cebe4e7a7;p=roundcube-roundcubemail-docker.git Always create and chown ROUNDCUBEMAIL_TEMP_DIR Create and chown `ROUNDCUBEMAIL_TEMP_DIR` although `config.inc.php` exists. Reasoning: 1. A new container with `config.inc.php` will not have the default temp folder what will lead to errors even when `$config['temp_dir']` is left at its default value. If the `config.inc.php` specifies a custom one, the admin should now what he is doing and can set `ROUNDCUBEMAIL_TEMP_DIR` accordingly. 2. In a multi server setup a bind mount to `/tmp/roundcube-temp` will get the correct permissions set which will often be `root:root` with `0755` initially. --- diff --git a/php-apache/docker-entrypoint.sh b/php-apache/docker-entrypoint.sh index 59ef659..35fd40b 100755 --- a/php-apache/docker-entrypoint.sh +++ b/php-apache/docker-entrypoint.sh @@ -56,7 +56,6 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then if [ ! -e config/config.inc.php ]; then ROUNDCUBEMAIL_PLUGINS_PHP=`echo "${ROUNDCUBEMAIL_PLUGINS}" | sed -E "s/[, ]+/', '/g"` - mkdir -p ${ROUNDCUBEMAIL_TEMP_DIR} && chown www-data ${ROUNDCUBEMAIL_TEMP_DIR} touch config/config.inc.php echo "Write config to $PWD/config/config.inc.php" @@ -86,6 +85,10 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then echo "ROUNDCUBEMAIL_* environment variables have been ignored." fi + if [ ! -z "${ROUNDCUBEMAIL_TEMP_DIR}" ]; then + mkdir -p ${ROUNDCUBEMAIL_TEMP_DIR} && chown www-data ${ROUNDCUBEMAIL_TEMP_DIR} + fi + if [ ! -z "${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" ]; then echo "upload_max_filesize=${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" >> /usr/local/etc/php/conf.d/roundcube-override.ini echo "post_max_size=${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE}" >> /usr/local/etc/php/conf.d/roundcube-override.ini