summaryrefslogtreecommitdiff
path: root/idp/shib-entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'idp/shib-entrypoint.sh')
-rwxr-xr-xidp/shib-entrypoint.sh31
1 files changed, 28 insertions, 3 deletions
diff --git a/idp/shib-entrypoint.sh b/idp/shib-entrypoint.sh
index 56ce16c..a1dc327 100755
--- a/idp/shib-entrypoint.sh
+++ b/idp/shib-entrypoint.sh
@@ -65,13 +65,37 @@ if [ -f ${DATADIR}/credentials/idp-signing.key -a -f ${DATADIR}/credentials/idp-
cp ${DATADIR}/credentials/idp-signing.key /opt/shibboleth-idp/credentials/idp-signing.key
cp ${DATADIR}/credentials/idp-signing.crt /opt/shibboleth-idp/credentials/idp-signing.crt
fi
+# overwrite encryption keys if present
+if [ -f ${DATADIR}/credentials/idp-encryption.key -a -f ${DATADIR}/credentials/idp-encryption.crt ]; then
+ cp ${DATADIR}/credentials/idp-encryption.key /opt/shibboleth-idp/credentials/idp-encryption.key
+ cp ${DATADIR}/credentials/idp-encryption.crt /opt/shibboleth-idp/credentials/idp-encryption.crt
+fi
+
+# overwrite idp-metadata if present
+if [ -f ${DATADIR}/idp-metadata.xml.xml ]; then
+ cp ${DATADIR}/idp-metadata.xml /opt/shibboleth-idp/metadata/
+fi
if [ -e ${DATADIR}/messages ]; then
cp $DATADIR/messages/* /opt/shibboleth-idp/messages/
fi
-if [ $IDP_DEBUG ]; then
- sed -i -e '/idp.loglevel.messages/ s/INFO/DEBUG/' -e '/idp.loglevel.encryption/ s/INFO/DEBUG/' /opt/shibboleth-idp/conf/logback.xml
+# SP add
+if [ -e ${DATADIR}/sp-metadata ]; then
+ cp ${DATADIR}/sp-metadata/*.xml /opt/shibboleth-idp/metadata/
+ for sp_file in ${DATADIR}/sp-metadata/*.xml; do
+ SP_XML=$(basename "$sp_file")
+ SP_NAME=${SP_XML%.*}
+ ENTITY_ID=$(grep -o 'entityID=".*"' "$sp_file" | sed -e 's/entityID="//' -e 's/".*$//')
+
+ if ! grep "$SP_XML" /opt/shibboleth-idp/conf/metadata-providers.xml ; then
+ sed -i '/<!-- local SPs -->/r /opt/templates/config/sp.xml.add' /opt/shibboleth-idp/conf/metadata-providers.xml
+ sed -i -e "s/SP_NAME/$SP_NAME/" -e "s/SP_XML/$SP_XML/" /opt/shibboleth-idp/conf/metadata-providers.xml
+
+ # Release attributes
+ sed -i "/<!-- local SPs -->/a <Rule xsi:type=\"Requester\" value=\"$ENTITY_ID\" />" /opt/shibboleth-idp/conf/attribute-filter.xml
+ fi
+ done
fi
# Styling/view properties
@@ -82,4 +106,5 @@ if [ -n "$IDP_FOOTER" ]; then
fi
fi
-/docker-entrypoint.sh java -jar /usr/local/jetty/start.jar $JAVA_OPTIONS
+# Start jetty
+/docker-entrypoint.sh java -jar /usr/local/jetty/start.jar