From e4bf6effe1ab2e66cb4d0265fd4765fc8f83fc6f Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 3 Nov 2018 15:53:51 +0100 Subject: [PATCH] Update install scripts for upcomming vmmgr changes --- ckan/install.sh | 4 +++- crisiscleanup/install.sh | 4 +++- cts/install.sh | 4 +++- frontlinesms/install.sh | 4 +++- gnuhealth/install.sh | 4 +++- kanboard/install.sh | 4 +++- mifosx/install.sh | 4 +++- motech/install.sh | 4 +++- opendatakit-build/install.sh | 3 +++ opendatakit/install.sh | 4 +++- openmapkit/install.sh | 4 +++- pandora/install.sh | 4 +++- sahana-demo/install.sh | 4 +++- sahana/install.sh | 4 +++- sambro/install.sh | 4 +++- seeddms/install.sh | 4 +++- sigmah/install.sh | 4 +++- ushahidi/install.sh | 4 +++- 18 files changed, 54 insertions(+), 17 deletions(-) diff --git a/ckan/install.sh b/ckan/install.sh index f63a86c..0b5a30d 100755 --- a/ckan/install.sh +++ b/ckan/install.sh @@ -46,7 +46,6 @@ export CKAN_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export CKAN_ADMIN_HASH=$(lxc-execute ckan -- python -c "from passlib.hash import pbkdf2_sha512;print pbkdf2_sha512.encrypt('${CKAN_ADMIN_PWD}')") export CKAN_ADMIN_EMAIL="admin@example.com" envsubst /srv/crisiscleanup/conf/database. cp srv/crisiscleanup/conf/boot.rb /srv/crisiscleanup/conf/boot.rb cp srv/crisiscleanup/conf/initializers/devise.rb /srv/crisiscleanup/conf/initializers/devise.rb cp srv/crisiscleanup/conf/environments/production.rb /srv/crisiscleanup/conf/environments/production.rb -vmmgr update-login crisiscleanup "${CRISISCLEANUP_ADMIN_EMAIL}" "${CRISISCLEANUP_ADMIN_PWD}" # Populate database envsubst /var/lib/lxc/crisiscleanup/crisiscleanup/srv/crisiscleanup/db/seeds.rb @@ -40,4 +39,7 @@ cp srv/crisiscleanup/update-conf.sh /srv/crisiscleanup/update-conf.sh # Stop services required for setup [ ! -z ${STOP_POSTGRES} ] && service postgres stop +# Register application +vmmgr register-app crisiscleanup "${CRISISCLEANUP_ADMIN_EMAIL}" "${CRISISCLEANUP_ADMIN_PWD}" + exit 0 diff --git a/cts/install.sh b/cts/install.sh index 47110d5..8f14b10 100755 --- a/cts/install.sh +++ b/cts/install.sh @@ -33,7 +33,6 @@ export CTS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export CTS_ADMIN_HASH=$(lxc-execute cts -- python -c "from django.contrib.auth.hashers import make_password; print make_password('${CTS_ADMIN_PWD}')") export CTS_ADMIN_SECRET=$(head -c 12 /dev/urandom | sha256sum | cut -c1-13) envsubst /srv/frontlinesms/data/app-settings.properties chown -R 8018:8018 /srv/frontlinesms/data -vmmgr update-login frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}" # Install service cp etc/init.d/frontlinesms /etc/init.d/frontlinesms rc-update -u +# Register application +vmmgr register-app frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}" + exit 0 diff --git a/gnuhealth/install.sh b/gnuhealth/install.sh index 16004b7..bfe6392 100755 --- a/gnuhealth/install.sh +++ b/gnuhealth/install.sh @@ -20,7 +20,6 @@ export GNUHEALTH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) echo ${GNUHEALTH_ADMIN_PWD} >/var/lib/lxc/gnuhealth/gnuhealth/tmp/.adminpwd lxc-execute gnuhealth -- sh -c 'TRYTONPASSFILE=/tmp/.adminpwd trytond-admin -d gnuhealth --all -v' rm -f /var/lib/lxc/gnuhealth/gnuhealth/tmp/.adminpwd -vmmgr update-login gnuhealth "${GNUHEALTH_ADMIN_USER}" "${GNUHEALTH_ADMIN_PWD}" # Populate demo database wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-32-demo.sql.gz -O /tmp/gnuhealth_demo.sql.gz @@ -37,4 +36,7 @@ cp srv/gnuhealth/update-conf.sh /srv/gnuhealth/update-conf.sh # Stop services required for setup [ ! -z ${STOP_POSTGRES} ] && service postgres stop +# Register application +vmmgr register-app gnuhealth "${GNUHEALTH_ADMIN_USER}" "${GNUHEALTH_ADMIN_PWD}" + exit 0 diff --git a/kanboard/install.sh b/kanboard/install.sh index 2cf9f70..ba35dcf 100755 --- a/kanboard/install.sh +++ b/kanboard/install.sh @@ -19,7 +19,6 @@ export KANBOARD_ADMIN_USER=admin export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export KANBOARD_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${KANBOARD_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))") envsubst /srv/openmapkit/conf/settings.js -vmmgr update-login openmapkit "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}" # Install service cp etc/init.d/openmapkit /etc/init.d/openmapkit rc-update -u +# Register application +vmmgr register-app openmapkit "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}" + exit 0 diff --git a/pandora/install.sh b/pandora/install.sh index e540977..2758071 100755 --- a/pandora/install.sh +++ b/pandora/install.sh @@ -47,7 +47,6 @@ export PANDORA_ADMIN_EMAIL=admin@example.com export PANDORA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export PANDORA_ADMIN_HASH=$(lxc-execute pandora -- sh -c "DJANGO_SETTINGS_MODULE=srv.pandora.pandora.settings python3 -c \"from django.contrib.auth.hashers import make_password; print(make_password('${PANDORA_ADMIN_PWD}'))\"") envsubst /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv chown -R 8001:8001 /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py fi -vmmgr update-login sahana-demo "${SAHANADEMO_ADMIN_USER}" "${SAHANADEMO_ADMIN_PWD}" # Replace template in LXC container mount definition sed -i "s/default/${TEMPLATE}/g" /var/lib/lxc/sahana-demo/config @@ -47,4 +46,7 @@ cp srv/sahana-demo/update-conf.sh /srv/sahana-demo/update-conf.sh # Stop services required for build [ ! -z ${STOP_POSTGRES} ] && service postgres stop +# Register application +vmmgr register-app sahana-demo "${SAHANADEMO_ADMIN_USER}" "${SAHANADEMO_ADMIN_PWD}" + exit 0 diff --git a/sahana/install.sh b/sahana/install.sh index 158309a..308c778 100755 --- a/sahana/install.sh +++ b/sahana/install.sh @@ -26,7 +26,6 @@ export SAHANA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) envsubst /srv/sahana/conf/000_config.py envsubst /srv/sahana/data/Spotter/masterUsers.csv cp srv/sahana/conf/00_settings.py /srv/sahana/conf/00_settings.py -vmmgr update-login sahana "${SAHANA_ADMIN_USER}" "${SAHANA_ADMIN_PWD}" # Populate database lxc-execute -u 8001 -g 8001 sahana -- sh -c 'cd /srv/web2py; ./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py' @@ -48,4 +47,7 @@ cp srv/sahana/update-conf.sh /srv/sahana/update-conf.sh # Stop services required for build [ ! -z ${STOP_POSTGRES} ] && service postgres stop +# Register application +vmmgr register-app sahana "${SAHANA_ADMIN_USER}" "${SAHANA_ADMIN_PWD}" + exit 0 diff --git a/sambro/install.sh b/sambro/install.sh index d55bf6e..fcc80a9 100755 --- a/sambro/install.sh +++ b/sambro/install.sh @@ -26,7 +26,6 @@ envsubst /var/lib/lxc/sambro/sambro/srv/web2py/applications/ed chown -R 8001:8001 /var/lib/lxc/sambro/sambro/srv/web2py cp srv/sambro/conf/00_settings.py /srv/sambro/conf/00_settings.py cp srv/sambro/data/SAMBRO/config.py /srv/sambro/data/SAMBRO/config.py -vmmgr update-login sambro "${SAMBRO_ADMIN_USER}" "${SAMBRO_ADMIN_PWD}" # Populate database lxc-execute -u 8001 -g 8001 sambro -- sh -c 'cd /srv/web2py; ./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py' @@ -48,4 +47,7 @@ cp srv/sambro/update-conf.sh /srv/sambro/update-conf.sh # Stop services required for build [ ! -z ${STOP_POSTGRES} ] && service postgres stop +# Register application +vmmgr register-app sambro "${SAMBRO_ADMIN_USER}" "${SAMBRO_ADMIN_PWD}" + exit 0 diff --git a/seeddms/install.sh b/seeddms/install.sh index aefcaca..0287763 100755 --- a/seeddms/install.sh +++ b/seeddms/install.sh @@ -25,7 +25,6 @@ export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export SEEDDMS_ADMIN_EMAIL=admin@example.com envsubst