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

30 lines
755 B
Bash
Executable File

#!/bin/sh
set -e
if [ "$*" != "" ]; then
exec $@
fi
echo "Starting Sahana Eden..."
# 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
# 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
Admin,User,${SAHANA_ADMIN_USER:-admin},${SAHANA_ADMIN_PASSWORD:-admin},ADMIN,
EOF
unset SAHANA_ADMIN_USER
unset SAHANA_ADMIN_PASSWORD
# Populate or upgrade database
/usr/local/bin/migrate norestart
# Exec into s6 supervisor
exec /bin/s6-svscan /etc/services.d