From: Pablo Zmdl Date: Wed, 20 Nov 2024 14:17:02 +0000 (+0100) Subject: Provide enigma working dir (if enabled) X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=4493e478b231092816572efa9b0468010b7ea48f;p=roundcube-roundcubemail-docker.git Provide enigma working dir (if enabled) --- diff --git a/templates/Dockerfile-alpine.templ b/templates/Dockerfile-alpine.templ index 751b6e5..6e9a923 100644 --- a/templates/Dockerfile-alpine.templ +++ b/templates/Dockerfile-alpine.templ @@ -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%%"] diff --git a/templates/Dockerfile-debian.templ b/templates/Dockerfile-debian.templ index 62c3eba..09a6779 100644 --- a/templates/Dockerfile-debian.templ +++ b/templates/Dockerfile-debian.templ @@ -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%%"] diff --git a/templates/docker-entrypoint.sh b/templates/docker-entrypoint.sh index a797d86..176173a 100644 --- a/templates/docker-entrypoint.sh +++ b/templates/docker-entrypoint.sh @@ -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