Skip to content

Commit

Permalink
Update SMTP configuration in .env.example and entrypoint script for D…
Browse files Browse the repository at this point in the history
…ocker
  • Loading branch information
mjanez committed Oct 11, 2024
1 parent 3af2930 commit b6b5125
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,15 @@ [email protected]
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
Expand Down
10 changes: 5 additions & 5 deletions ckan/docker-entrypoint.d/01_setup_ckanext_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
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" \
"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=" \
"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
Expand Down

0 comments on commit b6b5125

Please sign in to comment.