diff --git a/recipes/discourse/crud.sh b/recipes/discourse/crud.sh index 762714b..00e2274 100755 --- a/recipes/discourse/crud.sh +++ b/recipes/discourse/crud.sh @@ -18,9 +18,12 @@ function _create() { echo "initialize discourse $shortname $longname ... OK" mkdir -p "$MIAOU_CONFIGDIR/apps/discourse" - APP_DOMAIN=$domain APP_SUBDOMAIN=$subdomain APP_FQDN=$fqdn APP_PORT=$port APP_NAME=$shortname tera -e --env-key env -t "$MIAOU_BASEDIR/templates/apps/discourse/forum.yml.j2" -o "$MIAOU_CONFIGDIR/apps/discourse/$longname.yml" "$MIAOU_CONFIGDIR/miaou.expanded.yaml" + APP_DOMAIN=$domain APP_SUBDOMAIN=$subdomain APP_FQDN=$fqdn APP_PORT=$port APP_NAME=$longname tera -e --env-key env -t "$MIAOU_BASEDIR/templates/apps/discourse/forum.yml.j2" -o "$MIAOU_CONFIGDIR/apps/discourse/$longname.yml" "$MIAOU_CONFIGDIR/miaou.expanded.yaml" echo "creating templates ... OK" + #TODO: + 1. copy template to container + 1. rebuild container } function _update() { diff --git a/templates/apps/discourse/forum.yml.j2 b/templates/apps/discourse/forum.yml.j2 index 6ffe632..68794de 100644 --- a/templates/apps/discourse/forum.yml.j2 +++ b/templates/apps/discourse/forum.yml.j2 @@ -1,4 +1,4 @@ -# TODO: change SOME_SECRET in this template +--- templates: - "templates/web.template.yml" @@ -10,7 +10,7 @@ expose: params: ## Which Git revision should this container use? (default: tests-passed) #version: tests-passed - version: latest-release + version: latest-release #FIXME: does it work? env: DISCOURSE_HOSTNAME: '{{ env.APP_FQDN }}' @@ -24,26 +24,17 @@ env: ## hostname (-h option) as specified above (default "$hostname-$config") DOCKER_USE_HOSTNAME: true - ## TODO: List of comma delimited emails that will be made admin and developer - ## on initial signup example 'user1@example.com,user2@example.com' - DISCOURSE_DEVELOPER_EMAILS: 'pvincent@artcode.re' + DISCOURSE_SMTP_ADDRESS: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.smtp.server }} + DISCOURSE_SMTP_PORT: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.smtp.port }} + DISCOURSE_SMTP_USER_NAME: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.smtp.username }} + DISCOURSE_SMTP_PASSWORD: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.smtp.password }} - ## TODO: The SMTP mail server used to validate new accounts and send notifications - # SMTP ADDRESS, username, and password are required - # WARNING the char '#' in SMTP password can cause problems! - DISCOURSE_SMTP_ADDRESS: mail1.zourit.net - DISCOURSE_SMTP_PORT: 587 - DISCOURSE_SMTP_USER_NAME: postmaster@artcode.re - DISCOURSE_SMTP_PASSWORD: bHv5mTYyh3aJJKw - #DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true) - #DISCOURSE_SMTP_DOMAIN: discourse.example.com # (required by some providers) - #DISCOURSE_NOTIFICATION_EMAIL: noreply@discourse.example.com # (address to send notifications from) - - - ## TODO: configure connectivity to the databases - DISCOURSE_DB_NAME: libre.re - DISCOURSE_DB_USERNAME: libre.re - DISCOURSE_DB_PASSWORD: libre.re + DISCOURSE_DEVELOPER_EMAILS: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.admin }} + DISCOURSE_NOTIFICATION_EMAIL: noreply@{{ env.APP_DOMAIN }} + + DISCOURSE_DB_NAME: {{ env.APP_NAME }} + DISCOURSE_DB_USERNAME: {{ env.APP_NAME }} + DISCOURSE_DB_PASSWORD: {{ env.APP_NAME }} DISCOURSE_DB_HOST: ct1.lxd DISCOURSE_REDIS_HOST: ct1.lxd