Skip to content

Commit

Permalink
Modified files to work with any domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Lareau committed Feb 26, 2020
1 parent de240ad commit 8ca774d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
./docker/db_data:/var/lib/postgresql/data
- ./docker/db_data:/var/lib/postgresql/data

app:
build:
Expand Down Expand Up @@ -51,7 +51,9 @@ services:
- media:/media
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
environment:
- DOMAIN
- CONTACT_EMAIL
tty: true

volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker/apacheShibForeground
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ chmod 600 /etc/shibboleth/sp-key.pem
chown _shibd:_shibd /etc/shibboleth/sp-*

service shibd start
certbot --apache -n --agree-tos --staging --email dlareau@cmu.edu --domains puzzlehunt.club.cc.cmu.edu
certbot --apache -n --agree-tos --staging --email $CONTACT_EMAIL --domains $DOMAIN
a2enmod ssl
service apache2 stop

Expand Down
10 changes: 5 additions & 5 deletions docker/configs/puzzlehunt_apache_shib.conf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<VirtualHost *:80>
ServerName puzzlehunt.club.cc.cmu.edu
ServerName ${DOMAIN}

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Redirect / https://puzzlehunt.club.cc.cmu.edu/
Redirect / https://${DOMAIN}/
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName puzzlehunt.club.cc.cmu.edu
ServerName ${DOMAIN}

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Expand Down Expand Up @@ -51,8 +51,8 @@
ProxyPassReverse / http://app:8000/
ProxyPreserveHost On

SSLCertificateFile /etc/letsencrypt/live/puzzlehunt.club.cc.cmu.edu/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/puzzlehunt.club.cc.cmu.edu/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/${DOMAIN}/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/${DOMAIN}/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
5 changes: 4 additions & 1 deletion sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ DJANGO_EMAIL_USER=email_user
DJANGO_EMAIL_PASSWORD=email_password

# DJANGO_ENABLE_DEBUG True
# DJANGO_USE_SHIBBOLETH True
# DJANGO_USE_SHIBBOLETH True

DOMAIN=puzzlehunt.club.cc.cmu.edu
CONTACT_EMAIL=dlareau@cmu.edu

0 comments on commit 8ca774d

Please sign in to comment.