From bb62ee191472adfff77e110d77fe6eafbf0a9b65 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Thu, 7 Feb 2019 23:00:29 +0100 Subject: Initial commit --- files/usr/local/bin/entrypoint.sh | 30 ++++++++++++++++++++++++++++++ files/var/www/app/config.php | 13 +++++++++++++ 2 files changed, 43 insertions(+) create mode 100755 files/usr/local/bin/entrypoint.sh create mode 100644 files/var/www/app/config.php (limited to 'files') diff --git a/files/usr/local/bin/entrypoint.sh b/files/usr/local/bin/entrypoint.sh new file mode 100755 index 0000000..d1a1cc2 --- /dev/null +++ b/files/usr/local/bin/entrypoint.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# Apache server name change +if [ ! -z "$APACHE_SERVER_NAME" ] + then + sed -i "s/#ServerName www.example.com:80/ServerName $APACHE_SERVER_NAME/" /etc/apache2/httpd.conf + echo "Changed server name to '$APACHE_SERVER_NAME'..." + else + echo "NOTICE: Change 'ServerName' globally and hide server message by setting environment variable >> 'APACHE_SERVER_NAME=your.server.name' in docker command or docker-compose file" +fi + +# Change apache config +sed -i 's/ServerAdmin\ you@example.com/ServerAdmin\ you@example.com/' /etc/apache2/httpd.conf +sed -i 's/ServerSignature On/ServerSignature Off/' /etc/apache2/httpd.conf +sed -i 's#/var/www/localhost/htdocs#/var/www/app/htdocs#g' /etc/apache2/httpd.conf + +# Modify php.ini settings +sed -i 's/memory_limit = .*/memory_limit = 256M/' /etc/php7/php.ini +sed -i "s/^;date.timezone =$/date.timezone = \"Europe\/Stockholm\"/" /etc/php7/php.ini + + +# display logs +tail -F /var/log/apache2/*log & + +echo "Clearing any old processes..." +rm -f /run/apache2/apache2.pid +rm -f /run/apache2/httpd.pid + +echo "Starting apache..." +httpd -D FOREGROUND diff --git a/files/var/www/app/config.php b/files/var/www/app/config.php new file mode 100644 index 0000000..f25f096 --- /dev/null +++ b/files/var/www/app/config.php @@ -0,0 +1,13 @@ +domain_name = "davical.eriksen.im"; + $c->sysabbr = 'DAViCal'; + $c->admin_email = 'dennis@eriksen.im'; + $c->system_name = "Eriksens DAViCal Server"; + $c->pg_connect[] = 'dbname=davical port=5432 user=davical_app'; + +/* + * Use Apache-supplied headers and believe them + */ + + $c->authenticate_hook['server_auth_type'] = 'Basic'; + include_once('AuthPlugins.php'); -- cgit v1.2.3