Define custom props during application installation

This commit is contained in:
Disassembler 2020-04-10 11:21:39 +02:00
parent 09a146b54c
commit 0028a3ba5b
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
17 changed files with 39 additions and 18 deletions

@ -1 +1 @@
Subproject commit a61009d342edd66b2302e3bb47519f308c4117a4 Subproject commit 2ae06a4e4741b4c443b71dab59eba3abcec4ba2b

View File

@ -80,3 +80,5 @@ spoc-container stop ckan-redis
# Register application # Register application
vmmgr register-app ckan ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}" 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 ""

View File

@ -42,3 +42,5 @@ spoc-container stop crisiscleanup-postgres
# Register application # Register application
vmmgr register-app crisiscleanup cc "${CRISISCLEANUP_ADMIN_EMAIL}" "${CRISISCLEANUP_ADMIN_PWD}" 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 ""

View File

@ -31,7 +31,7 @@ install -o 100000 -g 108080 -m 640 /dev/null ${CTS_CONF}/__init__.py
spoc-container exec cts -- manage.py migrate spoc-container exec cts -- manage.py migrate
# Create admin account # Create admin account
export CTS_ADMIN_EMAIL=admin@example.com export CTS_ADMIN_EMAIL="admin@example.com"
export CTS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export CTS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export CTS_ADMIN_HASH=$(spoc-container exec cts -- python -c "from django.contrib.auth.hashers import make_password; print make_password('${CTS_ADMIN_PWD}')") export CTS_ADMIN_HASH=$(spoc-container exec 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 -c0-12) export CTS_ADMIN_SECRET=$(head -c 12 /dev/urandom | sha256sum | cut -c0-12)
@ -42,3 +42,4 @@ spoc-container stop cts-postgres
# Register application # Register application
vmmgr register-app cts cts "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}" vmmgr register-app cts cts "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}"
vmmgr register-prop cts email "${CTS_ADMIN_EMAIL}"

View File

@ -35,7 +35,7 @@ envsubst <decidim_conf/application.yml | install -o 108080 -g 108080 -m 640 /dev
spoc-container exec -u 8080 -g 8080 decidim -- sh -c 'cd /srv/decidim-app; bin/rails db:migrate' spoc-container exec -u 8080 -g 8080 decidim -- sh -c 'cd /srv/decidim-app; bin/rails db:migrate'
# Create admin account # Create admin account
export DECIDIM_ADMIN_EMAIL=admin@example.com export DECIDIM_ADMIN_EMAIL="admin@example.com"
export DECIDIM_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export DECIDIM_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
envsubst <adminpwd.rb | spoc-container exec -u 8080 -g 8080 decidim -- sh -c 'cd /srv/decidim-app; bin/rails console -e production' envsubst <adminpwd.rb | spoc-container exec -u 8080 -g 8080 decidim -- sh -c 'cd /srv/decidim-app; bin/rails console -e production'

View File

@ -36,3 +36,4 @@ spoc-container stop gnuhealth-postgres
# Register application # Register application
vmmgr register-app gnuhealth gh "${GNUHEALTH_ADMIN_USER}" "${GNUHEALTH_ADMIN_PWD}" vmmgr register-app gnuhealth gh "${GNUHEALTH_ADMIN_USER}" "${GNUHEALTH_ADMIN_PWD}"
vmmgr register-prop gnuhealth email "${GNUHEALTH_ADMIN_EMAIL}"

View File

@ -26,7 +26,7 @@ envsubst <createdb.sql | spoc-container exec kanboard-postgres -- psql
spoc-container exec kanboard -- cat /srv/kanboard/app/Schema/Sql/postgres.sql | spoc-container exec kanboard-postgres -- sh -c "PGPASSWORD=${KANBOARD_PWD} psql kanboard kanboard" spoc-container exec kanboard -- cat /srv/kanboard/app/Schema/Sql/postgres.sql | spoc-container exec kanboard-postgres -- sh -c "PGPASSWORD=${KANBOARD_PWD} psql kanboard kanboard"
# Create admin account # Create admin account
export KANBOARD_ADMIN_USER=admin export KANBOARD_ADMIN_USER="admin"
export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export KANBOARD_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${KANBOARD_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))") export KANBOARD_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${KANBOARD_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))")
envsubst <adminpwd.sql | spoc-container exec kanboard-postgres -- psql kanboard envsubst <adminpwd.sql | spoc-container exec kanboard-postgres -- psql kanboard
@ -36,3 +36,4 @@ spoc-container stop kanboard-postgres
# Register application # Register application
vmmgr register-app kanboard kb "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_PWD}" vmmgr register-app kanboard kb "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_PWD}"
vmmgr register-prop kanboard email "admin@example.com"

View File

@ -37,8 +37,8 @@ spoc-container stop mifosx
echo 'ALTER TABLE `scheduled_email_campaign` ADD `previous_run_status` VARCHAR(10) NULL;' | spoc-container exec mifosx-mariadb -- mysql mifostenant-default echo 'ALTER TABLE `scheduled_email_campaign` ADD `previous_run_status` VARCHAR(10) NULL;' | spoc-container exec mifosx-mariadb -- mysql mifostenant-default
# Update admin account # Update admin account
export MIFOSX_ADMIN_USER=admin export MIFOSX_ADMIN_USER="admin"
export MIFOSX_ADMIN_EMAIL=admin@example.com export MIFOSX_ADMIN_EMAIL="admin@example.com"
export MIFOSX_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') 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}') export MIFOSX_ADMIN_HASH=$(echo -n "${MIFOSX_ADMIN_PWD}{1}" | sha256sum | awk '{print $1}')
envsubst <adminpwd.sql | spoc-container exec mifosx-mariadb -- mysql mifostenant-default envsubst <adminpwd.sql | spoc-container exec mifosx-mariadb -- mysql mifostenant-default
@ -48,3 +48,4 @@ spoc-container stop mifosx-mariadb
# Register application # Register application
vmmgr register-app mifosx mifosx "${MIFOSX_ADMIN_USER}" "${MIFOSX_ADMIN_PWD}" vmmgr register-app mifosx mifosx "${MIFOSX_ADMIN_USER}" "${MIFOSX_ADMIN_PWD}"
vmmgr register-prop mifosx email "${MIFOSX_ADMIN_EMAIL}"

View File

@ -42,3 +42,4 @@ spoc-container stop odoo-postgres
# Register application # Register application
vmmgr register-app odoo odoo "${ODOO_ADMIN_USER}" "${ODOO_ADMIN_PWD}" vmmgr register-app odoo odoo "${ODOO_ADMIN_USER}" "${ODOO_ADMIN_PWD}"
vmmgr register-prop odoo email "admin@example.com"

View File

@ -21,8 +21,8 @@ spoc-container start opendatakit-postgres
envsubst <createdb.sql | spoc-container exec opendatakit-postgres -- psql envsubst <createdb.sql | spoc-container exec opendatakit-postgres -- psql
# Configure OpenDataKit # Configure OpenDataKit
export OPENDATAKIT_ADMIN_USER=admin export OPENDATAKIT_ADMIN_USER="admin"
export OPENDATAKIT_ADMIN_REALM=spotter export OPENDATAKIT_ADMIN_REALM="spotter"
install -o 108080 -g 108080 -m 750 -d ${ODK_CONF} install -o 108080 -g 108080 -m 750 -d ${ODK_CONF}
envsubst <odk_conf/jdbc.properties | install -o 108080 -g 108080 -m 640 /dev/stdin ${ODK_CONF}/jdbc.properties envsubst <odk_conf/jdbc.properties | install -o 108080 -g 108080 -m 640 /dev/stdin ${ODK_CONF}/jdbc.properties
envsubst <odk_conf/security.properties | install -o 108080 -g 108080 -m 640 /dev/stdin ${ODK_CONF}/security.properties envsubst <odk_conf/security.properties | install -o 108080 -g 108080 -m 640 /dev/stdin ${ODK_CONF}/security.properties

View File

@ -44,8 +44,8 @@ spoc-container exec pandora -- /srv/pandora/pandora/manage.py sync_itemsort
spoc-container exec pandora -- /srv/pandora/pandora/manage.py sync_documentsort spoc-container exec pandora -- /srv/pandora/pandora/manage.py sync_documentsort
# Create admin account # Create admin account
export PANDORA_ADMIN_USER=admin export PANDORA_ADMIN_USER="admin"
export PANDORA_ADMIN_EMAIL=admin@example.com export PANDORA_ADMIN_EMAIL="admin@example.com"
export PANDORA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export PANDORA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export PANDORA_ADMIN_HASH=$(spoc-container exec pandora -- sh -c "cd /srv/pandora && DJANGO_SETTINGS_MODULE=pandora.settings python3 -c \"from django.contrib.auth.hashers import make_password; print(make_password('${PANDORA_ADMIN_PWD}'))\"") export PANDORA_ADMIN_HASH=$(spoc-container exec pandora -- sh -c "cd /srv/pandora && DJANGO_SETTINGS_MODULE=pandora.settings python3 -c \"from django.contrib.auth.hashers import make_password; print(make_password('${PANDORA_ADMIN_PWD}'))\"")
envsubst <adminpwd.sql | spoc-container exec pandora-postgres -- psql pandora envsubst <adminpwd.sql | spoc-container exec pandora-postgres -- psql pandora
@ -56,3 +56,4 @@ spoc-container stop pandora-rabbitmq
# Register application # Register application
vmmgr register-app pandora pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}" vmmgr register-app pandora pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}"
vmmgr register-prop pandora gmaps-api-key ""

View File

@ -27,7 +27,7 @@ cp -rp ${SAHANA_LAYER}/srv/web2py/applications/eden/modules/templates/default ${
# Configure Sahana # Configure Sahana
export SAHANADEMO_HMAC=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') export SAHANADEMO_HMAC=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
export SAHANADEMO_ADMIN_USER=admin@example.com export SAHANADEMO_ADMIN_USER="admin@example.com"
export SAHANADEMO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export SAHANADEMO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
envsubst <sahana_conf/000_config.py | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_CONF}/000_config.py envsubst <sahana_conf/000_config.py | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_CONF}/000_config.py
envsubst <masterUsers.csv | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_DATA}/default/users/masterUsers.csv envsubst <masterUsers.csv | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_DATA}/default/users/masterUsers.csv
@ -47,3 +47,5 @@ spoc-container stop sahana-demo-postgres
# Register application # Register application
vmmgr register-app sahana-demo sahana-demo "${SAHANADEMO_ADMIN_USER}" "${SAHANADEMO_ADMIN_PWD}" 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 ""

View File

@ -31,7 +31,7 @@ chown -R 108080:108080 ${SAHANA_DATA}/Spotter
# Configure Sahana # Configure Sahana
export SAHANA_HMAC=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') export SAHANA_HMAC=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
export SAHANA_ADMIN_USER=admin@example.com export SAHANA_ADMIN_USER="admin@example.com"
export SAHANA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export SAHANA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
envsubst <sahana_conf/000_config.py | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_CONF}/000_config.py envsubst <sahana_conf/000_config.py | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_CONF}/000_config.py
envsubst <sahana_data/Spotter/masterUsers.csv | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_DATA}/Spotter/masterUsers.csv envsubst <sahana_data/Spotter/masterUsers.csv | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_DATA}/Spotter/masterUsers.csv
@ -52,3 +52,5 @@ spoc-container stop sahana-postgres
# Register application # Register application
vmmgr register-app sahana sahana "${SAHANA_ADMIN_USER}" "${SAHANA_ADMIN_PWD}" 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 ""

View File

@ -28,7 +28,7 @@ cp -rp ${SAHANA_LAYER}/srv/web2py/applications/eden/modules/templates/SAMBRO ${S
# Configure SAMBRO # Configure SAMBRO
export SAMBRO_HMAC=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') export SAMBRO_HMAC=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
export SAMBRO_ADMIN_USER=admin@example.com export SAMBRO_ADMIN_USER="admin@example.com"
export SAMBRO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export SAMBRO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
envsubst <sahana_conf/000_config.py | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_CONF}/000_config.py envsubst <sahana_conf/000_config.py | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_CONF}/000_config.py
envsubst <sahana_data/masterUsers.csv | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_DATA}/masterUsers.csv envsubst <sahana_data/masterUsers.csv | install -o 108080 -g 108080 -m 640 /dev/stdin ${SAHANA_DATA}/masterUsers.csv
@ -50,3 +50,5 @@ spoc-container stop sambro-postgres
# Register application # Register application
vmmgr register-app sambro sambro "${SAMBRO_ADMIN_USER}" "${SAMBRO_ADMIN_PWD}" 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 ""

View File

@ -28,9 +28,9 @@ cat custom.sql | spoc-container exec seeddms-postgres -- psql seeddms
# Configure SeedDMS # Configure SeedDMS
envsubst <seeddms_conf/settings.xml | install -o 108080 -g 108080 -m 640 /dev/stdin ${SEEDDMS_CONF}/settings.xml envsubst <seeddms_conf/settings.xml | install -o 108080 -g 108080 -m 640 /dev/stdin ${SEEDDMS_CONF}/settings.xml
export SEEDDMS_ADMIN_USER=admin export SEEDDMS_ADMIN_USER="admin"
export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export SEEDDMS_ADMIN_EMAIL=admin@example.com export SEEDDMS_ADMIN_EMAIL="admin@example.com"
envsubst <adminpwd.sql | spoc-container exec seeddms-postgres -- psql seeddms envsubst <adminpwd.sql | spoc-container exec seeddms-postgres -- psql seeddms
# Stop services required for setup # Stop services required for setup
@ -38,3 +38,4 @@ spoc-container stop seeddms-postgres
# Register application # Register application
vmmgr register-app seeddms dms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}" vmmgr register-app seeddms dms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}"
vmmgr register-prop seeddms email "${SEEDDMS_ADMIN_EMAIL}"

View File

@ -30,8 +30,8 @@ install -o 108080 -g 108080 -m 640 sigmah_conf/sigmah.properties ${SIGMAH_CONF}/
cp -p ${SIGMAH_LAYER}/srv/tomcat/webapps/sigmah/sigmah/images/header/org-default-logo.png ${SIGMAH_DATA}/files/logo.png cp -p ${SIGMAH_LAYER}/srv/tomcat/webapps/sigmah/sigmah/images/header/org-default-logo.png ${SIGMAH_DATA}/files/logo.png
# Populate database # Populate database
export SIGMAH_ADMIN_USER=Admin export SIGMAH_ADMIN_USER="Admin"
export SIGMAH_ADMIN_EMAIL=admin@example.com export SIGMAH_ADMIN_EMAIL="admin@example.com"
export SIGMAH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export SIGMAH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export SIGMAH_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${SIGMAH_ADMIN_PWD}'.encode(), bcrypt.gensalt(prefix=b'2a')).decode())") export SIGMAH_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${SIGMAH_ADMIN_PWD}'.encode(), bcrypt.gensalt(prefix=b'2a')).decode())")
cat ${SIGMAH_LAYER}/srv/sigmah-MinimumDataKit.sql | spoc-container exec sigmah-postgres -- sh -c "PGPASSWORD=${SIGMAH_PWD} psql -U sigmah sigmah" cat ${SIGMAH_LAYER}/srv/sigmah-MinimumDataKit.sql | spoc-container exec sigmah-postgres -- sh -c "PGPASSWORD=${SIGMAH_PWD} psql -U sigmah sigmah"
@ -50,3 +50,5 @@ spoc-container stop sigmah-postgres
# Register application # Register application
vmmgr register-app sigmah sigmah "${SIGMAH_ADMIN_EMAIL}" "${SIGMAH_ADMIN_PWD}" 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 ""

View File

@ -39,7 +39,7 @@ spoc-container exec ushahidi -- sh -c 'cd /srv/ushahidi/platform; php artisan pa
spoc-container exec ushahidi -- sh -c 'cd /srv/ushahidi/platform; php artisan migrate' spoc-container exec ushahidi -- sh -c 'cd /srv/ushahidi/platform; php artisan migrate'
# Create admin account # Create admin account
export USHAHIDI_ADMIN_USER=admin@example.com export USHAHIDI_ADMIN_USER="admin@example.com"
export USHAHIDI_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export USHAHIDI_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export USHAHIDI_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${USHAHIDI_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))") export USHAHIDI_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${USHAHIDI_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))")
envsubst <adminpwd.sql | spoc-container exec ushahidi-mariadb -- mysql ushahidi envsubst <adminpwd.sql | spoc-container exec ushahidi-mariadb -- mysql ushahidi
@ -50,3 +50,5 @@ spoc-container stop ushahidi-mariadb
# Register application # Register application
vmmgr register-app ushahidi ush "${USHAHIDI_ADMIN_USER}" "${USHAHIDI_ADMIN_PWD}" 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 ""