From 4fbeae6f7e2ee6af9d92bc351f5198424feb03e7 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Wed, 5 Jun 2019 18:55:15 +0200 Subject: [PATCH] Sanitize all generated passwords --- lxc-apps/ckan/install.sh | 8 ++++---- lxc-apps/crisiscleanup/install.sh | 4 ++-- lxc-apps/cts/install.sh | 6 +++--- lxc-apps/ecogis/install.sh | 2 +- lxc-apps/frontlinesms/install.sh | 2 +- lxc-apps/gnuhealth/install.sh | 4 ++-- lxc-apps/kanboard/install.sh | 4 ++-- lxc-apps/mifosx/install.sh | 4 ++-- lxc-apps/motech/install.sh | 4 ++-- lxc-apps/odoo/install.sh | 4 ++-- lxc-apps/opendatakit-build/install.sh | 2 +- lxc-apps/opendatakit/install.sh | 4 ++-- lxc-apps/openmapkit/install.sh | 2 +- lxc-apps/pandora/install.sh | 6 +++--- lxc-apps/sahana-demo/install.sh | 6 +++--- lxc-apps/sahana/install.sh | 6 +++--- lxc-apps/sambro/install.sh | 6 +++--- lxc-apps/seeddms/install.sh | 4 ++-- lxc-apps/sigmah/install.sh | 4 ++-- lxc-apps/ushahidi/install.sh | 4 ++-- 20 files changed, 43 insertions(+), 43 deletions(-) diff --git a/lxc-apps/ckan/install.sh b/lxc-apps/ckan/install.sh index 18640fa..41e3d4a 100755 --- a/lxc-apps/ckan/install.sh +++ b/lxc-apps/ckan/install.sh @@ -9,8 +9,8 @@ cd $(realpath $(dirname "${0}"))/install [ ! -e /run/openrc/started/solr ] && service solr start && STOP_SOLR=1 # Create database -export CKAN_PWD=$(head -c 18 /dev/urandom | base64) -export CKAN_DS_PWD=$(head -c 18 /dev/urandom | base64) +export CKAN_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') +export CKAN_DS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') envsubst /srv/ckan/conf/ckan.ini cp srv/ckan/conf/who.ini /srv/ckan/conf/who.ini @@ -42,7 +42,7 @@ lxc-execute ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ export CKAN_ADMIN_USER="admin" export CKAN_ADMIN_UUID=$(cat /proc/sys/kernel/random/uuid) export CKAN_ADMIN_APIKEY=$(cat /proc/sys/kernel/random/uuid) -export CKAN_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) +export CKAN_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') 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.yml cp srv/crisiscleanup/conf/boot.rb /srv/crisiscleanup/conf/boot.rb cp srv/crisiscleanup/conf/initializers/devise.rb /srv/crisiscleanup/conf/initializers/devise.rb diff --git a/lxc-apps/cts/install.sh b/lxc-apps/cts/install.sh index a7132df..3856667 100755 --- a/lxc-apps/cts/install.sh +++ b/lxc-apps/cts/install.sh @@ -7,7 +7,7 @@ cd $(realpath $(dirname "${0}"))/install [ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1 # Create database -export CTS_PWD=$(head -c 18 /dev/urandom | base64) +export CTS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') envsubst /srv/cts/conf/spotter.py touch /srv/cts/conf/__init__.py @@ -29,7 +29,7 @@ lxc-execute cts -- manage.py migrate # Create admin account export CTS_ADMIN_EMAIL=admin@example.com -export CTS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) +export CTS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') 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 diff --git a/lxc-apps/gnuhealth/install.sh b/lxc-apps/gnuhealth/install.sh index 83c6b82..efba169 100755 --- a/lxc-apps/gnuhealth/install.sh +++ b/lxc-apps/gnuhealth/install.sh @@ -7,7 +7,7 @@ cd $(realpath $(dirname "${0}"))/install [ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1 # Create databases -export GNUHEALTH_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '/+=') +export GNUHEALTH_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') envsubst /srv/gnuhealth/conf/trytond.conf # Populate database export GNUHEALTH_ADMIN_USER="admin" -export GNUHEALTH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) +export GNUHEALTH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') 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 diff --git a/lxc-apps/kanboard/install.sh b/lxc-apps/kanboard/install.sh index 9a51485..dc33cae 100755 --- a/lxc-apps/kanboard/install.sh +++ b/lxc-apps/kanboard/install.sh @@ -7,7 +7,7 @@ cd $(realpath $(dirname "${0}"))/install [ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1 # Populate database -export KANBOARD_PWD=$(head -c 18 /dev/urandom | base64) +export KANBOARD_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') envsubst /srv/kanboard/conf/config.php export KANBOARD_ADMIN_USER=admin -export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) +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'))") envsubst /srv/odoo/conf/odoo.conf diff --git a/lxc-apps/opendatakit-build/install.sh b/lxc-apps/opendatakit-build/install.sh index 677174d..7795f7f 100755 --- a/lxc-apps/opendatakit-build/install.sh +++ b/lxc-apps/opendatakit-build/install.sh @@ -7,7 +7,7 @@ cd $(realpath $(dirname "${0}"))/install [ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1 # Create databases -export OPENDATAKITBUILD_PWD=$(head -c 18 /dev/urandom | base64) +export OPENDATAKITBUILD_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') envsubst /srv/sahana-demo/conf/000_config.py if [ ${TEMPLATE} == "default" ]; then envsubst /srv/sahana-demo/data/default/users/masterUsers.csv diff --git a/lxc-apps/sahana/install.sh b/lxc-apps/sahana/install.sh index a3cc5ac..dbf8342 100755 --- a/lxc-apps/sahana/install.sh +++ b/lxc-apps/sahana/install.sh @@ -7,7 +7,7 @@ cd $(realpath $(dirname "${0}"))/install [ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1 # Create PostgreSQL user and database -export SAHANA_PWD=$(head -c 18 /dev/urandom | base64) +export SAHANA_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') 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 diff --git a/lxc-apps/sambro/install.sh b/lxc-apps/sambro/install.sh index 4046a07..b884f6e 100755 --- a/lxc-apps/sambro/install.sh +++ b/lxc-apps/sambro/install.sh @@ -7,7 +7,7 @@ cd $(realpath $(dirname "${0}"))/install [ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1 # Create PostgreSQL user and database -export SAMBRO_PWD=$(head -c 18 /dev/urandom | base64) +export SAMBRO_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') envsubst /srv/sambro/conf/000_config.py mkdir -p /var/lib/lxc/sambro/sambro/srv/web2py/applications/eden/modules/templates/default/users envsubst /var/lib/lxc/sambro/sambro/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv diff --git a/lxc-apps/seeddms/install.sh b/lxc-apps/seeddms/install.sh index aa91696..48916ac 100755 --- a/lxc-apps/seeddms/install.sh +++ b/lxc-apps/seeddms/install.sh @@ -7,7 +7,7 @@ cd $(realpath $(dirname "${0}"))/install [ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1 # Populate database -export SEEDDMS_PWD=$(head -c 18 /dev/urandom | base64) +export SEEDDMS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') envsubst /srv/seeddms/conf/settings.xml export SEEDDMS_ADMIN_USER=admin -export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) +export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export SEEDDMS_ADMIN_EMAIL=admin@example.com envsubst