Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/dlareau/puzzlehunt_s…
Browse files Browse the repository at this point in the history
…erver into development
  • Loading branch information
dlareau committed Mar 30, 2018
2 parents 182a29c + fd5cc22 commit 064c306
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 27 deletions.
24 changes: 1 addition & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
# puzzlehunt_server
Server for Puzzlehunt CMU's bi-annual puzzlehunt. Includes basic features such as per-puzzle pages, automatic answer response, teams, customizable unlocking structure, and admin pages to manange submissions, teams, as well as hunt progress. It also includes automatic team creation from registration, privacy settings for hunts, cool charts, a built in chat, and automatic file fetching and hosting.

System packages:
* python 2.7
* mysql-client
* mysql-server
* python-mysqldb
* python-dev
* libmysqlclient-dev

See requirements.txt for Python requirements

Database setup details:
* expects a pre-existing empty database named puzzlehunt_db
* Database settings are in puzzlehunt_server/secret_settings.py the example used below has the following settings:
a user named ```hunt``` on domain ```localhost``` with password ```wrongbaa``` with access to ```puzzlehunt_db```. Production values should be different.
* The above can be accomplished by running the following commands as a superuser:
* ```CREATE DATABASE puzzlehunt_db;```
* ```CREATE USER 'hunt'@'localhost' IDENTIFIED BY 'wrongbaa';```
* ```GRANT ALL PRIVILEGES ON puzzlehunt_db.* TO 'hunt'@'localhost' WITH GRANT OPTION;```
* run ```python manage.py migrate``` to have django configure the database

Project Details:
* The django project is named ```puzzlehunt_server``` amd the app is named ```huntserver```
* Documentation (a work in progress) can be found at docs.puzzlehunt.club
Documentation can be found at http://docs.puzzlehunt.club

While there is fairly large amount of configuration making this specific to Puzzlehunt CMU, if you are interested in getting this running elsewhere, let me know. I'd be happy to help anyone who wants to get this up and running for their needs.

Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Changelog
Version 3
*********

v3.1.1
======

Updates:
- Updated documentation to include instructions for hunt asset files

v3.1.0
======

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# The short X.Y version.
version = 'v3.1'
# The full version, including alpha/beta/rc tags.
release = 'v3.1.0'
release = 'v3.1.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
17 changes: 14 additions & 3 deletions docs/hunt_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ The following context will be passed to the renderer for use in the template: ``

**While you may use completely custom HTML, it is STRONGLY RECOMMENDED that you follow the instructions below on how to inherit the base template to get nice features like the header bar, common style sheets, google analytics, and graceful degradation when the hunt becomes public.**

A note about static files
-------------------------

As of version ``3.0.0``, in order to reduce repository clutter, it is now against policy to commit files specific to a certain hunt to the respository. This means that you are no longer allowed to put images, fonts, and other files in ``/huntserver/static`` or ``/static``. To still allow the use of new static files in each hunt, a new object class has been created called "Hunt Asset Files". This class allows uploading of assets from the web interface, removing the need to interact with the hosting server directly.

To upload a new asset file, navigate to ``{server URL}/admin/huntserver/huntassetfile/`` and click the blue "Add hunt asset file" button at the top. On the following screen, choose the file you wish to upload and hit save. Keep in mind that the URL for the file will be generated based on the uploaded file name and cannot be changed once uploaded, so name your files beforehand.

After you upload your file, click the save button and you will be taken back to the list of asset files. Next to each asset file is the link to use in your html template to access that file. It is clear to see that for each file, the link is just ``/media/hunt/assets/{name of file}``.

Inheriting the base template
----------------------------

Expand Down Expand Up @@ -81,8 +90,6 @@ While you may have all of the information you need, that doesn't mean you know w
overflow: hidden;
width: 320px;
}
.puzzle-name:after { content: ".........................................................."; }
</style>
{% endblock base_includes %}

Expand Down Expand Up @@ -112,7 +119,11 @@ While you may have all of the information you need, that doesn't mean you know w
{% endif %}
<tr id='puzzle{{ puzzle.puzzle_number }}' class='puzzle'>
<td>
<p class="puzzle-name"><a href='/puzzle/{{ puzzle.puzzle_id }}/'>{{puzzle.puzzle_name}}</a></p>
<p class="puzzle-name">
<a href='/puzzle/{{ puzzle.puzzle_id }}/'>
{{puzzle.puzzle_name}}
</a>
</p>
</td>
<td>
{% if puzzle in solved %}
Expand Down

0 comments on commit 064c306

Please sign in to comment.