From 939701874007b922b80fdec87626e99232dea466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Indri=C3=B0i=20Einarsson?= Date: Mon, 22 Apr 2024 22:54:52 +0000 Subject: [PATCH] Add oauth secret handling to template. Generate examples from template --- fpm/docker-entrypoint.sh | 7 +++++++ templates/docker-entrypoint.sh | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh index 8503934b5..03ba220cb 100755 --- a/fpm/docker-entrypoint.sh +++ b/fpm/docker-entrypoint.sh @@ -27,6 +27,9 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then if [ -f /run/secrets/roundcube_db_password ]; then ROUNDCUBEMAIL_DB_PASSWORD=`cat /run/secrets/roundcube_db_password` fi + if [ -f /run/secrets/roundcube_oauth_client_secret ]; then + ROUNDCUBEMAIL_OAUTH_CLIENT_SECRET=`cat /run/secrets/roundcube_oauth_client_secret` + fi if [ ! -z "${!POSTGRES_ENV_POSTGRES_*}" ] || [ "$ROUNDCUBEMAIL_DB_TYPE" == "pgsql" ]; then : "${ROUNDCUBEMAIL_DB_TYPE:=pgsql}" @@ -110,6 +113,10 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then echo "\$config['des_key'] = getenv('ROUNDCUBEMAIL_DES_KEY');" >> config/config.docker.inc.php fi + if [ ! -z "${ROUNDCUBEMAIL_OAUTH_CLIENT_SECRET}" ]; then + echo "\$config['oauth_client_secret'] = '${ROUNDCUBEMAIL_OAUTH_CLIENT_SECRET}';" >> config/config.docker.inc.php + fi + if [ ! -z "${ROUNDCUBEMAIL_SPELLCHECK_URI}"]; then echo "\$config['spellcheck_engine'] = 'googie';" >> config/config.docker.inc.php echo "\$config['spellcheck_uri'] = '${ROUNDCUBEMAIL_SPELLCHECK_URI}';" >> config/config.docker.inc.php diff --git a/templates/docker-entrypoint.sh b/templates/docker-entrypoint.sh index 9485dede5..03ba220cb 100644 --- a/templates/docker-entrypoint.sh +++ b/templates/docker-entrypoint.sh @@ -31,7 +31,6 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then ROUNDCUBEMAIL_OAUTH_CLIENT_SECRET=`cat /run/secrets/roundcube_oauth_client_secret` fi - if [ ! -z "${!POSTGRES_ENV_POSTGRES_*}" ] || [ "$ROUNDCUBEMAIL_DB_TYPE" == "pgsql" ]; then : "${ROUNDCUBEMAIL_DB_TYPE:=pgsql}" : "${ROUNDCUBEMAIL_DB_HOST:=postgres}"