mirror of https://github.com/dirtbags/moth.git
make points submission almost work again
This commit is contained in:
parent
ea79cc79e5
commit
02b9884709
|
@ -45,13 +45,9 @@ esac
|
||||||
# Compute hash of team name; they'll use this for everything in the
|
# Compute hash of team name; they'll use this for everything in the
|
||||||
# contest instead of their team name, which makes stuff much easier on
|
# contest instead of their team name, which makes stuff much easier on
|
||||||
# me since all team hashes are in the set /[0-9a-f]{8}/.
|
# me since all team hashes are in the set /[0-9a-f]{8}/.
|
||||||
hash=$(echo "not a nonce:::$1" | md5sum | cut -b 1-8)
|
hash=$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | cut -b 1-8)
|
||||||
|
|
||||||
echo "$1" > $base/teams/names/$hash
|
echo "$1" > $base/teams/names/$hash
|
||||||
echo "$color" > $base/teams/colors/$hash
|
echo "$color" > $base/teams/colors/$hash
|
||||||
|
|
||||||
echo "Registered with hash: $hash"
|
echo "Registered with hash: $hash"
|
||||||
|
|
||||||
# Create encrypted listing of teams
|
|
||||||
ls $base/teams/names | KEY="Too much cheese." arc4 > $www/teams.txt.$$
|
|
||||||
mv $www/teams.txt.$$ $www/teams.txt
|
|
||||||
|
|
|
@ -1,27 +1,28 @@
|
||||||
MCP_PKGDIR = $(TARGET)/mcp
|
MCP_PKGDIR = $(TARGET)/mcp
|
||||||
MCP_BUILDDIR = $(BUILD)/mcp
|
MCP_BUILDDIR = $(BUILD)/mcp
|
||||||
|
|
||||||
MCP_FNORD_VERSION = 1.10
|
|
||||||
MCP_FNORD_TARBALL = fnord-$(MCP_FNORD_VERSION).tar.bz2
|
|
||||||
MCP_FNORD_TARCACHE = $(CACHE)/$(MCP_FNORD_TARBALL)
|
|
||||||
MCP_FNORD_URL = http://www.fefe.de/fnord/$(MCP_FNORD_TARBALL)
|
|
||||||
MCP_FNORD_SRCDIR = $(MCP_BUILDDIR)/fnord-$(MCP_FNORD_VERSION)
|
|
||||||
|
|
||||||
$(MCP_FNORD_TARCACHE):
|
##
|
||||||
@ mkdir -p $(@D)
|
## XXX: clean up fnord like router.mk
|
||||||
wget -O $@ $(MCP_FNORD_URL)
|
##
|
||||||
|
|
||||||
|
FNORD_CACHE = $(CACHE)/fnord.git
|
||||||
|
FNORD_BUILDDIR = $(MCP_BUILDDIR)/fnord
|
||||||
|
FNORD_URL = http://woozle.org/~neale/projects/fnord
|
||||||
|
|
||||||
|
$(FNORD_CACHE):
|
||||||
|
git clone --bare $(FNORD_URL) $@
|
||||||
|
|
||||||
mcp-source: $(MCP_BUILDDIR)/source
|
mcp-source: $(MCP_BUILDDIR)/source
|
||||||
$(MCP_BUILDDIR)/source: $(MCP_FNORD_TARCACHE)
|
$(MCP_BUILDDIR)/source: $(FNORD_CACHE)
|
||||||
mkdir -p $(@D)
|
mkdir -p $(@D)
|
||||||
bzcat $< | (cd $(@D) && tar xf -)
|
git clone $(FNORD_CACHE) $(@D)/fnord
|
||||||
(cd $(@D)/fnord-$(MCP_FNORD_VERSION) && patch -p 1) < packages/mcp/fnord.patch
|
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
mcp-build: $(MCP_BUILDDIR)/build
|
mcp-build: $(MCP_BUILDDIR)/build
|
||||||
$(MCP_BUILDDIR)/build: $(MCP_BUILDDIR)/source
|
$(MCP_BUILDDIR)/build: $(MCP_BUILDDIR)/source
|
||||||
$(MAKE) -C packages/mcp/src build
|
$(MAKE) -C packages/mcp/src build
|
||||||
$(MAKE) -C $(MCP_BUILDDIR)/fnord-$(MCP_FNORD_VERSION) DIET= CC=$(CC) fnord-cgi
|
$(MAKE) -C $(MCP_BUILDDIR)/fnord DIET= CC=$(CC) fnord-cgi
|
||||||
|
|
||||||
|
|
||||||
mcp-install: $(MCP_BUILDDIR)/build
|
mcp-install: $(MCP_BUILDDIR)/build
|
||||||
|
@ -31,7 +32,7 @@ mcp-install: $(MCP_BUILDDIR)/build
|
||||||
cp packages/mcp/src/pointscli $(MCP_PKGDIR)/bin/
|
cp packages/mcp/src/pointscli $(MCP_PKGDIR)/bin/
|
||||||
cp packages/mcp/src/puzzles.cgi $(MCP_PKGDIR)/bin/
|
cp packages/mcp/src/puzzles.cgi $(MCP_PKGDIR)/bin/
|
||||||
|
|
||||||
cp $(MCP_BUILDDIR)/fnord-$(MCP_FNORD_VERSION)/fnord-cgi $(MCP_PKGDIR)/bin/
|
cp $(MCP_BUILDDIR)/fnord/fnord-cgi $(MCP_PKGDIR)/bin/
|
||||||
|
|
||||||
$(call COPYTREE, packages/mcp/service, $(MCP_PKGDIR)/service)
|
$(call COPYTREE, packages/mcp/service, $(MCP_PKGDIR)/service)
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,4 @@ for d in /opt/*; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
exec tcpsvd -u ctf ${IP%/*} 80 /opt/mcp/bin/fnord-cgi /var/www
|
||||||
mkdir -p sites
|
|
||||||
cd sites
|
|
||||||
ln -sf /var/www default
|
|
||||||
exec tcpsvd -u ctf ${IP%/*} 80 /opt/mcp/bin/fnord-cgi
|
|
||||||
|
|
|
@ -4,6 +4,9 @@ exec 2>&1
|
||||||
|
|
||||||
DB=/var/lib/ctf/puzzles.db
|
DB=/var/lib/ctf/puzzles.db
|
||||||
|
|
||||||
|
# Create CTF user
|
||||||
|
touch /etc/group /etc/passwd
|
||||||
|
addgroup -g 56634 nogroup || true
|
||||||
adduser -D -S -h /var/lib/ctf -H ctf || true
|
adduser -D -S -h /var/lib/ctf -H ctf || true
|
||||||
|
|
||||||
mkdir -p /var/lib/ctf /var/www
|
mkdir -p /var/lib/ctf /var/www
|
||||||
|
|
Loading…
Reference in New Issue