-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
124 changed files
with
21,544 additions
and
1,995 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[run] | ||
command_line = | ||
manage.py test | ||
|
||
source = | ||
huntserver | ||
|
||
omit = | ||
*/tests/* | ||
*/migrations/* | ||
|
||
[paths] | ||
source = | ||
./huntserver | ||
/code/huntserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
max-line-length = 100 | ||
exclude = huntserver/migrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,39 @@ | ||
language: python | ||
|
||
python: | ||
- 2.7 | ||
- 3.4 | ||
- 3.5 | ||
- 3.6 | ||
|
||
services: | ||
- mysql | ||
- docker | ||
|
||
sudo: required | ||
|
||
env: | ||
- DJANGO=1.11.* DB=mysql | ||
|
||
global: | ||
- DB_NAME=puzzlehunt_db | ||
- DB_USER=hunt | ||
- DB_PASSWORD=test | ||
- DJANGO_SECRET_KEY=test_secret_key | ||
- DOCKER_COMPOSE_VERSION=1.23.2 | ||
|
||
before_install: | ||
- export DJANGO_SETTINGS_MODULE="puzzlehunt_server.settings.travis_settings" | ||
- sudo rm /usr/local/bin/docker-compose | ||
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | ||
- chmod +x docker-compose | ||
- sudo mv docker-compose /usr/local/bin | ||
|
||
install: | ||
- pip install -q Django==$DJANGO | ||
- pip install -r requirements.txt | ||
- pip install coveralls | ||
- pip freeze | ||
- mkdir -p ./media/puzzles | ||
|
||
before_script: | ||
- mysql -e 'create database puzzlehunt_db;' -u root | ||
- pip install coveralls flake8 | ||
- docker-compose build | ||
- docker-compose up -d | ||
|
||
script: | ||
- python manage.py test | ||
- docker-compose exec app coverage run | ||
- docker-compose exec app coverage report | ||
- flake8 huntserver | ||
|
||
after_script: | ||
- docker-compose stop | ||
- docker-compose rm -f | ||
|
||
after_success: | ||
- cp .coverage .coverage.extra | ||
- coverage combine | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM python:3.7 | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV DJANGO_ENABLE_DEBUG False | ||
ENV DJANGO_USE_SHIBBOLETH False | ||
ENV DJANGO_SETTINGS_MODULE puzzlehunt_server.settings.env_settings | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
|
||
COPY requirements.txt requirements.txt | ||
RUN pip install -r requirements.txt | ||
|
||
COPY . . | ||
|
||
EXPOSE 8000 | ||
CMD ["gunicorn", "--workers=5", "--bind=0.0.0.0:8000", "puzzlehunt_server.wsgi:application"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# An apache configuration file meant to be paired with puzzlehunt_setup.sh | ||
# Meant for quick developement. Does not do shibboleth or ssl. | ||
|
||
Define hostname replacename | ||
|
||
<VirtualHost *:80> | ||
ServerName ${hostname} | ||
|
||
ServerAdmin webmaster@localhost | ||
DocumentRoot /var/www/html | ||
Redirect / https://${hostname}/ | ||
</VirtualHost> | ||
|
||
<IfModule mod_ssl.c> | ||
<VirtualHost *:443> | ||
ServerName ${hostname} | ||
|
||
ServerAdmin webmaster@localhost | ||
DocumentRoot /var/www/html | ||
|
||
Alias /static /static | ||
<Directory /static> | ||
Require all granted | ||
</Directory> | ||
|
||
Alias /media /media | ||
XSendFile On | ||
XSendFilePath /media | ||
<Directory /media> | ||
Require all granted | ||
</Directory> | ||
<Directory /media/puzzles> | ||
Require all denied | ||
</Directory> | ||
|
||
ProxyPass /static/ ! | ||
ProxyPass /media/ ! | ||
|
||
<IfModule mod_shib.c> | ||
<Location /shib/> | ||
AuthType Shibboleth | ||
ShibRequireSession On | ||
ShibApplicationId default | ||
ShibExportAssertion On | ||
require valid-user | ||
</Location> | ||
|
||
<Location /Shibboleth.sso> | ||
Options +Indexes | ||
SetHandler shib | ||
</Location> | ||
|
||
ProxyPass /Shibboleth.sso/ ! | ||
</IfModule> | ||
|
||
ProxyPass / http://web:8000/ | ||
ProxyPreserveHost On | ||
|
||
</VirtualHost> | ||
|
||
</IfModule> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.