From 8519970a3d2fa399a255aa28c5ab67ca59f30c45 Mon Sep 17 00:00:00 2001 From: Bjalbor Date: Mon, 9 Dec 2024 12:30:41 +0100 Subject: [PATCH] Install missing skin via composer on system initialization (#254) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Björn Bores --- apache/docker-entrypoint.sh | 15 +++++++++++++++ fpm-alpine/docker-entrypoint.sh | 15 +++++++++++++++ fpm/docker-entrypoint.sh | 15 +++++++++++++++ templates/docker-entrypoint.sh | 15 +++++++++++++++ tests/docker-compose.test-apache-postgres.yml | 1 + tests/docker-compose.test-fpm-postgres.yml | 1 + 6 files changed, 62 insertions(+) diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh index 64d96b2b6..e493b51f3 100755 --- a/apache/docker-entrypoint.sh +++ b/apache/docker-entrypoint.sh @@ -102,6 +102,21 @@ if [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then ${ROUNDCUBEMAIL_COMPOSER_PLUGINS_SH}; fi + if [ ! -d skins/${ROUNDCUBEMAIL_SKIN} ]; then + # Installing missing skin + echo "Installing missing skin: ${ROUNDCUBEMAIL_SKIN}" + composer \ + --working-dir=${INSTALLDIR} \ + --prefer-dist \ + --prefer-stable \ + --update-no-dev \ + --no-interaction \ + --optimize-autoloader \ + require \ + -- \ + roundcube/${ROUNDCUBEMAIL_SKIN}; + fi + if [ ! -e config/config.inc.php ]; then GENERATED_DES_KEY=`head /dev/urandom | base64 | head -c 24` touch config/config.inc.php diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh index 64d96b2b6..e493b51f3 100755 --- a/fpm-alpine/docker-entrypoint.sh +++ b/fpm-alpine/docker-entrypoint.sh @@ -102,6 +102,21 @@ if [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then ${ROUNDCUBEMAIL_COMPOSER_PLUGINS_SH}; fi + if [ ! -d skins/${ROUNDCUBEMAIL_SKIN} ]; then + # Installing missing skin + echo "Installing missing skin: ${ROUNDCUBEMAIL_SKIN}" + composer \ + --working-dir=${INSTALLDIR} \ + --prefer-dist \ + --prefer-stable \ + --update-no-dev \ + --no-interaction \ + --optimize-autoloader \ + require \ + -- \ + roundcube/${ROUNDCUBEMAIL_SKIN}; + fi + if [ ! -e config/config.inc.php ]; then GENERATED_DES_KEY=`head /dev/urandom | base64 | head -c 24` touch config/config.inc.php diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh index 64d96b2b6..e493b51f3 100755 --- a/fpm/docker-entrypoint.sh +++ b/fpm/docker-entrypoint.sh @@ -102,6 +102,21 @@ if [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then ${ROUNDCUBEMAIL_COMPOSER_PLUGINS_SH}; fi + if [ ! -d skins/${ROUNDCUBEMAIL_SKIN} ]; then + # Installing missing skin + echo "Installing missing skin: ${ROUNDCUBEMAIL_SKIN}" + composer \ + --working-dir=${INSTALLDIR} \ + --prefer-dist \ + --prefer-stable \ + --update-no-dev \ + --no-interaction \ + --optimize-autoloader \ + require \ + -- \ + roundcube/${ROUNDCUBEMAIL_SKIN}; + fi + if [ ! -e config/config.inc.php ]; then GENERATED_DES_KEY=`head /dev/urandom | base64 | head -c 24` touch config/config.inc.php diff --git a/templates/docker-entrypoint.sh b/templates/docker-entrypoint.sh index 64d96b2b6..e493b51f3 100644 --- a/templates/docker-entrypoint.sh +++ b/templates/docker-entrypoint.sh @@ -102,6 +102,21 @@ if [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then ${ROUNDCUBEMAIL_COMPOSER_PLUGINS_SH}; fi + if [ ! -d skins/${ROUNDCUBEMAIL_SKIN} ]; then + # Installing missing skin + echo "Installing missing skin: ${ROUNDCUBEMAIL_SKIN}" + composer \ + --working-dir=${INSTALLDIR} \ + --prefer-dist \ + --prefer-stable \ + --update-no-dev \ + --no-interaction \ + --optimize-autoloader \ + require \ + -- \ + roundcube/${ROUNDCUBEMAIL_SKIN}; + fi + if [ ! -e config/config.inc.php ]; then GENERATED_DES_KEY=`head /dev/urandom | base64 | head -c 24` touch config/config.inc.php diff --git a/tests/docker-compose.test-apache-postgres.yml b/tests/docker-compose.test-apache-postgres.yml index 4612b25a0..578d931ea 100644 --- a/tests/docker-compose.test-apache-postgres.yml +++ b/tests/docker-compose.test-apache-postgres.yml @@ -23,6 +23,7 @@ services: - ROUNDCUBEMAIL_DB_NAME=roundcube # same as pgsql POSTGRES_DB env name - ROUNDCUBEMAIL_DB_USER=roundcube # same as pgsql POSTGRES_USER env name - ROUNDCUBEMAIL_DB_PASSWORD=roundcube # same as pgsql POSTGRES_PASSWORD env name + - ROUNDCUBEMAIL_SKIN=larry # Install non-default skin roundcubedb: image: postgres:alpine diff --git a/tests/docker-compose.test-fpm-postgres.yml b/tests/docker-compose.test-fpm-postgres.yml index 1e616c4a2..b2a8cf61d 100644 --- a/tests/docker-compose.test-fpm-postgres.yml +++ b/tests/docker-compose.test-fpm-postgres.yml @@ -28,6 +28,7 @@ services: - ROUNDCUBEMAIL_DB_USER=roundcube # same as pgsql POSTGRES_USER env name - ROUNDCUBEMAIL_DB_PASSWORD=roundcube # same as pgsql POSTGRES_PASSWORD env name - ROUNDCUBEMAIL_PLUGINS=enigma + - ROUNDCUBEMAIL_SKIN=larry # Install non-default skin roundcubedb: image: postgres:alpine