Spotter-VM/lxc-apps/ckan/install/update-conf.sh

18 lines
548 B
Bash
Raw Normal View History

2019-09-18 11:29:58 +02:00
#!/bin/sh
# Volumes
DATAPUSHER_CONF="${VOLUMES_DIR}/ckan/datapusher_conf"
CKAN_CONF="${VOLUMES_DIR}/ckan/ckan_conf"
2019-09-18 11:29:58 +02:00
# Variables
HOST="${HOST}.${DOMAIN}"
[ "${PORT}" != "443" ] && HOST="${HOST}:${PORT}"
2019-09-18 11:29:58 +02:00
# Replacements
sed -i "s|\(^ckan\.site_url = \).*|\1https://${HOST}|" ${CKAN_CONF}/ckan.ini
sed -i "s|\(^smtp\.mail_from = \).*|\1${EMAIL}|" ${CKAN_CONF}/ckan.ini
sed -i "s|\(^ckanext\.geoview\.gapi_key = \).*|\1${GMAPS_API_KEY}|" ${CKAN_CONF}/ckan.ini
sed -i "s|\(^FROM_EMAIL = \).*|\1'${EMAIL}'|" ${DATAPUSHER_CONF}/datapusher_settings.py