Skip to content

Commit

Permalink
Add oauth secret handling to template. Generate examples from template
Browse files Browse the repository at this point in the history
  • Loading branch information
Indriði Einarsson committed Apr 22, 2024
1 parent a5951fe commit 9397018
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 7 additions & 0 deletions fpm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion templates/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 9397018

Please sign in to comment.