Update install scripts for upcomming vmmgr changes

This commit is contained in:
Disassembler 2018-11-03 15:53:51 +01:00
parent d833b439c7
commit e4bf6effe1
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
18 changed files with 54 additions and 17 deletions

View File

@ -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 <adminpwd.sql | lxc-attach -u 5432 -g 5432 postgres -- psql ckan
vmmgr update-login ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}"
# Install cron job
cp etc/periodic/hourly/ckan /etc/periodic/hourly/ckan
@ -63,4 +62,7 @@ cp srv/ckan/update-conf.sh /srv/ckan/update-conf.sh
[ ! -z ${STOP_REDIS} ] && service redis stop
[ ! -z ${STOP_SOLR} ] && service solr stop
# Register application
vmmgr register-app ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}"
exit 0

View File

@ -23,7 +23,6 @@ envsubst <srv/crisiscleanup/conf/database.yml >/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 <srv/crisiscleanup/db/seeds.rb >/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

View File

@ -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 <adminpwd.sql | lxc-attach -u 5432 -g 5432 postgres -- psql cts
vmmgr update-login cts "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}"
# Install service
cp etc/init.d/cts /etc/init.d/cts
@ -45,4 +44,7 @@ cp srv/cts/update-conf.sh /srv/cts/update-conf.sh
# Stop services required for setup
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# Register application
vmmgr register-app cts "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}"
exit 0

View File

@ -11,10 +11,12 @@ export FRONTLINESMS_ADMIN_USER_HASH=$(echo -n "${FRONTLINESMS_ADMIN_USER}" | bas
export FRONTLINESMS_ADMIN_PWD_HASH=$(echo -n "${FRONTLINESMS_ADMIN_PWD}" | base64)
envsubst <srv/frontlinesms/data/app-settings.properties >/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

View File

@ -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

View File

@ -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 <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 etc/periodic/daily/kanboard /etc/periodic/daily/kanboard
@ -34,4 +33,7 @@ cp srv/kanboard/update-conf.sh /srv/kanboard/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# Register application
vmmgr register-app kanboard "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_PWD}"
exit 0

View File

@ -39,7 +39,6 @@ export MIFOSX_ADMIN_EMAIL=admin@example.com
export MIFOSX_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d "+")
export MIFOSX_ADMIN_HASH=$(echo -n "${MIFOSX_ADMIN_PWD}{1}" | sha256sum | awk '{print $1}')
envsubst <adminpwd.sql | lxc-attach mariadb -- mysql mifostenant-default
vmmgr update-login mifosx "${MIFOSX_ADMIN_USER}" "${MIFOSX_ADMIN_PWD}"
# Install config update script
cp srv/mifosx/update-conf.sh /srv/mifosx/update-conf.sh
@ -47,4 +46,7 @@ cp srv/mifosx/update-conf.sh /srv/mifosx/update-conf.sh
# Stop services required for setup
[ ! -z ${STOP_MARIADB} ] && service mariadb stop
# Register application
vmmgr register-app mifosx "${MIFOSX_ADMIN_USER}" "${MIFOSX_ADMIN_PWD}"
exit 0

View File

@ -35,7 +35,6 @@ export MOTECH_ADMIN_EMAIL="admin@example.com"
export MOTECH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
curl -H "Content-Type: application/json" -X POST -d "{\"adminLogin\":\"${MOTECH_ADMIN_USER}\",\"adminEmail\":\"${MOTECH_ADMIN_EMAIL}\",\"adminPassword\":\"${MOTECH_ADMIN_PWD}\",\"adminConfirmPassword\":\"${MOTECH_ADMIN_PWD}\",\"language\":\"cs\",\"providerName\":\"\",\"providerUrl\":\"\",\"schedulerUrl\":\"\"}" http://${MOTECH_IP}:8080/module/server/startup/
service motech stop
vmmgr update-login motech "${MOTECH_ADMIN_USER}" "${MOTECH_ADMIN_PWD}"
# Install config update script
cp srv/motech/update-conf.sh /srv/motech/update-conf.sh
@ -44,4 +43,7 @@ cp srv/motech/update-conf.sh /srv/motech/update-conf.sh
[ ! -z ${STOP_ACTIVEMQ} ] && service activemq stop
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# Register application
vmmgr register-app motech "${MOTECH_ADMIN_USER}" "${MOTECH_ADMIN_PWD}"
exit 0

View File

@ -23,4 +23,7 @@ rc-update -u
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# Register application
vmmgr register-app opendatakit-build
exit 0

View File

@ -36,7 +36,6 @@ export OPENDATAKIT_ADMIN_SALT=$(head -c 4 /dev/urandom | hexdump -e '"%x"') # Mu
export OPENDATAKIT_ADMIN_BASIC_HASH=$(echo -n "${OPENDATAKIT_ADMIN_PWD}{${OPENDATAKIT_ADMIN_SALT}}" | sha1sum | tr -d " -")
export OPENDATAKIT_ADMIN_DIGEST_HASH=$(echo -n "${OPENDATAKIT_ADMIN_USER}:${OPENDATAKIT_ADMIN_REALM}:${OPENDATAKIT_ADMIN_PWD}" | md5sum | tr -d " -")
envsubst <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 srv/opendatakit/update-conf.sh /srv/opendatakit/update-conf.sh
@ -44,4 +43,7 @@ cp srv/opendatakit/update-conf.sh /srv/opendatakit/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# Register application
vmmgr register-app opendatakit "${OPENDATAKIT_ADMIN_USER}" "${OPENDATAKIT_ADMIN_PWD}"
exit 0

View File

@ -10,10 +10,12 @@ mkdir -p /srv/openmapkit/conf /srv/openmapkit/data
chown -R 8007:8007 /srv/openmapkit/data
cp -rp /var/lib/lxc/openmapkit/openmapkit/srv/openmapkit/data/. /srv/openmapkit/data
envsubst <srv/openmapkit/conf/settings.js >/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

View File

@ -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 <adminpwd.sql | lxc-attach -u 5432 -g 5432 postgres -- psql pandora
vmmgr update-login pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}"
# Install service
cp etc/init.d/pandora /etc/init.d/pandora
@ -60,4 +59,7 @@ cp srv/pandora/update-conf.sh /srv/pandora/update-conf.sh
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
[ ! -z ${STOP_RABBITMQ} ] && service rabbitmq stop
# Register application
vmmgr register-app pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}"
exit 0

View File

@ -29,7 +29,6 @@ else
envsubst <masterUsers.csv >/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

View File

@ -26,7 +26,6 @@ export SAHANA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
envsubst <srv/sahana/conf/000_config.py >/srv/sahana/conf/000_config.py
envsubst <srv/sahana/data/Spotter/masterUsers.csv >/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

View File

@ -26,7 +26,6 @@ envsubst <masterUsers.csv >/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

View File

@ -25,7 +25,6 @@ export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export SEEDDMS_ADMIN_EMAIL=admin@example.com
envsubst <adminpwd.sql | lxc-attach -u 5432 -g 5432 postgres -- psql seeddms
chown -R 8010:8010 /srv/seeddms/conf
vmmgr update-login seeddms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}"
# Install cron job
cp etc/periodic/hourly/seeddms /etc/periodic/hourly/seeddms
@ -40,4 +39,7 @@ cp srv/seeddms/update-conf.sh /srv/seeddms/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# Register application
vmmgr register-app seeddms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}"
exit 0

View File

@ -35,7 +35,6 @@ sed -i "s|\$2a\$10\$pMcTA1p9fefR8U9NoOPei.H0eq/TbbdSF27M0tn9iDWBrA4JHeCDC|${SIGM
cat /tmp/sigmah-MinimumDataKit.sql | lxc-attach postgres -- sh -c "PGPASSWORD=${SIGMAH_PWD} psql -U sigmah sigmah"
cat /tmp/sigmah-newOrganizationLaunchScript.sql | lxc-attach postgres -- sh -c "PGPASSWORD=${SIGMAH_PWD} psql -U sigmah sigmah"
rm -f /tmp/sigmah-MinimumDataKit.sql /tmp/sigmah-newOrganizationLaunchScript.sql
vmmgr update-login sigmah "${SIGMAH_ADMIN_EMAIL}" "${SIGMAH_ADMIN_PWD}"
# Install service
cp etc/init.d/sigmah /etc/init.d/sigmah
@ -47,4 +46,7 @@ cp srv/sigmah/update-conf.sh /srv/sigmah/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
# Register application
vmmgr register-app sigmah "${SIGMAH_ADMIN_EMAIL}" "${SIGMAH_ADMIN_PWD}"
exit 0

View File

@ -24,7 +24,6 @@ export USHAHIDI_ADMIN_USER=admin@example.com
export USHAHIDI_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export USHAHIDI_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${USHAHIDI_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))")
envsubst <adminpwd.sql | lxc-attach mariadb -- mysql ushahidi
vmmgr update-login ushahidi "${USHAHIDI_ADMIN_USER}" "${USHAHIDI_ADMIN_PWD}"
# Install cron job
cp etc/periodic/15min/ushahidi /etc/periodic/15min/ushahidi
@ -39,4 +38,7 @@ cp srv/ushahidi/update-conf.sh /srv/ushahidi/update-conf.sh
# Stop services required for build
[ ! -z ${STOP_MARIADB} ] && service mariadb stop
# Register application
vmmgr register-app ushahidi "${USHAHIDI_ADMIN_USER}" "${USHAHIDI_ADMIN_PWD}"
exit 0