diff --git a/README b/README new file mode 100644 index 0000000..e564d4a --- /dev/null +++ b/README @@ -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 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. diff --git a/bin/install-category b/bin/install-category index 2b25c2e..56c09e5 100755 --- a/bin/install-category +++ b/bin/install-category @@ -27,7 +27,7 @@ template () { $cat $points - +

$cat for $points points

@@ -52,7 +52,7 @@ EOF cat < -
+ Team hash: @@ -73,7 +73,7 @@ usummary=$outdir/summary.unsorted umap=$outdir/map.unsorted 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 fi read salt < $outdir/salt @@ -100,7 +100,7 @@ for dn in $indir/[0-9]*; do # If there's a manifest, use that files= while read fn; do - ln -f $dn/$fn $tgt/ + cp $dn/$fn $tgt/ case $fn in ,*) ;; @@ -122,12 +122,12 @@ for dn in $indir/[0-9]*; do ;; ,*) # Copy but don't list - ln -f $fn $tgt/ + cp $fn $tgt/ ;; *) #ext=$(echo $fn | sed -ne 's/.*\././p') cfn=$(md5sum $fn | cut -b -8)$ext - ln -f $fn $tgt/$cfn + cp $fn $tgt/$cfn files="$files $cfn" ;; esac @@ -172,7 +172,7 @@ echo "Generating summary" [ -f $usummary ] && sort -ns $usummary > $outdir/summary.txt echo "Linking into web space" -ln -s ../packages/$cat/puzzles www/$cat +ln -sf ../packages/$cat/puzzles www/$cat echo "Cleaning up" rm -f $uanswers $usummary $umap diff --git a/html/css/style.css b/html/css/style.css index b1fccad..b6fb400 100644 --- a/html/css/style.css +++ b/html/css/style.css @@ -21,7 +21,7 @@ h1, h2, h3 { font-weight: bold; } -h1:first-child { +body > h1:first-child { color: #96d1e3; background: #35170c; font-size: 3em; diff --git a/html/register.html b/html/register.html index 90bbcec..d89ba06 100644 --- a/html/register.html +++ b/html/register.html @@ -11,7 +11,8 @@

Register Your Team

- 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, so make sure it's the team name you actually want. Staff are unable to make changes to team names.