diff --git a/container_files/bin/configure_httpd.sh b/container_files/bin/configure_httpd.sh index c864f20..3f025b7 100755 --- a/container_files/bin/configure_httpd.sh +++ b/container_files/bin/configure_httpd.sh @@ -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 diff --git a/container_files/bin/configure_shibd.sh b/container_files/bin/configure_shibd.sh index fa698f4..a76961f 100755 --- a/container_files/bin/configure_shibd.sh +++ b/container_files/bin/configure_shibd.sh @@ -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 diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh index c778966..174489a 100755 --- a/container_files/bin/start.sh +++ b/container_files/bin/start.sh @@ -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 diff --git a/container_files/etc/shibboleth/shibboleth2.xml b/container_files/etc/shibboleth/shibboleth2.xml index ab4445c..3dd9a9b 100644 --- a/container_files/etc/shibboleth/shibboleth2.xml +++ b/container_files/etc/shibboleth/shibboleth2.xml @@ -5,13 +5,13 @@ xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" clockSkew="180"> - - + SAML2