aboutsummaryrefslogtreecommitdiffstats
path: root/files/usr/local/bin/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'files/usr/local/bin/entrypoint.sh')
-rwxr-xr-xfiles/usr/local/bin/entrypoint.sh26
1 files changed, 15 insertions, 11 deletions
diff --git a/files/usr/local/bin/entrypoint.sh b/files/usr/local/bin/entrypoint.sh
index d1a1cc2..337e62a 100755
--- a/files/usr/local/bin/entrypoint.sh
+++ b/files/usr/local/bin/entrypoint.sh
@@ -1,23 +1,27 @@
#!/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/#ServerName www.example.com:80/ServerName $APACHE_SERVER_NAME/" /etc/apache2/httpd.conf
+sed -i "s/ServerAdmin\ you@example.com/ServerAdmin\ $ADMIN_MAIL/" /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
+sed -i "s/#APACHE_SERVER_NAME/$APACHE_SERVER_NAME/" /etc/apache2/conf.d/davical.conf
+
+echo -e "$APACHE_USERS" > /etc/apache2/davical.htpasswd
# 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
+sed -i "s/^;date.timezone =$/date.timezone = \"Europe\/Oslo\"/" /etc/php7/php.ini
+# Modify davicals config.php
+sed -i "s/#APACHE_SERVER_NAME/$APACHE_SERVER_NAME/" /var/www/app/config/config.php
+sed -i "s/#ADMIN_MAIL/$ADMIN_MAIL/" /var/www/app/config/config.php
+sed -i "s/#SYSTEM_NAME/$SYSTEM_NAME/" /var/www/app/config/config.php
+sed -i "s/#DATABASE_NAME/$DATABASE_NAME/" /var/www/app/config/config.php
+sed -i "s/#DATABASE_USER/$DATABASE_USER/" /var/www/app/config/config.php
+sed -i "s/#DATABASE_PORT/$DATABASE_PORT/" /var/www/app/config/config.php
+sed -i "s/#DATABASE_HOST/$DATABASE_HOST/" /var/www/app/config/config.php
+sed -i "s/#DATABASE_PASSWORD/$DATABASE_PASSWORD/" /var/www/app/config/config.php
# display logs
tail -F /var/log/apache2/*log &