Skip to content

Installation & running

Jameson2011 edited this page Jun 11, 2020 · 5 revisions

The proxy is a standard Windows console application.

Binaries

Full binaries are provided in the build artifacts from Appveyor. README.MD has a link to the latest build: just download and extract the files somewhere on your hard drive.

Dependencies

.NET Core 2.

This has only been tested on Windows Server 2016/10: other platforms have not been tested and therefore aren't supported.

Kills are optionally persisted. Persistence is provided by MongoDB: 3.2.9 is the minimum tested version.

MongoDB is currently free: you can get a copy at https://www.mongodb.com/download-center#community, installation notes are at https://docs.mongodb.com/tutorials/install-mongodb-on-windows/. Alternatively, you can use a free DB from https://mlab.com/. Mongo Atlas is currently not supported.

Command line options

To get command line options:

dotnet zKbProxy.dll run -?

To get a complete set of options please refer to the command line help.

Examples

Run without Mongo:

dotnet zKbProxy.dll run -nocache

Run with a local Mongo instance:

dotnet zKbProxy.dll run -svr 127.0.0.1

Run with a local Mongo instance with a specific database & collection, the proxy's web service on port 8080, streaming with a max buffer size of 2000 kills

dotnet zKbProxy.dll run -svr 127.0.0.1 -db zKbKills -col killCollection -port 8080 --liveBuffer 2000

Configuration

Run specifying a configuration file:

dotnet zKbProxy.dll run --config path_to_config_file

The configuration file is a standard JSON file with some secret clear text information. For example:

{
    "mongoServer": "127.0.0.1",
    "dbName": "zkbproxy",
    "killsDbCollection": "zkbkills",
    "sessionsDbCollection": "sessions",
    "mongoUserName": "username",
    "mongoPassword": "plain text password - be careful!",
    "bufferSize": 100000,
    "killSourceUri": "https://redisq.zkillboard.com/listen.php?ttw=10",
    "sessionTimeout": "04:00:00",
    "webServerPort": 80,
    "noCache": false
}

Please ensure this file is kept in a secure location!

Hosting

Run as a console application from a shell, or for really cheap-as-chips service run as a scheduled task.

Scheduled tasks give you easy background execution, without the hassle of installing services, IIS, etc. If you use Scheduled Tasks, set the options to:

  • Enable Start on system startup
  • Enable Run whether the user is logged in or not
  • Disable Stop the task if it runs longer than...
  • Set If the task fails, retry... options.
  • Set If the task is already running to Do not start a new instance

Ubuntu daemon

To run on Ubuntu, ensure you have the Dot Net core v 3.1 runtime installed (the full SDK is unnecessary). Create a user/group, and set a unit file like:


[Unit]
Description=zKB Proxy

[Service]
WorkingDirectory=/usr/bin/zkbproxy
ExecStart=/usr/bin/dotnet /usr/bin/zkbproxy/zKbProxy.dll run --config /usr/bin/zkbproxy/zkbproxy.json
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=zkbproxy
User=zkbservice

[Install]
WantedBy=multi-user.target


Clone this wiki locally