Only games whose folder changed are boot-tested (against the previous
main commit, or against main on branches; manual runs pick games). Each
one is deployed by the node-agent's real deploy code on a dedicated
game-test runner, in a network that can reach the internet but not the
LAN. Publishing to the panel runs only if they all booted.
- boottest-payload builds the DEPLOY_SERVER message the panel would send
- readyPattern/failPatterns in game.yaml; readyExample in test.yaml is
checked against the pattern during validation
- secrets in test.yaml come from CI; a game missing one is skipped
- Minecraft gets a ready pattern; Dragonwilds needs DRAGONWILDS_OWNER_ID
- RUNNER.md + scripts/runner: runner, isolated network, systemd unit
Also fixes newline values ("\n" separators/footers) that yaml.v3 wrote
as "" on import, which would have broken ARK and Dragonwilds config
files once synced, and adds a round-trip test for the importer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
89 lines
4.4 KiB
JSON
89 lines
4.4 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://www.gitea.gbreed.com/gbreed-public/gbr-games/raw/branch/main/schema/game.schema.json",
|
|
"title": "GBR Hosting game template",
|
|
"description": "One game.yaml per game. Field names match the control panel's Game entity. Business settings (enabled, paid/private hosting, cover art, pricing tiers) are managed in the panel, not here.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["id", "name", "defaultDockerImage", "installMethod"],
|
|
"properties": {
|
|
"id": {
|
|
"description": "Stable identifier. Must match the folder name. Never rename: servers reference it.",
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
|
|
"maxLength": 64
|
|
},
|
|
"name": { "description": "Display name shown to users.", "type": "string", "minLength": 1 },
|
|
|
|
"defaultDockerImage": { "description": "Image the game server runs in.", "type": "string", "minLength": 1 },
|
|
"defaultStartupCommand": { "description": "Command run inside the container. May use config placeholders.", "type": ["string", "null"] },
|
|
"requiredMemoryMb": { "type": ["integer", "null"], "minimum": 128 },
|
|
"requiredDiskMb": { "type": ["integer", "null"], "minimum": 128 },
|
|
"defaultPorts": {
|
|
"description": "Ports to expose, e.g. \"25565/tcp\", \"7777/udp\" or \"8211:8211/udp\".",
|
|
"type": ["array", "null"],
|
|
"items": { "type": "string", "pattern": "^([0-9]{1,5}:)?[0-9]{1,5}(-[0-9]{1,5})?(/(tcp|udp))?$" }
|
|
},
|
|
|
|
"installMethod": { "enum": ["STEAMCMD", "BASH_SCRIPT", "NONE"] },
|
|
"installConfig": {
|
|
"description": "STEAMCMD needs appId; BASH_SCRIPT needs script.",
|
|
"type": ["object", "null"]
|
|
},
|
|
|
|
"defaultConfig": {
|
|
"description": "Default values for every server. Users override these per server. Keys may only contain letters, digits, '_', '-' and '.' (the panel drops anything else).",
|
|
"type": ["object", "null"],
|
|
"propertyNames": { "pattern": "^[a-zA-Z0-9_.-]+$", "maxLength": 128 }
|
|
},
|
|
"configSchema": {
|
|
"description": "JSON Schema for the settings users can edit. A property with \"x-consent\" (e.g. an EULA) must be explicitly accepted on deploy.",
|
|
"type": ["object", "null"]
|
|
},
|
|
"configFilePath": { "description": "Where defaultConfig + user overrides are written, relative to the server root.", "type": ["string", "null"] },
|
|
"configFileFormat": {
|
|
"description": "INI writes key=value lines; STANDARD uses configFormatOptions (header, separator, quoting) for formats like Unreal's OptionSettings=(...).",
|
|
"enum": ["INI", "STANDARD", "JSON", "ENV", null]
|
|
},
|
|
"configFormatOptions": { "type": ["object", "null"] },
|
|
|
|
"agnosticCommandConfig": { "description": "How the panel sends console commands (save, broadcast, kick...).", "type": ["object", "null"] },
|
|
"clusterConfig": { "type": ["object", "null"] },
|
|
|
|
"logFilePath": { "type": ["string", "null"] },
|
|
"readyPattern": {
|
|
"description": "Regex matched against the server's console output and log file once it can accept players. Without one, boot tests only check the server stays up.",
|
|
"type": ["string", "null"]
|
|
},
|
|
"failPatterns": {
|
|
"description": "Regexes that mean the server will not come up (e.g. an unaccepted EULA). Boot tests fail as soon as one matches.",
|
|
"type": ["array", "null"],
|
|
"items": { "type": "string" }
|
|
},
|
|
"backupPaths": { "type": ["array", "null"], "items": { "type": "string" } },
|
|
"maxBackupSizeMb": { "type": ["integer", "null"], "minimum": 1 },
|
|
|
|
"publicIpConfigKey": { "description": "Config key that receives the server's public address.", "type": ["string", "null"] },
|
|
"maxPlayersConfigKey": { "description": "Config key locked to the pricing tier's player count.", "type": ["string", "null"] },
|
|
"mapConfigKey": { "type": ["string", "null"] },
|
|
|
|
"aiCoverPrompt": { "type": ["string", "null"] }
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": { "properties": { "installMethod": { "const": "STEAMCMD" } } },
|
|
"then": {
|
|
"required": ["installConfig"],
|
|
"properties": { "installConfig": { "type": "object", "required": ["appId"] } }
|
|
}
|
|
},
|
|
{
|
|
"if": { "properties": { "installMethod": { "const": "BASH_SCRIPT" } } },
|
|
"then": {
|
|
"required": ["installConfig"],
|
|
"properties": { "installConfig": { "type": "object", "required": ["script"] } }
|
|
}
|
|
}
|
|
]
|
|
}
|