From 95c716f678f5dd18d74db790b0a3720652d66913 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 13 Jul 2016 17:27:37 +0200 Subject: [PATCH] add db seed --- rootfs/etc/confd/templates/config.inc.php.tmpl | 2 +- rootfs/etc/cont-init.d/00-roundcube | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rootfs/etc/confd/templates/config.inc.php.tmpl b/rootfs/etc/confd/templates/config.inc.php.tmpl index e2021d2..fbf2c88 100644 --- a/rootfs/etc/confd/templates/config.inc.php.tmpl +++ b/rootfs/etc/confd/templates/config.inc.php.tmpl @@ -2,7 +2,7 @@ $config = array(); -$config['db_dsnw'] = '{{getenv "DATABASEDSN"}}'; +$config['db_dsnw'] = 'pgsql://{{getenv "DBUSER"}}:{{getenv "DBPASSWORD"}}@{{getenv "DBHOST"}}/DBNAME'; $config['log_driver'] = 'syslog'; $config['default_host'] = '{{getenv "IMAPHOST"}}'; diff --git a/rootfs/etc/cont-init.d/00-roundcube b/rootfs/etc/cont-init.d/00-roundcube index 4434b7d..1034522 100644 --- a/rootfs/etc/cont-init.d/00-roundcube +++ b/rootfs/etc/cont-init.d/00-roundcube @@ -1,8 +1,8 @@ #!/usr/bin/with-contenv sh -#PGPASSWORD=$DBPASSWORD psql -h $DBHOST -U $DBUSER -d $DBNAME -c "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'nc_appconfig')" | grep f +PGPASSWORD=$DBPASSWORD psql -h $DBHOST -U $DBUSER -d $DBNAME -c "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'session')" | grep f if [ $? -ne 1 ]; then - + PGPASSWORD=$DBPASSWORD psql -h $DBHOST -U $DBUSER -d $DBNAME -f /var/lib/roundcube/SQL/postgres.initial.sql fi