From 01154a7d24ab8f75853135d63bc846f213c02b94 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 16 Sep 2017 14:38:50 +0200 Subject: [PATCH] Unify password creation methods, shorten admin passwords --- 02-sahana.sh | 2 +- 10-seeddms.sh | 2 +- 50-pandora.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/02-sahana.sh b/02-sahana.sh index 643a465..c51e5a2 100755 --- a/02-sahana.sh +++ b/02-sahana.sh @@ -33,7 +33,7 @@ export SAHANA_HMAC=$(head -c 18 /dev/urandom | base64) envsubst <${SOURCE_DIR}/sahana/srv/sahana/applications/eden/models/000_config.py >/srv/sahana/applications/eden/models/000_config.py cp ${SOURCE_DIR}/sahana/srv/sahana/applications/eden/modules/templates/default/config.py /srv/sahana/applications/eden/modules/templates/default/config.py export SAHANA_ADMIN_USER=admin@example.com -export SAHANA_ADMIN_PWD=$(head -c 18 /dev/urandom | base64) +export SAHANA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) envsubst <${SOURCE_DIR}/sahana/srv/sahana/applications/eden/modules/templates/default/users/masterUsers.csv >/srv/sahana/applications/eden/modules/templates/default/users/masterUsers.csv cp ${SOURCE_DIR}/sahana/srv/sahana/applications/eden/languages/cs.py /srv/sahana/applications/eden/languages/cs.py diff --git a/10-seeddms.sh b/10-seeddms.sh index 912e904..75b71f5 100755 --- a/10-seeddms.sh +++ b/10-seeddms.sh @@ -12,7 +12,7 @@ mv /srv/seeddms51x /srv/seeddms rm -f /srv/seeddms.tgz # Populate database -export SEEDDMS_PWD=$(head -c 260 /dev/urandom | tr -cd '[:alnum:]' | head -c 26) +export SEEDDMS_PWD=$(head -c 18 /dev/urandom | base64) envsubst <${SOURCE_DIR}/seeddms/tmp/seeddms-createdb.sql >/tmp/seeddms-createdb.sql sudo -u postgres psql -f /tmp/seeddms-createdb.sql rm -f /tmp/seeddms-createdb.sql diff --git a/50-pandora.sh b/50-pandora.sh index 1927401..f86cbdc 100755 --- a/50-pandora.sh +++ b/50-pandora.sh @@ -31,13 +31,13 @@ cd /srv/pandora/src/python-ox && /srv/pandora/bin/python setup.py develop /srv/pandora/bin/pip install -r /srv/pandora/requirements.txt # Create PostgreSQL user and database -export PANDORA_PWD=$(head -c 260 /dev/urandom | tr -cd '[:alnum:]' | head -c 26) +export PANDORA_PWD=$(head -c 18 /dev/urandom | base64) envsubst <${SOURCE_DIR}/pandora/tmp/pandora-createdb.sql >/tmp/pandora-createdb.sql sudo -u postgres psql -f /tmp/pandora-createdb.sql rm -f /tmp/pandora-createdb.sql # Configure RabbitMQ -export PANDORA_RABBIT_PWD=$(head -c 260 /dev/urandom | tr -cd '[:alnum:]' | head -c 26) +export PANDORA_RABBIT_PWD=$(head -c 18 /dev/urandom | base64) rabbitmqctl add_user pandora ${PANDORA_RABBIT_PWD} rabbitmqctl add_vhost /pandora rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*"