feat: add automation features (auto-update, auto-start, scheduled updates)

This commit is contained in:
MrFastwind
2026-07-06 16:10:17 +02:00
parent b853aead8c
commit 149a60c6fb
12 changed files with 325 additions and 30 deletions

View File

@@ -50,6 +50,61 @@ All paths are configurable via environment variables:
| `FRONTEND_DIR` | `../frontend/dist` | Built frontend assets |
| `LISTEN` | `:8080` | HTTP listen address |
## Automation
The panel can perform automatic operations at startup and on a schedule.
### Startup tasks
Configured in the **Automation** section of the Settings UI:
| Setting | Description |
|---------|-------------|
| **Auto-update server on startup** | Runs `steamcmd +app_update` for the Arma 3 server binary when the web service starts. |
| **Auto-update mods on startup** | Downloads workshop updates for every enabled mod in the active modlist when the web service starts. |
| **Auto-start server on startup** | Restarts the game server if it was running when the web service last stopped. Useful for recovery after host backup cycles or container restarts. |
All startup tasks run asynchronously — the web UI is available immediately.
### Scheduled updates
Set a **cron expression** in the `Scheduled Update` field to run game + mod updates on a recurring schedule (e.g. `"0 4 * * *"` for daily at 4 AM). Leave empty to disable.
The scheduled update runs even if the game server is currently running.
## SteamCMD Authentication
The panel integrates with SteamCMD for server binary updates and workshop mod downloads.
### Anonymous (default)
The `Steam User` field in the settings UI defaults to `anonymous`.
In this mode, **no Steam account is required** — SteamCMD uses `+login anonymous`.
- Workshop mod downloads always use this mode, regardless of the configured user.
- The Arma 3 server binary update is available via `+login anonymous` only if the server files are publicly accessible on that Steam account.
### Authenticated login
To update the Arma 3 server binary (`app_update 233780`) with a real Steam account, set the `Steam User` field to your account name.
The web panel does not pass a password — SteamCMD relies on a **cached session**.
You must authenticate manually once so the login token is persisted:
```bash
# Docker
docker exec -it arma3-web steamcmd +login your_steam_username
```
Enter your password when prompted, including any Steam Guard code if enabled. The session is cached inside the container's filesystem (`~/.steam/`).
> **Note:** SteamCMD sessions may expire. Re-run the login command if the "Update Server" button fails with an authentication error.
### Security
- Steam credentials saved in `data/settings.json` are stored as **plain text**.
- It is recommended to use a **dedicated Steam account** with only the necessary game licenses for automated server management.
## API
REST API at `/api/*` and WebSocket endpoints at `/ws/*`. Key routes: