Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions dspace/src/main/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ with `mod_shib` & Shibboleth installed based on the
It is primarily for usage for testing DSpace's Shibboleth integration.
It uses https://samltest.id/ as the Shibboleth IDP

The SP key pair (`sp-key.pem`, `sp-cert.pem`) is created when a container starts for the first time,
so each container has its own. To keep a fixed key, mount both files into `/etc/shibboleth/`.
Apache's self-signed `ssl-cert-snakeoil` certificate is also created at the first start.

**This image is built manually.** It should be rebuilt as needed.

```
Expand Down
7 changes: 3 additions & 4 deletions dspace/src/main/docker/dspace-shibboleth/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ENV APACHE_PID_FILE=/var/run/apache2/apache2.pid
ENV APACHE_SERVER_NAME=localhost

# Ensure Apache2, mod_shib & shibboleth daemon are installed.
# Also install ssl-cert to provide a local SSL cert for use with Apache
# Also install ssl-cert to provide a local SSL cert for use with Apache (created at container start)
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apache2 \
Expand All @@ -30,7 +30,8 @@ RUN apt-get update \
libapache2-mod-shib2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
&& rm -rf /tmp/* \
&& rm -f /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/certs/ssl-cert-snakeoil.pem

# Setup Apache configs & enable mod-shib & dspace vhost
COPY dspace-vhost.conf /etc/apache2/sites-available/
Expand All @@ -41,8 +42,6 @@ RUN a2enmod ssl proxy proxy_ajp proxy_http shib && \
# Setup Shibboleth configs
COPY shibboleth2.xml /etc/shibboleth/
COPY attribute-map.xml /etc/shibboleth/
RUN cd /etc/shibboleth/ \
&& shib-keygen

# Copy over our startup script
COPY httpd-shibd-foreground.sh /usr/local/bin/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ set -e
# $APACHE_SERVER_NAME environment variable.
sed -i "s/\${APACHE_SERVER_NAME}/$APACHE_SERVER_NAME/g" /etc/shibboleth/shibboleth2.xml

# Create the SP key pair and the Apache test certificate on the first start, so no private key is in the image.
# Existing or mounted files are kept (-b makes shib-keygen skip them instead of failing).
shib-keygen -b -o /etc/shibboleth
DEBIAN_FRONTEND=noninteractive make-ssl-cert generate-default-snakeoil
if [ ! -s /etc/shibboleth/sp-key.pem ] || [ ! -s /etc/shibboleth/sp-cert.pem ]; then
echo "Both sp-key.pem and sp-cert.pem must exist in /etc/shibboleth." >&2
exit 1
fi

# Start the Shibboleth daemon
/etc/init.d/shibd start

Expand Down
Loading