Skip to content

Commit

Permalink
First attempt at shibboleth docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
dlareau committed Feb 24, 2020
1 parent 816fa0b commit 805b668
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
27 changes: 27 additions & 0 deletions docker/apacheShibDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM debian:10

RUN apt update
RUN apt install -y apache2 gnupg curl ntp
RUN cd /tmp
RUN curl --fail --remote-name https://pkg.switch.ch/switchaai/debian/dists/buster/main/binary-all/misc/switchaai-apt-source_1.0.0_all.deb
RUN apt install ./switchaai-apt-source_1.0.0_all.deb
RUN rm ./switchaai-apt-source_1.0.0_all.deb
RUN apt update
RUN apt install --install-recommends shibboleth
RUN apt install libapache2-mod-xsendfile libapache2-mod-shib
RUN a2enmod proxy proxy_http proxy_html xsendfile shib

RUN rm /etc/apache2/sites-enabled/*

COPY configs/puzzlehunt_apache.conf /etc/apache2/sites-available/puzzlehunt.conf
COPY configs/certs/sp-cert.pem /etc/shibboleth/sp-cert.pem
COPY configs/certs/sp-key.pem /etc/shibboleth/sp-key.pem
COPY configs/shibboleth2.xml /etc/shibboleth/shibboleth2.xml

RUN a2ensite puzzlehunt

RUN mkdir -p /static
RUN mkdir -p /media

ENTRYPOINT ["/usr/sbin/apache2ctl"]
CMD ["-D", "FOREGROUND"]
1 change: 1 addition & 0 deletions docker/configs/certs/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Put sp-key.pem and sp-cert.pem in this directory when deploying
4 changes: 3 additions & 1 deletion docker/configs/shibboleth2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
security of your site. Stealing sessions via cookie theft is much easier with this disabled.
-->
<Sessions lifetime="28800" timeout="3600" relayState="ss:mem"
checkAddress="false" handlerSSL="true" cookieProps="https">
checkAddress="false" handlerSSL="true"
handlerURL="https://puzzlehunt.club.cc.cmu.edu/Shibboleth.sso"
cookieProps="; domain=puzzlehunt.club.cc.cmu.edu; path=/; secure">

<!--
Configures SSO for a default IdP. To allow for >1 IdP, remove
Expand Down
14 changes: 14 additions & 0 deletions docker/mysql_override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'

services:
db:
image: mariadb
environment:
MYSQL_DATABASE: puzzlehunt_db
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}

app:
environment:
- DATABASE_URL=mysql://${DB_USER}:${DB_PASSWORD}@db/puzzlehunt_db
3 changes: 3 additions & 0 deletions docker/shib_override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
web:
build:
dockerfile: apacheShibDockerfile

0 comments on commit 805b668

Please sign in to comment.