Skip to content

Robin Server

Backend server for Robin Web, built using Rust and the Salvo framework. Its primary function is to proxy API requests for the Running with Rifles game server list, provide static file serving, and serve game map configuration data.

  • Language: Rust
  • Framework: Salvo
  • Testing: Vitest, Playwright
VariableDefaultDescription
HOST127.0.0.1Server bind address
PORT5800Server port
MAPS_CONFIGmaps.jsonMaps configuration file path
CACHE_DURATION_SECS3Cache expiry time in seconds
RATE_LIMIT_SECS3Rate limit interval in seconds
ANDROID_REPO_URL(empty)GitHub repository URL for Android app releases
WEB_REPO_URL(empty)GitHub repository URL for Web app releases

Health check endpoint that returns “pong”.

Returns the latest release information for Android and Web applications configured through environment variables.

{
"android": {
"version": "v2.0.0",
"url": "https://github.com/owner/android-repo/releases/tag/v2.0.0"
},
"web": {
"version": "v1.5.0",
"url": "https://github.com/owner/web-repo/releases/tag/v1.5.0"
}
}

Returns game map configuration data.

Proxies requests to the Running with Rifles game server list API. Supports query parameters for filtering.

Proxies requests to the Running with Rifles player statistics API. Returns HTML content with player rankings and statistics.

Terminal window
# Get players sorted by kills in descending order
curl "http://localhost:5800/api/player_list?sort=kills&order=desc"

Maps are configured through a JSON file specified by the MAPS_CONFIG environment variable.

{
"maps": [
{
"name": "map9",
"path": "media/packages/vanilla.desert/maps/map9",
"image": "md5_1.png"
}
]
}
  • name: Human-readable map name
  • path: Full game path for the map (unique identifier)
  • image: Image filename or CDN URL for map preview
Terminal window
# Install Rust first, then:
git clone https://github.com/rwr-infra/robin-server.git
cd robin-server
# Run development server
cargo run
# Custom configuration
HOST=0.0.0.0 PORT=8080 cargo run
Terminal window
# Local build
cargo build --release
# Docker build
docker build -t robin-server .
Terminal window
# Basic deployment
docker pull zhaozisong0/rwrs-server:latest
docker run -d -p 80:80 --name robin-server \
-e HOST=0.0.0.0 \
-e PORT=80 \
zhaozisong0/rwrs-server:latest
Terminal window
# Copy frontend build to static directory
docker cp ./dist/. robin-server:/static/
version: '3'
services:
robin-server:
image: zhaozisong0/rwrs-server:latest
ports:
- "80:80"
environment:
- HOST=0.0.0.0
- PORT=80
- ANDROID_REPO_URL=https://github.com/rwr-infra/robin-android
- WEB_REPO_URL=https://github.com/rwr-infra/robin-web
volumes:
- ./dist:/static
- ./maps.json:/maps.json
Terminal window
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test module
cargo test api_cache_tests
# Generate coverage report
cargo install cargo-llvm-cov
cargo llvm-cov --all-features