Fix sahana-demo admin creation

This commit is contained in:
Disassembler 2018-10-31 18:02:22 +01:00
parent 410958a2a7
commit 979060da69
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
2 changed files with 8 additions and 4 deletions

View File

@ -22,9 +22,13 @@ export SAHANADEMO_HMAC=$(head -c 18 /dev/urandom | base64)
export SAHANADEMO_ADMIN_USER=admin@example.com export SAHANADEMO_ADMIN_USER=admin@example.com
export SAHANADEMO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export SAHANADEMO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
envsubst <srv/sahana-demo/conf/000_config.py >/srv/sahana-demo/conf/000_config.py envsubst <srv/sahana-demo/conf/000_config.py >/srv/sahana-demo/conf/000_config.py
if [ ${TEMPLATE} == "default" ]; then
envsubst <masterUsers.csv >/srv/sahana-demo/data/default/users/masterUsers.csv
else
mkdir -p /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py/applications/eden/modules/templates/default/users mkdir -p /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py/applications/eden/modules/templates/default/users
chown -R 8001:8001 /var/lib/lxc/sahana-demo/sahana-demo/srv/web2py
envsubst <masterUsers.csv >/var/lib/lxc/sahana-demo/sahana-demo/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv 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}" vmmgr update-login sahana-demo "${SAHANADEMO_ADMIN_USER}" "${SAHANADEMO_ADMIN_PWD}"
# Replace template in LXC container mount definition # Replace template in LXC container mount definition

View File

@ -22,8 +22,8 @@ export SAMBRO_ADMIN_USER=admin@example.com
export SAMBRO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export SAMBRO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
envsubst <srv/sambro/conf/000_config.py >/srv/sambro/conf/000_config.py envsubst <srv/sambro/conf/000_config.py >/srv/sambro/conf/000_config.py
mkdir -p /var/lib/lxc/sambro/sambro/srv/web2py/applications/eden/modules/templates/default/users mkdir -p /var/lib/lxc/sambro/sambro/srv/web2py/applications/eden/modules/templates/default/users
chown -R 8001:8001 /var/lib/lxc/sambro/sambro/srv/web2py
envsubst <masterUsers.csv >/var/lib/lxc/sambro/sambro/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv envsubst <masterUsers.csv >/var/lib/lxc/sambro/sambro/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv
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/conf/00_settings.py /srv/sambro/conf/00_settings.py
cp srv/sambro/data/SAMBRO/config.py /srv/sambro/data/SAMBRO/config.py cp srv/sambro/data/SAMBRO/config.py /srv/sambro/data/SAMBRO/config.py
vmmgr update-login sambro "${SAMBRO_ADMIN_USER}" "${SAMBRO_ADMIN_PWD}" vmmgr update-login sambro "${SAMBRO_ADMIN_USER}" "${SAMBRO_ADMIN_PWD}"