From 70342df9546e5650367ea2ec528a5d47984727ad Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Fri, 8 Nov 2024 10:02:59 +0100 Subject: [PATCH 1/3] Don't remove gnupg from alpine image It's required to run enigma and doesn't hurt in general. --- templates/Dockerfile-alpine.templ | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/templates/Dockerfile-alpine.templ b/templates/Dockerfile-alpine.templ index bb207d111..751b6e515 100644 --- a/templates/Dockerfile-alpine.templ +++ b/templates/Dockerfile-alpine.templ @@ -87,10 +87,7 @@ ENV ROUNDCUBEMAIL_KEYID "F3E4 C04B B3DB 5D42 15C4 5F7F 5AB2 BAA1 41C4 F7D5" # Download package and extract to web volume RUN set -ex; \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ - \ + apk add --no-cache gnupg; curl -o roundcubemail.tar.gz -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \ curl -o roundcubemail.tar.gz.asc -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \ export GNUPGHOME="$(mktemp -d)"; \ @@ -106,7 +103,6 @@ RUN set -ex; \ rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc roundcubemail.tar.gz; \ rm -rf /usr/src/roundcubemail/installer; \ chown -R www-data:www-data /usr/src/roundcubemail/logs; \ - apk del .fetch-deps; \ # Create the config dir mkdir -p /var/roundcube/config From 4493e478b231092816572efa9b0468010b7ea48f Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Wed, 20 Nov 2024 15:17:02 +0100 Subject: [PATCH 2/3] Provide enigma working dir (if enabled) --- templates/Dockerfile-alpine.templ | 2 +- templates/Dockerfile-debian.templ | 2 +- templates/docker-entrypoint.sh | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/Dockerfile-alpine.templ b/templates/Dockerfile-alpine.templ index 751b6e515..6e9a9230a 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 62c3eba37..09a67790c 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 a797d861b..176173aec 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 From 82b6b0f7fcbb59939118a9b1ae1c982e46fa1e1f Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Wed, 20 Nov 2024 15:17:23 +0100 Subject: [PATCH 3/3] Mention enigma storage path in README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 38c048be6..057ef673d 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,9 @@ or to inject additional data into the container: * `/var/roundcube/db`: storage location of the SQLite database Only needed if using `ROUNDCUBEMAIL_DB_TYPE=sqlite` to persist the Roundcube database. +* `/var/roundcube/enigma`: storage location of the enigma plugin + If enabled, the "enigma" plugin stores OpenPGP keys here. + * `/tmp/roundcube-temp`: Roundcube's temp folder Temp files like uploaded attachments or thumbnail images are stored here. Share this directory via a volume when running multiple replicas of the roundcube container.