diff --git a/README.md b/README.md index 766f78c..c167201 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,14 @@ which in the past has been called "Project 2", "HACK", "Queen Of The Hill", -and "Cyber FIRE". +"Cyber Spark", +and "Cyber Fire". Information about these events is at http://dirtbags.net/contest/ This software serves up puzzles in a manner similar to Jeopardy. -It also track scores, +It also tracks scores, and comes with a JavaScript-based scoreboard to display team rankings. @@ -21,7 +22,7 @@ How everything works --------------------------- This section wound up being pretty long. -Please check out [the overview](doc/overview.md) +Please check out [the overview](docs/overview.md) for details. @@ -34,6 +35,9 @@ Getting Started Developing Then point a web browser at http://localhost:8080/ and start hacking on things in your `puzzles` directory. +More on how the devel sever works in +[the devel server documentation](docs/devel-server.md) + Running A Production Server ==================== diff --git a/doc/CREDITS.md b/docs/CREDITS.md similarity index 100% rename from doc/CREDITS.md rename to docs/CREDITS.md diff --git a/doc/LICENSE.md b/docs/LICENSE.md similarity index 100% rename from doc/LICENSE.md rename to docs/LICENSE.md diff --git a/doc/devel-server.md b/docs/devel-server.md similarity index 100% rename from doc/devel-server.md rename to docs/devel-server.md diff --git a/doc/dirtbags.svg b/docs/dirtbags.svg similarity index 100% rename from doc/dirtbags.svg rename to docs/dirtbags.svg diff --git a/doc/overview.md b/docs/overview.md similarity index 100% rename from doc/overview.md rename to docs/overview.md diff --git a/doc/tokens.md b/docs/tokens.md similarity index 100% rename from doc/tokens.md rename to docs/tokens.md diff --git a/doc/writing-puzzles.md b/docs/writing-puzzles.md similarity index 100% rename from doc/writing-puzzles.md rename to docs/writing-puzzles.md diff --git a/package-puzzles b/package-puzzles index bf0eb71..f730a17 100755 --- a/package-puzzles +++ b/package-puzzles @@ -95,7 +95,16 @@ if __name__ == '__main__': for points in sorted(puzzles_dict): puzzle = puzzles_dict[points] puzzledir = os.path.join(categoryname, 'content', mapping[points]) - puzzlejson = puzzle.publish() + puzzledict = { + 'author': puzzle.author, + 'hashes': puzzle.hashes(), + 'files': [f.name for f in puzzle.files if f.visible], + 'body': puzzle.html_body(), + } + secretsdict = { + 'summary': puzzle.summary, + 'answers': puzzle.answers, + } # write associated files assoc_files = [] diff --git a/tools/devel-server.py b/tools/devel-server.py index 8befebc..9b925cd 100755 --- a/tools/devel-server.py +++ b/tools/devel-server.py @@ -1,12 +1,14 @@ #!/usr/bin/env python3 -import cgi import glob +import html import http.server +import io import mistune import moth import os import pathlib +import shutil import socketserver import sys import traceback @@ -15,8 +17,9 @@ try: from http.server import HTTPStatus except ImportError: class HTTPStatus: - NOT_FOUND = 404 - OK = 200 + OK = (200, 'OK', 'Request fulfilled, document follows') + NOT_FOUND = (404, 'Not Found', 'Nothing matches the given URI') + INTERNAL_SERVER_ERROR = (500, 'Internal Server Error', 'Server got itself in trouble') # XXX: This will eventually cause a problem. Do something more clever here. seed = 1 @@ -26,15 +29,16 @@ def page(title, body): return """
-