Monitors and controls game servers via the Nitrado API. Syncs server state on a schedule, sends Discord notifications on status changes, and exposes REST endpoints and Discord slash commands for manual control.
Done
- Start / stop / restart / delete servers via REST and Discord slash commands
- Periodic Nitrado sync (supercronic →
POST /api/jobs/sync-servers) - Discord status-change notifications
- Player whitelist and banlist management (
/server-whitelist,/server-banlist) - Role-based HTTP Basic Auth (
ADMIN,CRON_JOB) - Resilience4j circuit breaker, rate limiter, retry + Caffeine cache on Nitrado client
Planned
- Persistent database (currently in-memory — state is lost on restart)
- Discord notifications for whitelist / banlist changes
# Start WireMock (stubs Nitrado API) and supercronic via Docker
./gradlew startDependencies
# Run the application (with WireMock profile)
./gradlew bootRun
# Run without Docker
./gradlew bootRun --args='--spring.profiles.active=local'
# Full build: format check + tests + architecture tests
./gradlew build.env
ADMIN_PASSWORD=changeme
CRON_JOB_PASSWORD=changeme
NITRADO_API_TOKEN=your-token
NITRADO_SERVER_ID=12345678
# Discord (optional)
DISCORD_ENABLED=false
DISCORD_BOT_TOKEN=
DISCORD_GUILD_ID=
DISCORD_NOTIFICATION_CHANNEL_ID=
DISCORD_ADMIN_ROLE_ID=
DISCORD_ALLOWED_ROLE_ID=crontab
*/30 * * * * * * curl -sf -X POST -u game-server-bot-job:${JOB_PASSWORD} http://game-server-bot:8080/api/jobs/sync-servers
*/15 * * * * * * curl -sf -X POST -u game-server-bot-job:${JOB_PASSWORD} http://game-server-bot:8080/api/jobs/update-discord-presence
docker-compose.yaml
services:
game-server-bot:
image: ghcr.io/xenexes/game-server-bot:latest
restart: unless-stopped
env_file: .env
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
interval: 30s
start_period: 90s
cron:
image: hectorm/supercronic
restart: unless-stopped
environment:
JOB_PASSWORD: ${CRON_JOB_PASSWORD}
volumes:
- ./crontab:/etc/crontab:ro
depends_on:
game-server-bot:
condition: service_healthydocker compose up -dThe pipeline/ directory contains an Ansible-orchestrated pipeline that builds, versions, and deploys to a Proxmox LXC container via Terraform.
What it does:
ktlintCheck → test → build(fails fast)- Semver bump in
build.gradle.kts+ git tag - Build and push Docker image
- Terraform: destroy old LXC → provision new Debian 13 LXC on Proxmox
- Ansible: install Docker, deploy app stack, verify Hawser agent
# Fill in secrets first
cp pipeline/ansible/vars/secrets.yml.example pipeline/ansible/vars/secrets.yml
# Run full pipeline
make deploySee pipeline/README.md for prerequisites, Proxmox API setup, and operational notes.