Monarch Of The Hill - base infrastructure for computer-based puzzle contests
Go to file
Jack Miner 1bf6b5d725 Fixed some documentation on setting up lighttpd 2016-02-22 01:12:24 -07:00
bin Changed koth to moth. Added some documentation on setting up a web server 2016-02-16 09:25:45 -07:00
doc Licence 2016-01-31 20:55:17 -07:00
www Fixed some relative paths. Added some doc love to README 2016-02-18 01:20:28 -07:00
.gitignore tweak scoreboard 2012-02-02 16:51:19 -07:00
README.md Fixed some documentation on setting up lighttpd 2016-02-22 01:12:24 -07:00
TODO.md Fill in "How It Works" a bit 2016-01-31 20:41:22 -07:00
install Changed points restore output to Neale's stupid space delimited format. Added url param 'snapshot' to specify a points snapshot to restore (0-19). Changed points log storage to an array of the 20 most recent points logs. 2015-05-28 14:15:05 -06:00
mothd Changed koth to moth. Added some documentation on setting up a web server 2016-02-16 09:25:45 -07:00

README.md

Dirtbags Monarch Of The Hill Server

This is a set of thingies to run our Monarch-Of-The-Hill contest, which in the past has been called "Tracer FIRE", "Project 2", "HACK", "Queen Of The Hill", 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, and comes with a JavaScript-based scoreboard to display team rankings.

How everything works

This section wound up being pretty long. Please check out the overview for details.

Dependencies

If you're using Xubuntu 14.04 LTS, you should have everything you need except LUA.

$ sudo apt-get install lua5.2 -y

You'll also have to figure out a way to serve up CGI. Here's one way to do it on Xubuntu 14.04 LTS with lighttpd where the contest is at /opt/moth/mycontest:

First, install lighttpd and backup the configuration:

$ sudo apt-get install lighttpd -y
$ cp /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig

Add mod_cgi to the ServerModules section, an alias, and CGI handling to /etc/lighttpd/lighttpd.conf:

alias.url = ("/moth" => "/opt/moth/mycontest/www")
$HTTP["url"] =~ "/moth/" {
cgi.assign = (".cgi" => "/usr/bin/lua")
}

Finally, restart your server:

$ sudo service lighttpd restart
* Stopping web server lighttpd  [ OK ]
* Starting web server lighttpd  [ OK ]

Your server should now be serving up the contest!

How to set it up

It's made to be virtualized, so you can run multiple contests at once if you want. If you were to want to run it out of /opt/moth, do the following:

$ mkdir -p /opt/moth/mycontest
$ ./install /opt/moth/mycontest
$ cp mothd /opt/moth

Yay, you've got it set up.

Installing Puzzle Categories

Puzzle categories are distributed in a different way than the server. After setting up (see above), just run $ /opt/moth/mycontest/bin/install-category /path/to/my/category

Running It

Get your web server to serve up files from /opt/moth/mycontest/www.

Then run /opt/moth/mothd.

Permissions

It's up to you not to be a bonehead about permissions.

Install sets it so the web user on your system can write to the files it needs to, but if you're using Apache, it plays games with user IDs when running CGI. You're going to have to figure out how to configure your preferred web server.