Put config update script installation to the end of setup

This commit is contained in:
Disassembler 2018-09-20 15:45:00 +02:00
parent 011cf4356b
commit 96249760fd
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
17 changed files with 55 additions and 23 deletions

View File

@ -5,7 +5,6 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
# Configure CKAN DataPusher
mkdir -p /srv/ckan-datapusher/conf /srv/ckan-datapusher/data
cp ${SOURCE_DIR}/srv/ckan-datapusher/update-conf.sh /srv/ckan-datapusher/update-conf.sh
cp ${SOURCE_DIR}/srv/ckan-datapusher/conf/datapusher.wsgi /srv/ckan-datapusher/conf/datapusher.wsgi
cp ${SOURCE_DIR}/srv/ckan-datapusher/conf/datapusher_settings.py /srv/ckan-datapusher/conf/datapusher_settings.py
chown -R 8004:8004 /srv/ckan-datapusher/data
@ -13,3 +12,6 @@ chown -R 8004:8004 /srv/ckan-datapusher/data
# Install service
cp ${SOURCE_DIR}/etc/init.d/ckan-datapusher /etc/init.d/ckan-datapusher
rc-update -u
# Install config update script
cp ${SOURCE_DIR}/srv/ckan-datapusher/update-conf.sh /srv/ckan-datapusher/update-conf.sh

View File

@ -22,7 +22,6 @@ service solr restart
# Configure CKAN
mkdir -p /srv/ckan/conf /srv/ckan/data
cp ${SOURCE_DIR}/srv/ckan/update-conf.sh /srv/ckan/update-conf.sh
export CKAN_SECRET=$(head -c 18 /dev/urandom | base64)
export CKAN_UUID=$(cat /proc/sys/kernel/random/uuid)
envsubst <${SOURCE_DIR}/srv/ckan/conf/ckan.ini >/srv/ckan/conf/ckan.ini
@ -56,6 +55,9 @@ cp ${SOURCE_DIR}/etc/periodic/hourly/ckan /etc/periodic/hourly/ckan
cp ${SOURCE_DIR}/etc/init.d/ckan /etc/init.d/ckan
rc-update -u
# Install config update script
cp ${SOURCE_DIR}/srv/ckan/update-conf.sh /srv/ckan/update-conf.sh
# Stop services required for setup
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
[ ! -z ${STOP_REDIS} ] && service redis stop

View File

@ -16,7 +16,6 @@ chown 8005:8005 /srv/crisiscleanup/conf
cp -r /var/lib/lxc/crisiscleanup/crisiscleanup/srv/crisiscleanup/config/. /srv/crisiscleanup/conf
# Configure CrisisCleanup
cp ${SOURCE_DIR}/srv/crisiscleanup/update-conf.sh /srv/crisiscleanup/update-conf.sh
export CRISISCLEANUP_ADMIN_USER="Admin"
export CRISISCLEANUP_ADMIN_EMAIL="admin@example.com"
export CRISISCLEANUP_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
@ -35,5 +34,8 @@ lxc-execute crisiscleanup -- rake db:seed
cp ${SOURCE_DIR}/etc/init.d/crisiscleanup /etc/init.d/crisiscleanup
rc-update -u
# Install config update script
cp ${SOURCE_DIR}/srv/crisiscleanup/update-conf.sh /srv/crisiscleanup/update-conf.sh
# Stop services required for setup
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -15,7 +15,6 @@ mkdir -p /srv/cts/conf
cp /var/lib/lxc/cts/cts/srv/cts/cts/settings/base.py /srv/cts/conf
# Configure CTS
cp ${SOURCE_DIR}/srv/cts/update-conf.sh /srv/cts/update-conf.sh
export CTS_SECRET=$(head -c 26 /dev/urandom | base64)
envsubst <${SOURCE_DIR}/srv/cts/conf/spotter.py >/srv/cts/conf/spotter.py
touch /srv/cts/conf/__init__.py
@ -40,5 +39,8 @@ vmmgr update-login cts "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}"
cp ${SOURCE_DIR}/etc/init.d/cts /etc/init.d/cts
rc-update -u
# Install config update script
cp ${SOURCE_DIR}/srv/cts/update-conf.sh /srv/cts/update-conf.sh
# Stop services required for setup
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -12,7 +12,6 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
# Configure GNU Health
mkdir -p /srv/gnuhealth/conf/
cp ${SOURCE_DIR}/srv/gnuhealth/update-conf.sh /srv/gnuhealth/update-conf.sh
envsubst <${SOURCE_DIR}/srv/gnuhealth/conf/trytond.conf >/srv/gnuhealth/conf/trytond.conf
# Populate database
@ -32,5 +31,8 @@ rm -f /tmp/gnuhealth_demo.sql.gz
cp ${SOURCE_DIR}/etc/init.d/gnuhealth /etc/init.d/gnuhealth
rc-update -u
# Install config update script
cp ${SOURCE_DIR}/srv/gnuhealth/update-conf.sh /srv/gnuhealth/update-conf.sh
# Stop services required for setup
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -13,7 +13,6 @@ cat /var/lib/lxc/kanboard/kanboard/srv/kanboard/app/Schema/Sql/postgres.sql | lx
# Configure Kanboard
mkdir -p /srv/kanboard/conf /srv/kanboard/data
cp ${SOURCE_DIR}/srv/kanboard/update-conf.sh /srv/kanboard/update-conf.sh
chown -R 8009:8009 /srv/kanboard/data
envsubst <${SOURCE_DIR}/srv/kanboard/conf/config.php >/srv/kanboard/conf/config.php
export KANBOARD_ADMIN_USER=admin
@ -22,12 +21,15 @@ export KANBOARD_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${K
envsubst <${SOURCE_DIR}/adminpwd.sql | lxc-attach -u 5432 -g 5432 postgres -- psql kanboard
vmmgr update-login kanboard "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_PWD}"
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/daily/kanboard /etc/periodic/daily/kanboard
# Install service
cp ${SOURCE_DIR}/etc/init.d/kanboard /etc/init.d/kanboard
rc-update -u
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/daily/kanboard /etc/periodic/daily/kanboard
# Install config update script
cp ${SOURCE_DIR}/srv/kanboard/update-conf.sh /srv/kanboard/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -16,7 +16,6 @@ envsubst <${SOURCE_DIR}/schemapwd.sql | lxc-attach mariadb -- mysql mifosplatfor
# Configure Mifos X
mkdir -p /srv/mifosx/conf
cp ${SOURCE_DIR}/srv/mifosx/update-conf.sh /srv/mifosx/update-conf.sh
envsubst <${SOURCE_DIR}/srv/mifosx/conf/context.xml >/srv/mifosx/conf/context.xml
cp ${SOURCE_DIR}/srv/mifosx/conf/server.xml /srv/mifosx/conf/server.xml
@ -42,5 +41,8 @@ export MIFOSX_ADMIN_HASH=$(echo -n "${MIFOSX_ADMIN_PWD}{1}" | sha256sum | awk '{
envsubst <${SOURCE_DIR}/adminpwd.sql | lxc-attach mariadb -- mysql mifostenant-default
vmmgr update-login mifosx "${MIFOSX_ADMIN_USER}" "${MIFOSX_ADMIN_PWD}"
# Install config update script
cp ${SOURCE_DIR}/srv/mifosx/update-conf.sh /srv/mifosx/update-conf.sh
# Stop services required for setup
[ ! -z ${STOP_MARIADB} ] && service mariadb stop

View File

@ -3,5 +3,5 @@
sed -i "s|\(^\s\+proxyName=\).*|\1\"${DOMAIN}\"|" /srv/mifosx/conf/server.xml
sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" /srv/mifosx/conf/server.xml
QUERY="UPDATE \`c_external_service_properties\` SET `value` = '${EMAIL}' WHERE \`external_service_id\` = 2 and \`name\` LIKE 'username'"
QUERY="UPDATE \`c_external_service_properties\` SET \`value\` = '${EMAIL}' WHERE \`external_service_id\` = 2 and \`name\` LIKE 'username'"
lxc-attach mariadb -- mysql -e "${QUERY}" mifostenant-default

View File

@ -13,7 +13,6 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
# Configure Motech
mkdir -p /srv/motech/conf/config/org.motechproject.motech-platform-email
cp ${SOURCE_DIR}/srv/motech/update-conf.sh /srv/motech/update-conf.sh
envsubst <${SOURCE_DIR}/srv/motech/conf/config/bootstrap.properties >/srv/motech/conf/config/bootstrap.properties
cp ${SOURCE_DIR}/srv/motech/conf/config-locations.properties /srv/motech/conf/config-locations.properties
cp ${SOURCE_DIR}/srv/motech/conf/config/motech-settings.properties /srv/motech/conf/config/motech-settings.properties
@ -38,6 +37,9 @@ curl -H "Content-Type: application/json" -X POST -d "{\"adminLogin\":\"${MOTECH_
service motech stop
vmmgr update-login motech "${MOTECH_ADMIN_USER}" "${MOTECH_ADMIN_PWD}"
# Install config update script
cp ${SOURCE_DIR}/srv/motech/update-conf.sh /srv/motech/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_ACTIVEMQ} ] && service activemq stop
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -12,7 +12,6 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
# Configure OpenDataKit
mkdir -p /srv/opendatakit/conf
cp ${SOURCE_DIR}/srv/opendatakit/update-conf.sh /srv/opendatakit/update-conf.sh
envsubst <${SOURCE_DIR}/srv/opendatakit/conf/jdbc.properties >/srv/opendatakit/conf/jdbc.properties
envsubst <${SOURCE_DIR}/srv/opendatakit/conf/security.properties >/srv/opendatakit/conf/security.properties
cp ${SOURCE_DIR}/srv/opendatakit/conf/server.xml /srv/opendatakit/conf/server.xml
@ -39,5 +38,8 @@ export OPENDATAKIT_ADMIN_DIGEST_HASH=$(echo -n "${OPENDATAKIT_ADMIN_USER}:${OPEN
envsubst <${SOURCE_DIR}/adminpwd.sql | lxc-attach -u 5432 -g 5432 postgres -- psql opendatakit
vmmgr update-login opendatakit "${OPENDATAKIT_ADMIN_USER}" "${OPENDATAKIT_ADMIN_PWD}"
# Install config update script
cp ${SOURCE_DIR}/srv/opendatakit/update-conf.sh /srv/opendatakit/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -19,7 +19,6 @@ lxc-attach rabbitmq -- rabbitmqctl set_permissions -p /pandora pandora ".*" ".*"
# Configure Pandora
mkdir -p /srv/pandora/conf /srv/pandora/data
cp ${SOURCE_DIR}/srv/pandora/update-conf.sh /srv/pandora/update-conf.sh
chown 8002:8002 /srv/pandora/data
# Copy customized configuration if VANILLA environment variable is not set, else use the default pandora config
if [ ${VANILLA:-0} -eq 0 ]; then
@ -54,6 +53,9 @@ vmmgr update-login pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}"
cp ${SOURCE_DIR}/etc/init.d/pandora /etc/init.d/pandora
rc-update -u
# Install config update script
cp ${SOURCE_DIR}/srv/pandora/update-conf.sh /srv/pandora/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
[ ! -z ${STOP_RABBITMQ} ] && service rabbitmq stop

View File

@ -18,7 +18,6 @@ cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/models/. /srv/sah
cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/modules/templates/${TEMPLATE}/. /srv/sahana-demo/data/${TEMPLATE}
# Configure Sahana
cp ${SOURCE_DIR}/srv/sahana-demo/update-conf.sh /srv/sahana-demo/update-conf.sh
export SAHANADEMO_HMAC=$(head -c 18 /dev/urandom | base64)
export SAHANADEMO_ADMIN_USER=admin@example.com
export SAHANADEMO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
@ -37,5 +36,8 @@ rm /var/lib/lxc/sahana/sahana/tmp/masterUsers.csv
envsubst <${SOURCE_DIR}/etc/init.d/sahana-demo >/etc/init.d/sahana-demo
chmod +x /etc/init.d/sahana-demo
# Install config update script
cp ${SOURCE_DIR}/srv/sahana-demo/update-conf.sh /srv/sahana-demo/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -20,7 +20,6 @@ cp -r ${SOURCE_DIR}/srv/sahana/data/Spotter /srv/sahana/data/
chown -R 8001:8001 /srv/sahana/data
# Configure Sahana
cp ${SOURCE_DIR}/srv/sahana/update-conf.sh /srv/sahana/update-conf.sh
export SAHANA_HMAC=$(head -c 18 /dev/urandom | base64)
export SAHANA_ADMIN_USER=admin@example.com
export SAHANA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
@ -43,5 +42,8 @@ fi
cp ${SOURCE_DIR}/etc/init.d/sahana /etc/init.d/sahana
rc-update -u
# Install config update script
cp ${SOURCE_DIR}/srv/sahana/update-conf.sh /srv/sahana/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -17,7 +17,6 @@ cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/models/. /srv/sah
cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/modules/templates/SAMBRO/. /srv/sahana-demo/data/SAMBRO
# Configure SAMBRO
cp ${SOURCE_DIR}/srv/sambro/update-conf.sh /srv/sambro/update-conf.sh
export SAMBRO_HMAC=$(head -c 18 /dev/urandom | base64)
export SAMBRO_ADMIN_USER=admin@example.com
export SAMBRO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
@ -42,5 +41,8 @@ fi
cp ${SOURCE_DIR}/etc/init.d/sambro /etc/init.d/sambro
rc-update -u
# Install config update script
cp ${SOURCE_DIR}/srv/sambro/update-conf.sh /srv/sambro/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -19,7 +19,6 @@ cp -rp /var/lib/lxc/seeddms/seeddms/srv/seeddms/data/. /srv/seeddms/data
chown -R 8010:8010 /srv/seeddms/data
# Configure SeedDMS
cp ${SOURCE_DIR}/srv/seeddms/update-conf.sh /srv/seeddms/update-conf.sh
envsubst <${SOURCE_DIR}/srv/seeddms/conf/settings.xml >/srv/seeddms/conf/settings.xml
export SEEDDMS_ADMIN_USER=admin
export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
@ -28,12 +27,15 @@ envsubst <${SOURCE_DIR}/adminpwd.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
chown -R 8010:8010 /srv/seeddms/conf
vmmgr update-login seeddms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}"
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/hourly/seeddms /etc/periodic/hourly/seeddms
# Install service
cp ${SOURCE_DIR}/etc/init.d/seeddms /etc/init.d/seeddms
rc-update -u
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/hourly/seeddms /etc/periodic/hourly/seeddms
# Install config update script
cp ${SOURCE_DIR}/srv/seeddms/update-conf.sh /srv/seeddms/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -12,7 +12,6 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
# Configure Sigmah
mkdir -p /srv/sigmah/conf /srv/sigmah/data/files /srv/sigmah/data/archives
cp ${SOURCE_DIR}/srv/sigmah/update-conf.sh /srv/sigmah/update-conf.sh
chown -R 8011:8011 /srv/sigmah/data
envsubst <${SOURCE_DIR}/srv/sigmah/conf/persistence.xml >/srv/sigmah/conf/persistence.xml
cp ${SOURCE_DIR}/srv/sigmah/conf/sigmah.properties /srv/sigmah/conf/sigmah.properties
@ -42,5 +41,8 @@ vmmgr update-login sigmah "${SIGMAH_ADMIN_EMAIL}" "${SIGMAH_ADMIN_PWD}"
cp ${SOURCE_DIR}/etc/init.d/sigmah /etc/init.d/sigmah
rc-update -u
# Install config update script
cp ${SOURCE_DIR}/srv/sigmah/update-conf.sh /srv/sigmah/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop

View File

@ -12,7 +12,6 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach mariadb -- mysql
# Configure Ushahidi
mkdir -p /srv/ushahidi/conf /srv/ushahidi/data
cp ${SOURCE_DIR}/srv/ushahidi/update-conf.sh /srv/ushahidi/update-conf.sh
chown 8014:8014 /srv/ushahidi/data
envsubst <${SOURCE_DIR}/srv/ushahidi/conf/env >/srv/ushahidi/conf/env
cp ${SOURCE_DIR}/srv/ushahidi/conf/config.json /srv/ushahidi/conf/config.json
@ -27,12 +26,15 @@ export USHAHIDI_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${U
envsubst <${SOURCE_DIR}/adminpwd.sql | lxc-attach mariadb -- mysql ushahidi
vmmgr update-login ushahidi "${USHAHIDI_ADMIN_USER}" "${USHAHIDI_ADMIN_PWD}"
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/15min/ushahidi /etc/periodic/15min/ushahidi
# Install service
cp ${SOURCE_DIR}/etc/init.d/ushahidi /etc/init.d/ushahidi
rc-update -u
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/15min/ushahidi /etc/periodic/15min/ushahidi
# Install config update script
cp ${SOURCE_DIR}/srv/ushahidi/update-conf.sh /srv/ushahidi/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_MARIADB} ] && service mariadb stop