From e03ad97382cc2450c46a5c67adf8d355ed98729c Mon Sep 17 00:00:00 2001 From: Liquidsoul Date: Mon, 15 Apr 2019 17:49:09 +0200 Subject: [PATCH] Add development SMTP server --- docker-compose.yml | 10 +++++++++- docker/stretch/entrypoint.sh | 1 + tpl/admin/config.tpl | 3 +-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f13a4b3..b1f6d0d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,11 @@ version: '3' services: + smtp: + container_name: framadate-smtp + image: jeanberu/mailcatcher + ports: + - "1080:1080" + db: container_name: framadate-db image: mysql:5.7 @@ -19,6 +25,7 @@ services: context: . depends_on: - db + - smtp ports: - 80:80 environment: @@ -32,8 +39,9 @@ services: - MYSQL_PORT=3307 - ADMIN_USER=admin - ADMIN_PASSWORD=adminpassword - - DISABLE_SMTP=true - APACHE_RUN_USER=#1000 + - FRAMADATE_DEVMODE=1 + - SMTP_SERVER=smtp:1025 restart: always volumes: - '.:/var/www/framadate' diff --git a/docker/stretch/entrypoint.sh b/docker/stretch/entrypoint.sh index 37b382b..cdab8aa 100755 --- a/docker/stretch/entrypoint.sh +++ b/docker/stretch/entrypoint.sh @@ -38,6 +38,7 @@ if [ ! -f $FRAMADATE_CONFIG ]; then if [ "$DISABLE_SMTP" = "true" ]; then sed -i -E "s/'use_smtp' => true,/'use_smtp' => false,/g" $FRAMADATE_CONFIG fi + sed -i -E "s/SMTP_SERVER/${SMTP_SERVER:-localhost}/g" $FRAMADATE_CONFIG # Framadate internal config sed -i -E "s/^(\/\/ )?const TABLENAME_PREFIX( )?=.*;/const TABLENAME_PREFIX = 'fd_';/g" $FRAMADATE_CONFIG sed -i -E "s/^(\/\/ )?const MIGRATION_TABLE( )?=.*;/const MIGRATION_TABLE = 'framadate_migration';/g" $FRAMADATE_CONFIG diff --git a/tpl/admin/config.tpl b/tpl/admin/config.tpl index af88622..2bba9d9 100644 --- a/tpl/admin/config.tpl +++ b/tpl/admin/config.tpl @@ -107,7 +107,7 @@ $config = [ 'use_smtp' => true, // use email for polls creation/modification/responses notification (uses smtp only if `use_sendmail` is disabled) 'use_sendmail' => false, // use sendmail instead of smtp 'smtp_options' => [ - 'host' => 'localhost', // SMTP server (you could add many servers (main and backup for example) : use ";" like separator + 'host' => 'SMTP_SERVER', // SMTP server (you could add many servers (main and backup for example) : use ";" like separator 'auth' => false, // Enable SMTP authentication 'username' => '', // SMTP username 'password' => '', // SMTP password @@ -125,4 +125,3 @@ $config = [ 'markdown_editor_by_default' => true, // The markdown editor for the description is enabled by default 'provide_fork_awesome' => true, // Whether the build-in fork-awesome should be provided ]; -