Provide enigma working dir (if enabled)
authorPablo Zmdl <redacted>
Wed, 20 Nov 2024 14:17:02 +0000 (15:17 +0100)
committerPablo Zmdl <redacted>
Wed, 20 Nov 2024 14:17:16 +0000 (15:17 +0100)
templates/Dockerfile-alpine.templ
templates/Dockerfile-debian.templ
templates/docker-entrypoint.sh

index 751b6e5156c55ccb932171f50ff188b3cccc7c86..6e9a9230ab1997f26ebb42fcf4be8a6744592c51 100644 (file)
@@ -104,7 +104,7 @@ RUN set -ex; \
        rm -rf /usr/src/roundcubemail/installer; \
        chown -R www-data:www-data /usr/src/roundcubemail/logs; \
 # Create the config dir
-       mkdir -p /var/roundcube/config
+       mkdir -p /var/roundcube/config /var/roundcube/enigma
 
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["%%CMD%%"]
index 62c3eba3727db954a2be17c82da8477197e22bc8..09a67790c868158fab563083852010fdf9957eed 100644 (file)
@@ -110,7 +110,7 @@ RUN set -ex; \
        rm -rf /usr/src/roundcubemail/installer; \
        chown -R www-data:www-data /usr/src/roundcubemail/logs; \
 # Create the config dir
-       mkdir -p /var/roundcube/config
+       mkdir -p /var/roundcube/config /var/roundcube/enigma
 
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["%%CMD%%"]
index a797d861baeaf07cd002979f29e369f0bab170ab..176173aecd439427602cc4c6550eace21c735305 100644 (file)
@@ -150,6 +150,11 @@ if  [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then
     echo "\$config['spellcheck_uri'] = '${ROUNDCUBEMAIL_SPELLCHECK_URI}';" >> config/config.docker.inc.php
   fi
 
+  # If the "enigma" plugin is enabled but has no storage configured, inject a default value for the mandatory setting.
+  if $(echo $ROUNDCUBEMAIL_PLUGINS | grep -Eq '\benigma\b') && ! grep -qr enigma_pgp_homedir /var/roundcube/config/; then
+    echo "$config['enigma_pgp_homedir'] = '/var/roundcube/enigma';" >> config/config.docker.inc.php
+  fi
+
   # include custom config files
   for fn in `ls /var/roundcube/config/*.php 2>/dev/null || true`; do
     echo "include('$fn');" >> config/config.docker.inc.php
git clone https://git.99rst.org/PROJECT