feat: overhaul server automation, files editor, and CS2 setup workflows

This commit is contained in:
2026-02-26 21:01:00 +00:00
parent 44c439e2f9
commit 2a3ad5e78f
40 changed files with 4675 additions and 468 deletions
@@ -0,0 +1,36 @@
ALTER TABLE "games"
ADD COLUMN IF NOT EXISTS "automation_rules" jsonb DEFAULT '[]'::jsonb NOT NULL;
UPDATE "games"
SET
"automation_rules" = '[
{
"id": "cs2-install-latest-counterstrikesharp-runtime",
"event": "server.install.completed",
"enabled": true,
"runOncePerServer": true,
"continueOnError": false,
"actions": [
{
"id": "install-cs2-runtime",
"type": "github_release_extract",
"owner": "roflmuffin",
"repo": "CounterStrikeSharp",
"assetNamePatterns": [
"^counterstrikesharp-with-runtime-.*linux.*\\\\.zip$",
"^counterstrikesharp-with-runtime.*\\\\.zip$"
],
"destination": "/game/csgo",
"stripComponents": 0,
"maxBytes": 268435456
}
]
}
]'::jsonb,
"updated_at" = now()
WHERE
"slug" = 'cs2'
AND (
"automation_rules" IS NULL
OR "automation_rules" = '[]'::jsonb
);
@@ -0,0 +1,35 @@
WITH metamod_rule AS (
SELECT '[
{
"id": "cs2-install-latest-metamod",
"event": "server.install.completed",
"enabled": true,
"runOncePerServer": true,
"continueOnError": false,
"actions": [
{
"id": "install-cs2-metamod",
"type": "http_directory_extract",
"indexUrl": "https://mms.alliedmods.net/mmsdrop/2.0/",
"assetNamePattern": "^mmsource-2\\.0\\.0-git\\d+-linux\\.tar\\.gz$",
"destination": "/game/csgo",
"stripComponents": 0,
"maxBytes": 268435456
}
]
}
]'::jsonb AS rule
)
UPDATE "games" g
SET
"automation_rules" = CASE
WHEN g."automation_rules" IS NULL OR jsonb_typeof(g."automation_rules") <> 'array'
THEN (SELECT rule FROM metamod_rule)
ELSE g."automation_rules" || (SELECT rule FROM metamod_rule)
END,
"updated_at" = now()
WHERE
g."slug" = 'cs2'
AND NOT (
COALESCE(g."automation_rules", '[]'::jsonb) @> '[{"id":"cs2-install-latest-metamod"}]'::jsonb
);
@@ -0,0 +1,27 @@
{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1771748754705,
"tag": "0000_red_sunset_bain",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1772200000000,
"tag": "0001_game_automation_rules",
"breakpoints": true
},
{
"idx": 2,
"version": "7",
"when": 1772300000000,
"tag": "0002_cs2_add_metamod_workflow",
"breakpoints": true
}
]
}