From b6b51255c39c4879692d5fa64d3e44785c30c81e Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:55:17 +0200 Subject: [PATCH] Update SMTP configuration in .env.example and entrypoint script for Docker --- .env.example | 5 ++++- ckan/docker-entrypoint.d/01_setup_ckanext_config.sh | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index b7542310..67f4f5eb 100644 --- a/.env.example +++ b/.env.example @@ -125,12 +125,15 @@ CKAN_SYSADMIN_EMAIL=your_email@example.com CKAN_STORAGE_PATH=/var/lib/ckan CKAN_LOGS_PATH=/var/log # SMTP settings -CKAN__SMTP_ENABLED=False +CKAN_DOCKER_SMTP_ENABLED=False CKAN_SMTP_SERVER=smtp.corporateict.domain:25 CKAN_SMTP_STARTTLS=True CKAN_SMTP_USER=user CKAN_SMTP_PASSWORD=pass CKAN_SMTP_MAIL_FROM=ckan@${PROXY_SERVER_NAME} +CKAN_SMTP_REPLY_TO='' +CKAN_EMAIL_TO='' +CKAN_ERROR_EMAIL_FROM='' ## Customize which text formats the text_view plugin will show CKAN__PREVIEW__JSON_FORMATS="json jsonld" # html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json diff --git a/ckan/docker-entrypoint.d/01_setup_ckanext_config.sh b/ckan/docker-entrypoint.d/01_setup_ckanext_config.sh index 5e5bbd20..322bd224 100644 --- a/ckan/docker-entrypoint.d/01_setup_ckanext_config.sh +++ b/ckan/docker-entrypoint.d/01_setup_ckanext_config.sh @@ -4,8 +4,8 @@ echo "[docker-entrypoint.01_setup_ckanext_config] Clear index" ckan -c $CKAN_INI search-index clear -# Add SMTP settings if CKAN__SMTP_ENABLED is True -if [ "$CKAN__SMTP_ENABLED" = "True" ]; then +# Add SMTP settings if CKAN_DOCKER_SMTP_ENABLED is True +if [ "$CKAN_DOCKER_SMTP_ENABLED" = "True" ]; then echo "[docker-entrypoint.01_setup_ckanext_config] Adding SMTP settings to the CKAN config file" ckan config-tool $CKAN_INI \ "smtp.server=$CKAN_SMTP_SERVER" \ @@ -13,9 +13,9 @@ if [ "$CKAN__SMTP_ENABLED" = "True" ]; then "smtp.user=$CKAN_SMTP_USER" \ "smtp.password=$CKAN_SMTP_PASSWORD" \ "smtp.mail_from=$CKAN_SMTP_MAIL_FROM" \ - "smtp.reply_to=" \ - "email_to=" \ - "error_email_from=" + "smtp.reply_to=$CKAN_SMTP_REPLY_TO" \ + "email_to=$CKAN_EMAIL_TO" \ + "error_email_from=$CKAN_ERROR_EMAIL_FROM" fi # Rebuild index