From f670147c602fbbe6d499bb3c4cf65327ecb45593 Mon Sep 17 00:00:00 2001 From: Ernesto Date: Tue, 22 Oct 2024 11:14:20 +0000 Subject: [PATCH 1/3] fixed smtp on .env.example, added SMTP test server on dev --- .env.example | 20 +++++++++++--------- docker-compose.dev.yml | 9 ++++++++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index 67f4f5eb..94b3631f 100644 --- a/.env.example +++ b/.env.example @@ -125,15 +125,17 @@ CKAN_SYSADMIN_EMAIL=your_email@example.com CKAN_STORAGE_PATH=/var/lib/ckan CKAN_LOGS_PATH=/var/log # SMTP settings -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='' +CKAN___ACTIVITY_STREAMS_EMAIL_NOTIFICATION=True +CKAN___SMTP__ENABLED=True +CKAN___SMTP__SERVER=mailserver:25 +CKAN___SMTP__STARTTLS=False +CKAN___SMTP__USER=user +CKAN___SMTP__PASSWORD=password +CKAN___SMTP__MAIL_FROM=ckan@${PROXY_SERVER_NAME} +CKAN___SMTP__REPLY_TO=ckan@${PROXY_SERVER_NAME} +CKAN___EMAIL_TO=ckan@${PROXY_SERVER_NAME} +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/docker-compose.dev.yml b/docker-compose.dev.yml index f7bcba6b..d36fb40a 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -134,4 +134,11 @@ services: max-file: "10" restart: unless-stopped healthcheck: - test: ["CMD", "redis-cli", "-e", "QUIT"] \ No newline at end of file + test: ["CMD", "redis-cli", "-e", "QUIT"] + + #mailserver: + # image: rnwood/smtp4dev + # ports: + # - "1080:80" + # restart: unless-stopped + \ No newline at end of file From d6dbff76e10315487c0027aa4b228ff5d8f34e8c Mon Sep 17 00:00:00 2001 From: Ernesto Date: Tue, 22 Oct 2024 15:23:13 +0000 Subject: [PATCH 2/3] fixed variable name in .env.example --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 94b3631f..4a04e3af 100644 --- a/.env.example +++ b/.env.example @@ -125,7 +125,7 @@ CKAN_SYSADMIN_EMAIL=your_email@example.com CKAN_STORAGE_PATH=/var/lib/ckan CKAN_LOGS_PATH=/var/log # SMTP settings -CKAN___ACTIVITY_STREAMS_EMAIL_NOTIFICATION=True +CKAN__ACTIVITY_STREAMS_EMAIL_NOTIFICATIONS=True CKAN___SMTP__ENABLED=True CKAN___SMTP__SERVER=mailserver:25 CKAN___SMTP__STARTTLS=False From 55095c4455085c7afbc48830f336341192a28a97 Mon Sep 17 00:00:00 2001 From: Ernesto Date: Tue, 22 Oct 2024 15:24:36 +0000 Subject: [PATCH 3/3] removed unnecesary code from ckan setup script --- .../docker-entrypoint.d/01_setup_ckanext_config.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/ckan/docker-entrypoint.d/01_setup_ckanext_config.sh b/ckan/docker-entrypoint.d/01_setup_ckanext_config.sh index 322bd224..afe8be78 100644 --- a/ckan/docker-entrypoint.d/01_setup_ckanext_config.sh +++ b/ckan/docker-entrypoint.d/01_setup_ckanext_config.sh @@ -4,20 +4,6 @@ echo "[docker-entrypoint.01_setup_ckanext_config] Clear index" ckan -c $CKAN_INI search-index clear -# 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" \ - "smtp.starttls=$CKAN_SMTP_STARTTLS" \ - "smtp.user=$CKAN_SMTP_USER" \ - "smtp.password=$CKAN_SMTP_PASSWORD" \ - "smtp.mail_from=$CKAN_SMTP_MAIL_FROM" \ - "smtp.reply_to=$CKAN_SMTP_REPLY_TO" \ - "email_to=$CKAN_EMAIL_TO" \ - "error_email_from=$CKAN_ERROR_EMAIL_FROM" -fi - # Rebuild index echo "[docker-entrypoint.01_setup_ckanext_config] Rebuild index" ckan -c $CKAN_INI search-index rebuild \ No newline at end of file