Work in progress: AI Slop garbage for quick and dirty POC.
Source Dedicated Server portal API. A FastAPI daemon that polls SRCDS game servers via the a2s protocol and exposes their status (players, map, etc.) over a REST API.
Later will include a lua 3D2D portal system.
Include serverportal.conf in your nginx config:
include /home/serverportal/serverportal/serverportal.conf;The API uses root_path="/a2s" so change accordingly.
Run as a systemd user service so it starts on boot and restarts on failure.
cp serverportal_api.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now serverportal_api
systemctl --user status serverportal_api- On startup, the daemon reads
config.json(a list of server entries with address, appid, etc.) and resolves any domain names to IPs. - Every 61 seconds it polls all servers in parallel using the A2S_INFO query to collect current player counts, map name, game info, etc.
- Results are served over HTTP via two endpoints:
GET /a2s/servers— list of all servers with live status.GET /a2s/servers/{id}— single server by ID.GET /a2s/health— health check.
- Responses include short-lived
Cache-Controlheaders (10s for server data, 60s for health).