start.sh 731 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. set -eu
  3. mkdir -p /app/data/public
  4. if [ ! -f "/app/data/public/index.html" ]; then
  5. cp /app/code/index.html /app/data/public/index.html
  6. fi
  7. if [ ! -f "/app/data/apache2-app.conf" ]; then
  8. cp /app/code/apache2-app.conf /app/data/apache2-app.conf
  9. fi
  10. sed -e "s@AuthLDAPURL .*@AuthLDAPURL ${LDAP_URL}/${LDAP_USERS_BASE_DN}?username??(objectclass=user)@" \
  11. -e "s@AuthLDAPBindDN .*@AuthLDAPBindDN ${LDAP_BIND_DN}@" \
  12. -e "s@AuthLDAPBindPassword .*@AuthLDAPBindPassword ${LDAP_BIND_PASSWORD}@" \
  13. -i /app/data/apache2-app.conf
  14. chown -R www-data:www-data /app/data /run/app
  15. echo "Starting apache"
  16. APACHE_CONFDIR="" source /etc/apache2/envvars
  17. rm -f "${APACHE_PID_FILE}"
  18. exec /usr/sbin/apache2 -DFOREGROUND