AutoPatchMaster (APM) automates the updating of dedicated server files. It listens for update requests via a WebSocket push stream and executes the corresponding update scripts using screen. A built-in HTTP server exposes health and status information.
- Source files are not published- WebSocket-driven update triggers with automatic reconnect (exponential backoff)
- Command injection protection via strict game tag validation
- Health endpoint with uptime, WebSocket status and update history
- Timestamped console logging with color-coded levels
- Persistent log file (configurable path)
- Graceful shutdown on
SIGTERM/SIGINT - Async shell execution with exit code reporting
- Node.js >= 16.9.0
npm install
cp .env.example .env # adjust values as needed
npm startAll settings are configured via .env:
| Variable | Default | Description |
|---|---|---|
BIND_HOST |
127.0.0.1 |
IP address the HTTP server binds to |
BIND_PORT |
8080 |
HTTP server port |
WEBSOCKET_URL |
wss:// |
WebSocket endpoint to subscribe to |
LOG_FILE |
apm.log (next to index.js) |
Path to the log file |
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Health status, uptime, recent updates |
/health |
GET | Same as / |
{
"status": "healthy",
"response": "AutoPatchMaster (APM) running",
"uptime_minutes": 42,
"websocket": "connected",
"recent_updates": [
{ "tag": "rust", "time": "2026-03-26T08:00:00.000Z" }
]
}APM expects messages in the following structure:
{
"extras": {
"game": {
"tag": "rust"
}
}
}The tag field must match ^[a-zA-Z0-9_-]+$. On receipt, APM runs:
screen -d -m -S <tag> bash -c "./update <tag>"