Document some stuff

This commit is contained in:
Neale Pickett 2015-04-12 11:33:53 -06:00
parent 40233fe0c8
commit 4112c04c87
4 changed files with 64 additions and 9 deletions

54
README Normal file
View File

@ -0,0 +1,54 @@
Dirtbags King Of The Hill Server
=====================
This is a set of thingies to run our KOTH-style contest.
Contests we've run in the past have been called
"Tracer FIRE" and "Project 2".
It 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
----------------------------
I should fill this in, but I don't feel like anybody would read it.
Send an email to <neale@woozle.org> asking me how it works,
and I'll write this part up and email it back to you :)
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/koth`,
do the following:
$ mkdir -p /opt/hack/mycontest
$ ./install /opt/hack/mycontest
$ cp kothd /opt/hack
Yay, you've got it set up.
Installing Puzzle Categories
------------------------------------
Puzzle categories are distributed in a different way than the server.
If you have one,
just run
$ /opt/koth/hack/bin/install-category /path/to/my/category
Running It
-------------
Get your web server to serve up files from
`/opt/koth/hack/www`.
Then run `/opt/koth/kothd`.
It's up to you not to be a bonehead about permissions.

View File

@ -27,7 +27,7 @@ template () {
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>$cat $points</title> <title>$cat $points</title>
<link rel="stylesheet" href="/css/style.css" type="text/css"> <link rel="stylesheet" href="/../../css/style.css" type="text/css">
</head> </head>
<body> <body>
<h1>$cat for $points points</h1> <h1>$cat for $points points</h1>
@ -52,7 +52,7 @@ EOF
cat <<EOF cat <<EOF
<section id="form"> <section id="form">
<form id="puzzler" action="/puzzler.cgi" method="post" accept-charset="utf-8"> <form id="puzzler" action="/puzzler.cgi" method="post" accept-charset="utf-8" autocomplete="off">
<input type="hidden" name="c" value="$cat"> <input type="hidden" name="c" value="$cat">
<input type="hidden" name="p" value="$points"> <input type="hidden" name="p" value="$points">
Team hash:<input name="t" size="8"> Team hash:<input name="t" size="8">
@ -73,7 +73,7 @@ usummary=$outdir/summary.unsorted
umap=$outdir/map.unsorted umap=$outdir/map.unsorted
mkdir -p $outdir mkdir -p $outdir
if ! [ -r $outdir/mkpuzzles.salt ]; then if ! [ -r $outdir/salt ]; then
dd if=/dev/urandom bs=1 count=16 2>/dev/null | md5sum | cut -c1-16 > $outdir/salt dd if=/dev/urandom bs=1 count=16 2>/dev/null | md5sum | cut -c1-16 > $outdir/salt
fi fi
read salt < $outdir/salt read salt < $outdir/salt
@ -100,7 +100,7 @@ for dn in $indir/[0-9]*; do
# If there's a manifest, use that # If there's a manifest, use that
files= files=
while read fn; do while read fn; do
ln -f $dn/$fn $tgt/ cp $dn/$fn $tgt/
case $fn in case $fn in
,*) ,*)
;; ;;
@ -122,12 +122,12 @@ for dn in $indir/[0-9]*; do
;; ;;
,*) ,*)
# Copy but don't list # Copy but don't list
ln -f $fn $tgt/ cp $fn $tgt/
;; ;;
*) *)
#ext=$(echo $fn | sed -ne 's/.*\././p') #ext=$(echo $fn | sed -ne 's/.*\././p')
cfn=$(md5sum $fn | cut -b -8)$ext cfn=$(md5sum $fn | cut -b -8)$ext
ln -f $fn $tgt/$cfn cp $fn $tgt/$cfn
files="$files $cfn" files="$files $cfn"
;; ;;
esac esac
@ -172,7 +172,7 @@ echo "Generating summary"
[ -f $usummary ] && sort -ns $usummary > $outdir/summary.txt [ -f $usummary ] && sort -ns $usummary > $outdir/summary.txt
echo "Linking into web space" echo "Linking into web space"
ln -s ../packages/$cat/puzzles www/$cat ln -sf ../packages/$cat/puzzles www/$cat
echo "Cleaning up" echo "Cleaning up"
rm -f $uanswers $usummary $umap rm -f $uanswers $usummary $umap

View File

@ -21,7 +21,7 @@ h1, h2, h3 {
font-weight: bold; font-weight: bold;
} }
h1:first-child { body > h1:first-child {
color: #96d1e3; color: #96d1e3;
background: #35170c; background: #35170c;
font-size: 3em; font-size: 3em;

View File

@ -11,7 +11,8 @@
<h2>Register Your Team</h2> <h2>Register Your Team</h2>
<p> <p>
Before you can use a token, you must choose a team name. Before you can use a team hash,
you must name your team.
You can only do this once, You can only do this once,
so make sure it's the team name you actually want. so make sure it's the team name you actually want.
Staff are unable to make changes to team names. Staff are unable to make changes to team names.