From a12b0f101e6db3787e3925feb4ee9bcba9ec5c08 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 10 Apr 2020 13:03:34 +0200 Subject: [PATCH] Update update-conf.sh, revert custom prop definitions Partially reverts 0028a3ba5b1e20276a56024d1ba3ff60af6059c1 --- apk/vmmgr | 2 +- lxc-apps/ckan/install.sh | 2 -- lxc-apps/ckan/install/update-conf.sh | 19 +++++++++++----- lxc-apps/crisiscleanup/install.sh | 2 -- lxc-apps/crisiscleanup/install/update-conf.sh | 8 +++++-- lxc-apps/cts/install.sh | 1 - lxc-apps/cts/install/update-conf.sh | 6 ++++- lxc-apps/gnuhealth/install.sh | 1 - lxc-apps/gnuhealth/install/update-conf.sh | 6 ++++- lxc-apps/kanboard/install.sh | 1 - lxc-apps/kanboard/install/update-conf.sh | 6 ++++- lxc-apps/mifosx/install.sh | 1 - lxc-apps/mifosx/install/update-conf.sh | 10 ++++++--- lxc-apps/motech/install/update-conf.sh | 12 +++++++--- lxc-apps/odoo/install.sh | 1 - lxc-apps/odoo/install/update-conf.sh | 6 ++++- lxc-apps/opendatakit/install/update-conf.sh | 10 ++++++--- lxc-apps/pandora/install.sh | 1 - lxc-apps/pandora/install/update-conf.sh | 13 +++++++---- lxc-apps/sahana-demo/install.sh | 2 -- lxc-apps/sahana-demo/install/update-conf.sh | 17 +++++++++----- lxc-apps/sahana/install.sh | 2 -- lxc-apps/sahana/install/update-conf.sh | 17 +++++++++----- lxc-apps/sambro/install.sh | 2 -- lxc-apps/sambro/install/update-conf.sh | 17 +++++++++----- lxc-apps/seeddms/install.sh | 1 - lxc-apps/seeddms/install/update-conf.sh | 6 ++++- lxc-apps/sigmah/install.sh | 2 -- lxc-apps/sigmah/install/update-conf.sh | 10 ++++++--- lxc-apps/ushahidi/install.sh | 2 -- lxc-apps/ushahidi/install/update-conf.sh | 22 ++++++++++++------- 31 files changed, 131 insertions(+), 77 deletions(-) diff --git a/apk/vmmgr b/apk/vmmgr index 2ae06a4..2d788eb 160000 --- a/apk/vmmgr +++ b/apk/vmmgr @@ -1 +1 @@ -Subproject commit 2ae06a4e4741b4c443b71dab59eba3abcec4ba2b +Subproject commit 2d788eb704982e0eef88ccb218417cc6ad9c442e diff --git a/lxc-apps/ckan/install.sh b/lxc-apps/ckan/install.sh index d30b0fe..5719589 100755 --- a/lxc-apps/ckan/install.sh +++ b/lxc-apps/ckan/install.sh @@ -80,5 +80,3 @@ spoc-container stop ckan-redis # Register application vmmgr register-app ckan ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}" -vmmgr register-prop ckan email "${CKAN_ADMIN_EMAIL}" -vmmgr register-prop ckan gmaps-api-key "" diff --git a/lxc-apps/ckan/install/update-conf.sh b/lxc-apps/ckan/install/update-conf.sh index 399f806..6fe97e8 100644 --- a/lxc-apps/ckan/install/update-conf.sh +++ b/lxc-apps/ckan/install/update-conf.sh @@ -1,10 +1,17 @@ #!/bin/sh -HOST="${DOMAIN}" -[ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}" -sed -i "s|\(^ckan\.site_url = \).*|\1https://ckan.${HOST}|" /srv/ckan/ckan_conf/ckan.ini +# Volumes +DATAPUSHER_CONF="${VOLUMES_DIR}/ckan/datapusher_conf" +CKAN_CONF="${VOLUMES_DIR}/ckan/ckan_conf" -sed -i "s|\(^smtp\.mail_from = \).*|\1${EMAIL}|" /srv/ckan/ckan_conf/ckan.ini -sed -i "s|\(^ckanext\.geoview\.gapi_key = \).*|\1${GMAPS_API_KEY}|" /srv/ckan/ckan_conf/ckan.ini +# Variables +HOST="${HOST}.${DOMAIN}" +[ "${PORT}" != "443" ] && HOST="${HOST}:${PORT}" -sed -i "s|\(^FROM_EMAIL = \).*|\1'${EMAIL}'|" /srv/ckan/datapusher_conf/datapusher_settings.py +# 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 diff --git a/lxc-apps/crisiscleanup/install.sh b/lxc-apps/crisiscleanup/install.sh index bdfad55..1b826fc 100755 --- a/lxc-apps/crisiscleanup/install.sh +++ b/lxc-apps/crisiscleanup/install.sh @@ -42,5 +42,3 @@ spoc-container stop crisiscleanup-postgres # Register application vmmgr register-app crisiscleanup cc "${CRISISCLEANUP_ADMIN_EMAIL}" "${CRISISCLEANUP_ADMIN_PWD}" -vmmgr register-prop crisiscleanup email "${CRISISCLEANUP_ADMIN_EMAIL}" -vmmgr register-prop crisiscleanup gmaps-api-key "" diff --git a/lxc-apps/crisiscleanup/install/update-conf.sh b/lxc-apps/crisiscleanup/install/update-conf.sh index 660c050..5c2f336 100644 --- a/lxc-apps/crisiscleanup/install/update-conf.sh +++ b/lxc-apps/crisiscleanup/install/update-conf.sh @@ -1,4 +1,8 @@ #!/bin/sh -sed -i "s|\(^ config\.mailer_sender = \).*|\1'${EMAIL}'|" /srv/crisiscleanup/cc_conf/initializers/devise.rb -sed -i "s|\(^ENV['GOOGLE_MAPS_API_KEY'] = \).*|\1${GMAPS_API_KEY}|" /srv/crisiscleanup/cc_conf/boot.rb +# Volumes +CC_CONF="${VOLUMES_DIR}/crisiscleanup/cc_conf" + +# Replacements +sed -i "s|\(^ config\.mailer_sender = \).*|\1'${EMAIL}'|" ${CC_CONF}/initializers/devise.rb +sed -i "s|\(^ENV['GOOGLE_MAPS_API_KEY'] = \).*|\1${GMAPS_API_KEY}|" ${CC_CONF}/boot.rb diff --git a/lxc-apps/cts/install.sh b/lxc-apps/cts/install.sh index 0a2400d..0e91e57 100755 --- a/lxc-apps/cts/install.sh +++ b/lxc-apps/cts/install.sh @@ -42,4 +42,3 @@ spoc-container stop cts-postgres # Register application vmmgr register-app cts cts "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}" -vmmgr register-prop cts email "${CTS_ADMIN_EMAIL}" diff --git a/lxc-apps/cts/install/update-conf.sh b/lxc-apps/cts/install/update-conf.sh index cfb76d0..2d8e28f 100644 --- a/lxc-apps/cts/install/update-conf.sh +++ b/lxc-apps/cts/install/update-conf.sh @@ -1,3 +1,7 @@ #!/bin/sh -sed -i "s|\(^SERVER_EMAIL = \).*|\1'${EMAIL}'|" /srv/cts/cts_conf/spotter.py +# Volumes +CTS_CONF="${VOLUMES_DIR}/cts/cts_conf" + +# Replacements +sed -i "s|\(^SERVER_EMAIL = \).*|\1'${EMAIL}'|" ${CTS_CONF}/spotter.py diff --git a/lxc-apps/gnuhealth/install.sh b/lxc-apps/gnuhealth/install.sh index 09102dc..40f2e33 100755 --- a/lxc-apps/gnuhealth/install.sh +++ b/lxc-apps/gnuhealth/install.sh @@ -36,4 +36,3 @@ spoc-container stop gnuhealth-postgres # Register application vmmgr register-app gnuhealth gh "${GNUHEALTH_ADMIN_USER}" "${GNUHEALTH_ADMIN_PWD}" -vmmgr register-prop gnuhealth email "${GNUHEALTH_ADMIN_EMAIL}" diff --git a/lxc-apps/gnuhealth/install/update-conf.sh b/lxc-apps/gnuhealth/install/update-conf.sh index 8fedb18..03bf1a3 100644 --- a/lxc-apps/gnuhealth/install/update-conf.sh +++ b/lxc-apps/gnuhealth/install/update-conf.sh @@ -1,3 +1,7 @@ #!/bin/sh -sed -i "s|\(^from = \).*|\1${EMAIL}|" /srv/gnuhealth/gnuhealth_conf/trytond.conf +# Volumes +GNUHEALTH_CONF="${VOLUMES_DIR}/gnuhealth/gnuhealth_conf" + +# Replacements +sed -i "s|\(^from = \).*|\1${EMAIL}|" ${GNUHEALTH_CONF}/trytond.conf diff --git a/lxc-apps/kanboard/install.sh b/lxc-apps/kanboard/install.sh index 8c98bf4..1b73294 100755 --- a/lxc-apps/kanboard/install.sh +++ b/lxc-apps/kanboard/install.sh @@ -36,4 +36,3 @@ spoc-container stop kanboard-postgres # Register application vmmgr register-app kanboard kb "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_PWD}" -vmmgr register-prop kanboard email "admin@example.com" diff --git a/lxc-apps/kanboard/install/update-conf.sh b/lxc-apps/kanboard/install/update-conf.sh index aedf93a..55c7e1e 100644 --- a/lxc-apps/kanboard/install/update-conf.sh +++ b/lxc-apps/kanboard/install/update-conf.sh @@ -1,3 +1,7 @@ #!/bin/sh -sed -i "s|\(^define('MAIL_FROM', \).*|\1'${EMAIL}');|" /srv/kanboard/kanboard_conf/config.php +# Volumes +KANBOARD_CONF="${VOLUMES_DIR}/kanboard/kanboard_conf" + +# Replacements +sed -i "s|\(^define('MAIL_FROM', \).*|\1'${EMAIL}');|" ${KANBOARD_CONF}/config.php diff --git a/lxc-apps/mifosx/install.sh b/lxc-apps/mifosx/install.sh index d53780f..91da368 100755 --- a/lxc-apps/mifosx/install.sh +++ b/lxc-apps/mifosx/install.sh @@ -48,4 +48,3 @@ spoc-container stop mifosx-mariadb # Register application vmmgr register-app mifosx mifosx "${MIFOSX_ADMIN_USER}" "${MIFOSX_ADMIN_PWD}" -vmmgr register-prop mifosx email "${MIFOSX_ADMIN_EMAIL}" diff --git a/lxc-apps/mifosx/install/update-conf.sh b/lxc-apps/mifosx/install/update-conf.sh index d7579fd..f8a0dd6 100644 --- a/lxc-apps/mifosx/install/update-conf.sh +++ b/lxc-apps/mifosx/install/update-conf.sh @@ -1,7 +1,11 @@ #!/bin/sh -sed -i "s|\(^\s\+proxyName=\).*|\1\"mifosx.${DOMAIN}\"|" /srv/mifosx/mifosx_conf/server.xml -sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" /srv/mifosx/mifosx_conf/server.xml +# Volumes +MIFOSX_CONF="${VOLUMES_DIR}/mifosx/mifosx_conf" + +# Replacements +sed -i "s|\(^\s\+proxyName=\).*|\1\"${HOST}.${DOMAIN}\"|" ${MIFOSX_CONF}/server.xml +sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" ${MIFOSX_CONF}/server.xml QUERY="UPDATE \`c_external_service_properties\` SET \`value\` = '${EMAIL}' WHERE \`external_service_id\` = 2 and \`name\` LIKE 'username'" -lxc-attach mifosx-mariadb -- mysql -u mysql -e "${QUERY}" mifostenant-default +spoc-container exec mifosx-mariadb -- mysql -e "${QUERY}" mifostenant-default diff --git a/lxc-apps/motech/install/update-conf.sh b/lxc-apps/motech/install/update-conf.sh index 4bef288..d4aabca 100644 --- a/lxc-apps/motech/install/update-conf.sh +++ b/lxc-apps/motech/install/update-conf.sh @@ -1,5 +1,11 @@ #!/bin/sh -HOST="${DOMAIN}" -[ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}" -sed -i "s|\(^server\.url=\).*|\1https://motech.${HOST}|" /srv/motech/motech_conf/config/motech-settings.properties +# Volumes +MOTECH_CONF="${VOLUMES_DIR}/motech/motech_conf" + +# Variables +HOST="${HOST}.${DOMAIN}" +[ "${PORT}" != "443" ] && HOST="${HOST}:${PORT}" + +# Replacements +sed -i "s|\(^server\.url=\).*|\1https://${HOST}|" ${MOTECH_CONF}/config/motech-settings.properties diff --git a/lxc-apps/odoo/install.sh b/lxc-apps/odoo/install.sh index 91af2b3..53a7e52 100755 --- a/lxc-apps/odoo/install.sh +++ b/lxc-apps/odoo/install.sh @@ -42,4 +42,3 @@ spoc-container stop odoo-postgres # Register application vmmgr register-app odoo odoo "${ODOO_ADMIN_USER}" "${ODOO_ADMIN_PWD}" -vmmgr register-prop odoo email "admin@example.com" diff --git a/lxc-apps/odoo/install/update-conf.sh b/lxc-apps/odoo/install/update-conf.sh index 137920d..29ba6ee 100644 --- a/lxc-apps/odoo/install/update-conf.sh +++ b/lxc-apps/odoo/install/update-conf.sh @@ -1,3 +1,7 @@ #!/bin/sh -sed -i "s|\(^email_from = \).*|\1${EMAIL}|" /srv/odoo/odoo_conf/odoo.conf +# Volumes +ODOO_CONF="${VOLUMES_DIR}/odoo/odoo_conf" + +# Replacements +sed -i "s|\(^email_from = \).*|\1${EMAIL}|" ${ODOO_CONF}/odoo.conf diff --git a/lxc-apps/opendatakit/install/update-conf.sh b/lxc-apps/opendatakit/install/update-conf.sh index aab077b..7e19b88 100644 --- a/lxc-apps/opendatakit/install/update-conf.sh +++ b/lxc-apps/opendatakit/install/update-conf.sh @@ -1,5 +1,9 @@ #!/bin/sh -sed -i "s|\(^\s\+proxyName=\).*|\1\"odk.${DOMAIN}\"|" /srv/opendatakit/odk_conf/server.xml -sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" /srv/opendatakit/odk_conf/server.xml -sed -i "s|\(^security\.server\.securePort=\).*|\1${PORT}|" /srv/opendatakit/odk_conf/security.properties +# Volumes +ODK_CONF="${VOLUMES_DIR}/opendatakit/odk_conf" + +# Replacements +sed -i "s|\(^\s\+proxyName=\).*|\1\"${HOST}.${DOMAIN}\"|" ${ODK_CONF}/server.xml +sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" ${ODK_CONF}/server.xml +sed -i "s|\(^security\.server\.securePort=\).*|\1${PORT}|" ${ODK_CONF}/security.properties diff --git a/lxc-apps/pandora/install.sh b/lxc-apps/pandora/install.sh index 94155fd..6f72557 100755 --- a/lxc-apps/pandora/install.sh +++ b/lxc-apps/pandora/install.sh @@ -56,4 +56,3 @@ spoc-container stop pandora-rabbitmq # Register application vmmgr register-app pandora pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}" -vmmgr register-prop pandora gmaps-api-key "" diff --git a/lxc-apps/pandora/install/update-conf.sh b/lxc-apps/pandora/install/update-conf.sh index 7338d2e..3672d8d 100644 --- a/lxc-apps/pandora/install/update-conf.sh +++ b/lxc-apps/pandora/install/update-conf.sh @@ -1,7 +1,12 @@ #!/bin/sh -HOST="${DOMAIN}" -[ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}" -sed -i "s|\(^\s\+\"url\": \).*|\1\"pandora.${HOST}\"|" /srv/pandora/pandora_conf/config.jsonc +# Volumes +PANDORA_CONF="${VOLUMES_DIR}/pandora/pandora_conf" -sed -i "s|\(^GOOGLE_API_KEY = \).*|\1'${GMAPS_API_KEY}'|" /srv/pandora/pandora_conf/local_settings.py +# Variables +HOST="${HOST}.${DOMAIN}" +[ "${PORT}" != "443" ] && HOST="${HOST}:${PORT}" + +# Replacements +sed -i "s|\(^\s\+\"url\": \).*|\1\"${HOST}\"|" ${PANDORA_CONF}/config.jsonc +sed -i "s|\(^GOOGLE_API_KEY = \).*|\1'${GMAPS_API_KEY}'|" ${PANDORA_CONF}/local_settings.py diff --git a/lxc-apps/sahana-demo/install.sh b/lxc-apps/sahana-demo/install.sh index 0ee066f..2054237 100755 --- a/lxc-apps/sahana-demo/install.sh +++ b/lxc-apps/sahana-demo/install.sh @@ -47,5 +47,3 @@ spoc-container stop sahana-demo-postgres # Register application vmmgr register-app sahana-demo sahana-demo "${SAHANADEMO_ADMIN_USER}" "${SAHANADEMO_ADMIN_PWD}" -vmmgr register-prop sahana-demo email "${SAHANADEMO_ADMIN_USER}" -vmmgr register-prop sahana-demo gmaps-api-key "" diff --git a/lxc-apps/sahana-demo/install/update-conf.sh b/lxc-apps/sahana-demo/install/update-conf.sh index 8e70a70..ea76ff1 100644 --- a/lxc-apps/sahana-demo/install/update-conf.sh +++ b/lxc-apps/sahana-demo/install/update-conf.sh @@ -1,9 +1,14 @@ #!/bin/sh -HOST="${DOMAIN}" -[ "${PORT}" != "443" ] && HOST="${PORT}:${DOMAIN}" -sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sahana-demo.${HOST}\"|" /srv/sahana-demo/sahana_conf/000_config.py +# Volumes +SAHANA_CONF="${VOLUMES_DIR}/sahana-demo/sahana_conf" -sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" /srv/sahana-demo/sahana_conf/000_config.py -sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" /srv/sahana-demo/sahana_conf/000_config.py -sed -i "s|\(^settings\.gis\.api_google = \).*|\1\"${GMAPS_API_KEY}\"|" /srv/sahana-demo/sahana_conf/000_config.py +# Variables +HOST="${HOST}.${DOMAIN}" +[ "${PORT}" != "443" ] && HOST="${HOST}:${PORT}" + +# Replacements +sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://${HOST}\"|" ${SAHANA_CONF}/000_config.py +sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" ${SAHANA_CONF}/000_config.py +sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" ${SAHANA_CONF}/000_config.py +sed -i "s|\(^settings\.gis\.api_google = \).*|\1\"${GMAPS_API_KEY}\"|" ${SAHANA_CONF}/000_config.py diff --git a/lxc-apps/sahana/install.sh b/lxc-apps/sahana/install.sh index 04ebd1a..da74e1b 100755 --- a/lxc-apps/sahana/install.sh +++ b/lxc-apps/sahana/install.sh @@ -52,5 +52,3 @@ spoc-container stop sahana-postgres # Register application vmmgr register-app sahana sahana "${SAHANA_ADMIN_USER}" "${SAHANA_ADMIN_PWD}" -vmmgr register-prop sahana email "${SAHANA_ADMIN_USER}" -vmmgr register-prop sahana gmaps-api-key "" diff --git a/lxc-apps/sahana/install/update-conf.sh b/lxc-apps/sahana/install/update-conf.sh index 98b3be1..f65da9a 100644 --- a/lxc-apps/sahana/install/update-conf.sh +++ b/lxc-apps/sahana/install/update-conf.sh @@ -1,9 +1,14 @@ #!/bin/sh -HOST="${DOMAIN}" -[ "${PORT}" != "443" ] && HOST="${PORT}:${DOMAIN}" -sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sahana.${HOST}\"|" /srv/sahana/sahana_conf/000_config.py +# Volumes +SAHANA_CONF="${VOLUMES_DIR}/sahana/sahana_conf" -sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" /srv/sahana/sahana_conf/000_config.py -sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" /srv/sahana/sahana_conf/000_config.py -sed -i "s|\(^settings\.gis\.api_google = \).*|\1\"${GMAPS_API_KEY}\"|" /srv/sahana/sahana_conf/000_config.py +# Variables +HOST="${HOST}.${DOMAIN}" +[ "${PORT}" != "443" ] && HOST="${HOST}:${PORT}" + +# Replacements +sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://${HOST}\"|" ${SAHANA_CONF}/000_config.py +sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" ${SAHANA_CONF}/000_config.py +sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" ${SAHANA_CONF}/000_config.py +sed -i "s|\(^settings\.gis\.api_google = \).*|\1\"${GMAPS_API_KEY}\"|" ${SAHANA_CONF}/000_config.py diff --git a/lxc-apps/sambro/install.sh b/lxc-apps/sambro/install.sh index c877cfa..5f546d1 100755 --- a/lxc-apps/sambro/install.sh +++ b/lxc-apps/sambro/install.sh @@ -50,5 +50,3 @@ spoc-container stop sambro-postgres # Register application vmmgr register-app sambro sambro "${SAMBRO_ADMIN_USER}" "${SAMBRO_ADMIN_PWD}" -vmmgr register-prop sambro email "${SAMBRO_ADMIN_USER}" -vmmgr register-prop sambro gmaps-api-key "" diff --git a/lxc-apps/sambro/install/update-conf.sh b/lxc-apps/sambro/install/update-conf.sh index 4b92f95..7d73047 100644 --- a/lxc-apps/sambro/install/update-conf.sh +++ b/lxc-apps/sambro/install/update-conf.sh @@ -1,9 +1,14 @@ #!/bin/sh -HOST="${DOMAIN}" -[ "${PORT}" != "443" ] && HOST="${PORT}:${DOMAIN}" -sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sambro.${HOST}\"|" /srv/sambro/sahana_conf/000_config.py +# Volumes +SAHANA_CONF="${VOLUMES_DIR}/sambro/sahana_conf" -sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" /srv/sambro/sahana_conf/000_config.py -sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" /srv/sambro/sahana_conf/000_config.py -sed -i "s|\(^settings\.gis\.api_google = \).*|\1\"${GMAPS_API_KEY}\"|" /srv/sambro/sahana_conf/000_config.py +# Variables +HOST="${HOST}.${DOMAIN}" +[ "${PORT}" != "443" ] && HOST="${HOST}:${PORT}" + +# Replacements +sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://${HOST}\"|" ${SAHANA_CONF}/000_config.py +sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" ${SAHANA_CONF}/000_config.py +sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" ${SAHANA_CONF}/000_config.py +sed -i "s|\(^settings\.gis\.api_google = \).*|\1\"${GMAPS_API_KEY}\"|" ${SAHANA_CONF}/000_config.py diff --git a/lxc-apps/seeddms/install.sh b/lxc-apps/seeddms/install.sh index c89ad56..73c2a55 100755 --- a/lxc-apps/seeddms/install.sh +++ b/lxc-apps/seeddms/install.sh @@ -38,4 +38,3 @@ spoc-container stop seeddms-postgres # Register application vmmgr register-app seeddms dms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}" -vmmgr register-prop seeddms email "${SEEDDMS_ADMIN_EMAIL}" diff --git a/lxc-apps/seeddms/install/update-conf.sh b/lxc-apps/seeddms/install/update-conf.sh index c0651f1..9c46fa8 100644 --- a/lxc-apps/seeddms/install/update-conf.sh +++ b/lxc-apps/seeddms/install/update-conf.sh @@ -1,3 +1,7 @@ #!/bin/sh -sed -i "s|\(^\s\+|" /srv/seeddms/seeddms_conf/settings.xml +# Volumes +SEEDDMS_CONF="${VOLUMES_DIR}/seeddms/seeddms_conf" + +# Replacements +sed -i "s|\(^\s\+|" ${SEEDDMS_CONF}/settings.xml diff --git a/lxc-apps/sigmah/install.sh b/lxc-apps/sigmah/install.sh index 29b79b4..1891fe1 100755 --- a/lxc-apps/sigmah/install.sh +++ b/lxc-apps/sigmah/install.sh @@ -50,5 +50,3 @@ spoc-container stop sigmah-postgres # Register application vmmgr register-app sigmah sigmah "${SIGMAH_ADMIN_EMAIL}" "${SIGMAH_ADMIN_PWD}" -vmmgr register-prop sigmah email "${SIGMAH_ADMIN_EMAIL}" -vmmgr register-prop sigmah gmaps-api-key "" diff --git a/lxc-apps/sigmah/install/update-conf.sh b/lxc-apps/sigmah/install/update-conf.sh index ac29218..5a702dc 100644 --- a/lxc-apps/sigmah/install/update-conf.sh +++ b/lxc-apps/sigmah/install/update-conf.sh @@ -1,5 +1,9 @@ #!/bin/sh -sed -i "s|\(^mail\.from\.address=\).*|\1${EMAIL}|" /srv/sigmah/sigmah_conf/sigmah.properties -sed -i "s|\(^mail\.support\.to=\).*|\1${EMAIL}|" /srv/sigmah/sigmah_conf/sigmah.properties -sed -i "s|\(^maps\.key=\).*|\1${GMAPS_API_KEY}|" /srv/sigmah/sigmah_conf/sigmah.properties +# Volumes +SIGMAH_CONF="${VOLUMES_DIR}/sigmah/sigmah_conf" + +# Replacements +sed -i "s|\(^mail\.from\.address=\).*|\1${EMAIL}|" ${SIGMAH_CONF}/sigmah.properties +sed -i "s|\(^mail\.support\.to=\).*|\1${EMAIL}|" ${SIGMAH_CONF}/sigmah.properties +sed -i "s|\(^maps\.key=\).*|\1${GMAPS_API_KEY}|" ${SIGMAH_CONF}/sigmah.properties diff --git a/lxc-apps/ushahidi/install.sh b/lxc-apps/ushahidi/install.sh index ce95eb4..0c94657 100755 --- a/lxc-apps/ushahidi/install.sh +++ b/lxc-apps/ushahidi/install.sh @@ -50,5 +50,3 @@ spoc-container stop ushahidi-mariadb # Register application vmmgr register-app ushahidi ush "${USHAHIDI_ADMIN_USER}" "${USHAHIDI_ADMIN_PWD}" -vmmgr register-prop ushahidi email "${USHAHIDI_ADMIN_USER}" -vmmgr register-prop ushahidi gmaps-api-key "" diff --git a/lxc-apps/ushahidi/install/update-conf.sh b/lxc-apps/ushahidi/install/update-conf.sh index 2ac4e85..02eb4e7 100644 --- a/lxc-apps/ushahidi/install/update-conf.sh +++ b/lxc-apps/ushahidi/install/update-conf.sh @@ -1,15 +1,21 @@ #!/bin/sh -HOST="${DOMAIN}" -[ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}" -sed -i "s|\(^\s\+\"backend_url\": \).*|\1\"https://ush.${HOST}/platform\",|" /srv/ushahidi/ushahidi_conf/config.json -API_URL="\"https:\\\/\\\/ush.${HOST}\\\/platform\\\/api\\\/v3\\\/config\\\/data-provider\"" +# Volumes +USHAHIDI_CONF="${VOLUMES_DIR}/ushahidi/ushahidi_conf" + +# Variables +HOST="${HOST}.${DOMAIN}" +[ "${PORT}" != "443" ] && HOST="${HOST}:${PORT}" + +# Replacements +sed -i "s|\(^\s\+\"backend_url\": \).*|\1\"https://${HOST}/platform\",|" ${USHAHIDI_CONF}/config.json +API_URL="\"https:\\\/\\\/${HOST}\\\/platform\\\/api\\\/v3\\\/config\\\/data-provider\"" QUERY="UPDATE \`config\` SET \`config_value\` = '${API_URL}' WHERE \`group_name\` LIKE 'data-provider' AND \`config_key\` LIKE 'url'" -lxc-attach ushahidi-mariadb -- mysql -u mysql -e "${QUERY}" ushahidi +spoc-container exec ushahidi-mariadb -- mysql -e "${QUERY}" ushahidi JSON="{\"incoming_type\":\"IMAP\",\"incoming_server\":\"localhost\",\"incoming_port\":143,\"incoming_security\":\"None\",\"incoming_username\":\"${EMAIL}\",\"incoming_password\":\"password\",\"outgoing_type\":\"SMTP\",\"outgoing_server\":\"host\",\"outgoing_port\":25,\"outgoing_security\":\"None\",\"outgoing_username\":\"${EMAIL}\",\"outgoing_password\":\"password\",\"from\":\"${EMAIL}\",\"from_name\":\"Ushahidi\"}" QUERY="UPDATE \`config\` SET \`config_value\` = '${JSON}' WHERE \`group_name\` LIKE 'data-provider' AND \`config_key\` LIKE 'email'" -lxc-attach ushahidi-mariadb -- mysql -u mysql -e "${QUERY}" ushahidi +spoc-container exec ushahidi-mariadb -- mysql -e "${QUERY}" ushahidi QUERY="UPDATE \`config\` SET \`config_value\` = '\"${EMAIL}\"' WHERE \`group_name\` LIKE 'site' AND \`config_key\` LIKE 'email'" -lxc-attach ushahidi-mariadb -- mysql -u mysql -e "${QUERY}" ushahidi -sed -i "s|\(^\s\+\"google_analytics_id\": \).*|\1\"${GMAPS_API_KEY}\"|" /srv/ushahidi/ushahidi_conf/config.json +spoc-container exec ushahidi-mariadb -- mysql -e "${QUERY}" ushahidi +sed -i "s|\(^\s\+\"google_analytics_id\": \).*|\1\"${GMAPS_API_KEY}\"|" ${USHAHIDI_CONF}/config.json