Skip to content

bugfixes #16

Merged
merged 1 commit into from
Jun 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions configBuilder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ mkdir -p logs/shib-idp
# first, check for wget
command -v wget >/dev/null 2>&1 || { echo >&2 "ERROR: wget is required, but doesn't appear to be installed. Aborting..."; exit 1; }

wget -q -O ${TMP_DIR_S}.zip ${SHB_CFG_URL}
wget -q -O ${TMP_DIR_T}.zip ${TOM_CFG_URL}
wget -q -O ${TMP_DIR_S}.zip ${SHB_CFG_URL} > /dev/null
wget -q -O ${TMP_DIR_T}.zip ${TOM_CFG_URL} > /dev/null


######################
### expand to /tmp ###
######################
unzip -d ${TMP_DIR_S} ${TMP_DIR_S}.zip > /dev/null 2>&1
unzip -d ${TMP_DIR_T} ${TMP_DIR_T}.zip > /dev/null 2>&1
unzip -o -d ${TMP_DIR_S} ${TMP_DIR_S}.zip > /dev/null 2>&1
unzip -o -d ${TMP_DIR_T} ${TMP_DIR_T}.zip > /dev/null 2>&1

################################################################################
### cp relevant folders from expanded zip to appropriate locations at $PWD/* ###
Expand Down Expand Up @@ -387,7 +387,8 @@ ENTITYID=https://${FQDN}/idp/shibboleth/
BASEURL=https://${FQDN}

cat > ${SHBMD}/idp-metadata.xml <<EOF
<EntityDescriptor entityID="$ENTITYID" xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<EntityDescriptor entityID="$ENTITYID" xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:shibmd="urn:mace:shibboleth:metadata:1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<IDPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<Extensions>
<shibmd:Scope regexp="false">$SCOPE</shibmd:Scope>
</Extensions>
Expand Down Expand Up @@ -491,14 +492,19 @@ fi
sed "s#keystorePass=\"password\"#keystorePass=\"${STOREPWD}\"#" ${TOMCFG}/server.xml.dist > ${TOMCFG}/server.xml




echo ""
echo "Archiving generated config..."
echo ""
#ensure zip
command -v zip >/dev/null 2>&1 || { echo >&2 "ERROR: zip is required, but doesn't appear to be installed. Aborting..."; exit 1; }
FILENAME=./shib-idp-config_`date +%m%d%Y-%H%M%S`.zip
zip -r ${FILENAME} ./* > /dev/null

############################################################################################################################
### notify user of next steps (docker build and docker run commands, based on burn/mount and chosen directory locations) ###
############################################################################################################################
echo ""
echo "Your initial configuration has been successfully setup."
echo "Your initial configuration has been successfully setup. The entire configuration has been archived to ${PWD}/shib-idp-config_`date +%m%d%Y-%H%M%S`.zip"
echo ""
echo ""
if [ ${BURNMOUNT} == "burn" ]; then
Expand Down Expand Up @@ -545,7 +551,7 @@ else
echo "RUN"
echo " For a mounted config, you will need to supply your config locations at run-time, like this (assuming the default locations for the local config)."
echo ""
echo " docker run -d --name shib-test1 -p 8443:8443 -v /home/shibboleth/conf/tomcat-test:/usr/local/tomcat/conf \\
echo " docker run -d --name shib-test1 -p 8443:8443 -v ${PWD}/${TOMCFG}:/usr/local/tomcat/conf \\
-v ${PWD}/${TOMWWWROOT}:/usr/local/tomcat/webapps/ROOT \\
-v ${PWD}/${TOMLOG}:/usr/local/tomcat/logs \\
-v ${PWD}/${TOMCERT}:/opt/certs \\
Expand Down