Sign inSign up

k4rian/kfrs

By k4rian

•Updated over 1 year ago

A dead simple and secure HTTP redirect server for the Killing Floor Dedicated Server (KFDS).

Image
Web servers
0

2.1K

k4rian/kfrs repository overview

⁠KF Redirect Server (KFRS)

A Docker image for the Killing Floor Redirect Server (kfrs)⁠ based on the official Alpine Linux⁠ image⁠.


⁠Environment variables

Environment variables can be provided when creating a container to define the server configuration:

[Click to expand]
VariableDefault valueDescription
KFRS_HOST0.0.0.0IP/Host to bind to.
KFRS_PORT9090TCP port to listen on.
KFRS_SERVE_DIR./redirectDirectory to serve files from.
KFRS_MAX_REQUESTS20Max requests per IP/minute before banning.
KFRS_BAN_TIME15Ban duration (in minutes).
KFRS_LOG_TO_FILEfalseEnable file logging.
KFRS_LOG_LEVELinfoLog level (info, debug, warn, error).
KFRS_LOG_FILE./kfrs.logLog file path.
KFRS_LOG_FILE_FORMATtextLog format (text or json).
KFRS_LOG_MAX_SIZE10Max log file size (MB).
KFRS_LOG_MAX_BACKUPS5Max number of old log files to keep.
KFRS_LOG_MAX_AGE28Max age of a log file (days).

⁠Usage

Run the server using default configuration.

Make sure the ./redirect directory exists before starting the container.

docker run -d \
  --name kfrs \
  -p 9090:9090/tcp \
  -v $(pwd)/redirect:/home/kfrs/redirect \
  -i k4rian/kfrs

Run the server with all environment variables set and file logging enabled.

Absolute paths are used for clarity.

docker run -d \
  --name kfrs \
  -p 9090:9090/tcp \
  -e KFRS_HOST="0.0.0.0" \
  -e KFRS_PORT=9090 \
  -e KFRS_SERVE_DIR="/home/kfrs/redirect" \
  -e KFRS_MAX_REQUESTS=20 \
  -e KFRS_BAN_TIME=15 \
  -e KFRS_LOG_TO_FILE=true \
  -e KFRS_LOG_LEVEL="info" \
  -e KFRS_LOG_FILE="/home/kfrs/kfrs.log" \
  -e KFRS_LOG_FILE_FORMAT="text" \
  -e KFRS_LOG_MAX_SIZE=10 \
  -e KFRS_LOG_MAX_BACKUPS=5 \
  -e KFRS_LOG_MAX_AGE=28 \
  -v $(pwd)/redirect:/home/kfrs/redirect \
  -i k4rian/kfrs

⁠Using Compose

See the docker-compose.yml⁠ file.

⁠Manual build

Requirements:
— Docker >= 18.09.0
— Git (optional)

Like any Docker image the building process is pretty straightforward:

  • Clone (or download) the GitHub repository to an empty folder on your local machine:
git clone https://github.com/K4rian/kfrs.git .
  • Then run the following command inside the newly created folder:
cd docker/ && docker build --no-cache -t k4rian/kfrs .

Tag summary

Content type

Image

Digest

sha256:c9d8ac8ba…

Size

13.2 MB

Last updated

over 1 year ago

docker pull k4rian/kfrs