Fix Pandora admin hash generator

This commit is contained in:
Disassembler 2018-09-19 17:04:42 +02:00
parent 0a30deb7e2
commit 33a4c10f7a
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499

View File

@ -45,7 +45,7 @@ lxc-execute pandora -- /srv/pandora/pandora/manage.py sync_documentsort
export PANDORA_ADMIN_USER=admin
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=pandora.settings python3 -c \"from django.contrib.auth.hashers import make_password; print(make_password('${PANDORA_ADMIN_PWD}'))\"")
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 <${SOURCE_DIR}/adminpwd.sql | lxc-attach -u 5432 -g 5432 postgres -- psql pandora
vmmgr update-login pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}"