sahana-eden/sahana/image.d/entrypoint.sh

30 lines
755 B
Bash
Raw Normal View History

2022-03-06 10:59:23 +01:00
#!/bin/sh
set -e
if [ "$*" != "" ]; then
exec $@
fi
echo "Starting Sahana Eden..."
2022-03-08 12:01:01 +01:00
# Fix volume permissions
chown -R sahana:sahana \
/srv/web2py/applications/eden/databases \
/srv/web2py/applications/eden/errors \
/srv/web2py/applications/eden/sessions \
/srv/web2py/applications/eden/uploads
2022-03-06 14:43:47 +01:00
# Create admin user CSV template
cat <<EOF >/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv
First Name,Last Name,Email,Password,Role,Organisation
2022-03-06 17:38:38 +01:00
Admin,User,${SAHANA_ADMIN_USER:-admin},${SAHANA_ADMIN_PASSWORD:-admin},ADMIN,
2022-03-06 14:43:47 +01:00
EOF
unset SAHANA_ADMIN_USER
unset SAHANA_ADMIN_PASSWORD
# Populate or upgrade database
2022-03-06 10:59:23 +01:00
/usr/local/bin/migrate norestart
# Exec into s6 supervisor
exec /bin/s6-svscan /etc/services.d