Always create and chown ROUNDCUBEMAIL_TEMP_DIR
authorDirk Weise <redacted>
Fri, 12 Apr 2019 18:14:10 +0000 (20:14 +0200)
committerGitHub <redacted>
Fri, 12 Apr 2019 18:14:10 +0000 (20:14 +0200)
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.

php-apache/docker-entrypoint.sh

index 59ef659ecba8dd5be21ce9398afef3d53e244340..35fd40bf9cf389ff6f43fabd12059e85179ec098 100755 (executable)
@@ -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
git clone https://git.99rst.org/PROJECT