Godville Reporter Server
This is a server-side daemon for supporting Godville Reporter.
The Easy Way
The server can be used inside a Docker container. The image is 500 MB in size, plus 80 MB for the Docker itself.
Read this, then
git submodule update --init. Install
(in Debian-based distributions), add yourself to
mgmt/update.sh [-P | --no-pull]takes care of everything: downloads the latest source (optionally), builds the image, compiles and restarts the server. It might fail, though, if you have a dirty working tree.
mgmt/status.shchecks whether the container and the server inside it are running.
mgmt/stop.shshuts down the container.
mgmt/log.sh [-F] [--tail <n>]displays build-time logs (all other logs go to
-Fis given, it will exit immediately instead of "following". If
<n>last lines are shown (10 by default).
The Hard Way
gcc libevent-dev libssl1.0-dev python zlib1g-dev
To get a release version, run from the project root:
dub upgrade ./waf configure build dub build -brelease-nobounds # Or, to tweak for your CPU: DFLAGS=-mcpu=native dub build -brelease-nobounds
./gvrepsrv [-p8000] [--prefix=/] [--max-memory=128M]
However, the server is recommended to be run under Supervisor so that it will auto-restart if/when crashing.
Edit supervisord.conf and gvrepsrv.conf (or, even better, make a copy of them). If you are
not going to run
supervisord as root, you'll likely need to change some paths. Then, ensure there
is exactly one instance of
supervisord -c/abspath/supervisord.conf (a Cron task would suffice):
#!/usr/bin/env bash set -euo pipefail readonly CONFIG_FILE=/abspath/supervisord.conf readonly PID_FILE=/var/run/supervisord.pid set +e pid=`cat -- "$PID_FILE" 2>/dev/null` status=$? set -e [ "$status" = 0 ] && kill -0 -- "$pid" 2>/dev/null || exec supervisord -c"$CONFIG_FILE"
The daemon is controlled by
supervisorctl commands. For example,
supervisorctl -c"$CONFIG_FILE" update or
supervisorctl -c"$CONFIG_FILE" restart gvrepsrv.