forked from techservicesillinois/shib-in-a-box
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint-httpd.sh
executable file
·46 lines (40 loc) · 1.33 KB
/
entrypoint-httpd.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
# -----------------------------------------------------------------------------
#
# Edit shibboleth2.xml to put in the IP address of the container running shibd
# and start httpd in the foreground.
#
#
# FILES
#
# /etc/shibboleth/shibboleth2.xml
# Configuration file for mod_shib to be edited, setting
# the IP address of the container running shibd.
#
# /usr/local/apache2/conf/httpd.conf
# Configuration file for httpd to be edited. Edit will
# set the value of the ServerName directive.
#
# ENVIRONMENT
#
# APP_SERVER_NAME
# Name of the application server (the host name or
# virtual host name). Set in docker-compose.yml.
#
# SHIBD_ACL
# ACL for TCPListener. Set in docker-compose.yml.
#
# SHIBD_HOSTNAME
# Name of the container (host) running shibd. Set in
# docker-compose.yml.
#
# -----------------------------------------------------------------------------
set -e
SHIBD_IP=$(getent ahosts $SHIBD_HOSTNAME | awk 'NR==1{ print $1 }')
sed -i -e "s/SHIBD_IP/$SHIBD_IP/g" \
-e "s/SHIBD_ACL/$SHIBD_ACL/g" \
-e "s/APP_SERVER_NAME/$APP_SERVER_NAME/g" \
-e "s/SHIBD_IDP/$SHIBD_IDP/g" /etc/shibboleth/shibboleth2.xml
sed -i -e "s/APP_SERVER_NAME/$APP_SERVER_NAME/g" \
/usr/local/apache2/conf/httpd.conf
exec httpd -DFOREGROUND