Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Merge pull request #8 from docker/comanageshib
Browse files Browse the repository at this point in the history
Added more control for configure shib and httpd.
  • Loading branch information
Jim Van Fleet committed Sep 15, 2016
2 parents 0af123a + 1be79b7 commit 8003b99
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
7 changes: 6 additions & 1 deletion container_files/bin/configure_httpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
log="/tmp/httpd.log"
date >> $log
echo "Configuring httpd: " >> $log

echo "Parsing COMANAGE_SERVER_FQDN to $COMANAGE_SERVER_FQDN in virtualhost 80 and 443" >> $log
sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_80.conf >> $log
sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
echo "virtualhost parsed" >> $log
if [[ $CHANGE_TO_SSL_HTTPD_KEY && ${CHANGE_TO_SSL_HTTPD_KEY-x} ]]; then
echo "Parsing CHANGE_TO_SSL_HTTPD_KEY to $CHANGE_TO_SSL_HTTPD_KEY in virtual host 443" >> $log
sed -i "s|CHANGE_TO_SSL_HTTPD_KEY|$CHANGE_TO_SSL_HTTPD_KEY|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
echo "key parsed in virtualhost 443" >> $log
else
echo "CHANGE_TO_SSL_HTTPD_KEY variable is not used" >> $log
fi
if [[ $CHANGE_TO_SSL_HTTPD_CERT && ${CHANGE_TO_SSL_HTTPD_CERT-x} ]]; then
echo "Parsing CHANGE_TO_SSL_HTTPD_CERT to $CHANGE_TO_SSL_HTTPD_CERT in virtualhost 443" >> $log
sed -i "s|CHANGE_TO_SSL_HTTPD_CERT|$CHANGE_TO_SSL_HTTPD_CERT|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
echo "httpd cert parsed in virtualhost 443" >> $log
else
echo "CHANGE_TO_SSL_HTTPD_CERT variable is not used" >> $log
fi
Expand Down
13 changes: 10 additions & 3 deletions container_files/bin/configure_shibd.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/bin/bash

log="/tmp/shibd.log"

date >> $log
echo "Configuring shibd: " > $log


if [[ $COMANAGE_SERVER_FQDN && ${COMANAGE_SERVER_FQDN-x} ]]; then
echo "Parsing COMANAGE_SERVER_FQDN to $COMANAGE_SERVER_FQDN in /etc/opt/shibboleth/shibboleth2.xml" >> $log
sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/shibboleth/shibboleth2.xml
echo "shibboleth2.xml parsed" >> $log
else
echo "Variable COMANAGE_SERVER_FQDN not found" >> $log
fi
echo "Shibboleth xml parsing finish" >> $log
date >> $log
18 changes: 15 additions & 3 deletions container_files/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,19 @@ else
echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" >> $log
echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error"
date >> $log
echo "Starting apache and shibd" >>$log
echo "Starting apache shibd"
/usr/local/bin/httpd-shib-foreground
/opt/bin/main.sh
laststatus="$?"
echo "main.sh last status: $laststatus"
if [ "$laststatus" != "0" ]; then
echo "composed non-zero exit status: $laststatus" >> $log
echo "composed non-zero exit status: $laststatus"
exit 1
else
date >> $log
echo "COmanage was configured" >>$log
echo "COmanage was configured"
echo "Starting apache and shibd" >>$log
echo "Starting apache shibd"
/usr/local/bin/httpd-shib-foreground
fi
fi
4 changes: 2 additions & 2 deletions container_files/etc/shibboleth/shibboleth2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
clockSkew="180">

<ApplicationDefaults entityID="https://CHANGE_TO_COMANAGE_SERVER_FQDN/shibboleth"
<ApplicationDefaults entityID="https://COMANAGE_SERVER_FQDN/shibboleth"
REMOTE_USER="eppn persistent-id targeted-id">

<Sessions lifetime="28800" timeout="3600" relayState="ss:mem"
checkAddress="false" handlerSSL="true" cookieProps="https">

<SSO discoveryProtocol="SAMLDS" discoveryURL="https://CHANGE_TO_COMANAGE_SERVER_FQDN/registry/pages/eds/index">
<SSO discoveryProtocol="SAMLDS" discoveryURL="https://COMANAGE_SERVER_FQDN/registry/pages/eds/index">
SAML2
</SSO>

Expand Down

0 comments on commit 8003b99

Please sign in to comment.