roundcube-docker/src/scripts/write-config.sh
Torben Nehmer d3ed55ffb6 Initial version of the new Docker Build scripts
Successfully builds the container, places the files, scripts and links
we need so fart into the right places using a rootfs tar file so that we
don't pollute the container unneccessarily and keep the Dockerfile
simple.

Any in-container scripting is missing so far, so the whole thing does
not yet start up successfully or popluate the config share in any way.
That is for another day.
2018-10-24 22:45:58 +02:00

28 lines
896 B
Bash
Executable File

#!/bin/bash
# set -ex
CONFIG=/var/roundcube/config/config.inc.php
ROUNDCUBEMAIL_PLUGINS_PHP=`echo "${ROUNDCUBEMAIL_PLUGINS}" | sed -E "s/[, ]+/', '/g"`
mkdir -p ${ROUNDCUBEMAIL_TEMP_DIR} && chown www-data ${ROUNDCUBEMAIL_TEMP_DIR}
touch $CONFIG
echo "Write config to $PWD/config/config.inc.php"
echo "<?php
\$config['db_dsnw'] = '${ROUNDCUBEMAIL_DSNW}';
\$config['db_dsnr'] = '${ROUNDCUBEMAIL_DSNR}';
\$config['default_host'] = '${ROUNDCUBEMAIL_DEFAULT_HOST}';
\$config['default_port'] = '${ROUNDCUBEMAIL_DEFAULT_PORT}';
\$config['smtp_server'] = '${ROUNDCUBEMAIL_SMTP_SERVER}';
\$config['smtp_port'] = '${ROUNDCUBEMAIL_SMTP_PORT}';
\$config['smtp_user'] = '%u';
\$config['smtp_pass'] = '%p';
\$config['temp_dir'] = '${ROUNDCUBEMAIL_TEMP_DIR}';
\$config['plugins'] = ['${ROUNDCUBEMAIL_PLUGINS_PHP}'];
\$config['zipdownload_selection'] = true;
\$config['log_driver'] = 'stdout';
" > $CONFIG