feat: add various infrastructure check and automation scripts

This commit is contained in:
2026-11-15 17:17:41 -05:00
parent 336b7759d0
commit b301aa3ece
232 changed files with 8274 additions and 298 deletions

View File

@@ -65,8 +65,10 @@ def cmd_plan():
print(f" Save Dir: {server.get('saveDirectory')}")
print(f" Backup: {spec.get('backup', {}).get('schedule')} (Retention: {spec.get('backup', {}).get('retentionDays')}d)")
def cmd_generate_compose(output_path="docker-compose.yml"):
def cmd_generate_compose(output_path=None):
"""Generates standard docker-compose.yml from all declared seeds."""
if output_path is None:
output_path = Path(__file__).resolve().parent.parent / "docker-compose.yml"
seeds = load_seeds()
services = {}
@@ -85,31 +87,39 @@ def cmd_generate_compose(output_path="docker-compose.yml"):
save_dir = server.get("saveDirectory")
data_dir = f"/opt/game-servers/{name}/data"
mem_limit = str(res.get("memoryLimit", "8g")).lower().replace("gi", "g")
mem_res = str(res.get("memoryReservation", "4g")).lower().replace("gi", "g")
cpu_limit = str(res.get("cpuLimit", "4"))
volumes = runtime.get("volumes")
if not volumes:
volumes = [
f"{save_dir}:{save_dir}",
f"{data_dir}:/serverdata"
]
services[name] = {
"image": runtime.get("image"),
"container_name": f"gameseed-{name}",
"restart": runtime.get("restartPolicy", "unless-stopped"),
"env_file": [".env"],
"environment": runtime.get("environment", {}),
"ports": ports,
"volumes": [
f"{save_dir}:{save_dir}",
f"{data_dir}:/serverdata"
],
"volumes": volumes,
"deploy": {
"resources": {
"limits": {
"memory": res.get("memoryLimit", "8Gi"),
"cpus": res.get("cpuLimit", "4")
"memory": mem_limit,
"cpus": cpu_limit
},
"reservations": {
"memory": res.get("memoryReservation", "4Gi")
"memory": mem_res
}
}
}
}
compose = {
"version": "3.8",
"services": services
}

View File

@@ -28,7 +28,7 @@ spec:
memoryLimit: "16Gi"
memoryReservation: "8Gi"
runtime:
image: "skarab42/enshrouded-server:latest"
image: "indifferentbroccoli/enshrouded-server-docker:latest"
restartPolicy: unless-stopped
environment:
SERVER_NAME: "SnarfNet Enshrouded Sanctuary"

View File

@@ -20,20 +20,33 @@ spec:
ports:
- port: 10823
protocol: TCP
description: "Game Web Management & Client Connection"
description: "Game Client Connection"
- port: 10823
protocol: UDP
description: "Game Network Traffic"
- port: 8088
protocol: TCP
description: "Web Administration Panel"
- port: 5900
protocol: TCP
description: "Wine VNC Desktop"
resources:
cpuLimit: "6"
memoryLimit: "12Gi"
memoryReservation: "6Gi"
runtime:
image: "thijsvanloef/farming-simulator-25:latest"
image: "ghcr.io/nwerosama/farmsim-docker:fs25"
restartPolicy: unless-stopped
volumes:
- "/mnt/storage-games/installers/fs25/iso:/opt/fs25/install:ro"
- "/opt/game-servers/fs25/dlc:/opt/fs25/dlc:ro"
- "/opt/game-servers/fs25/docs:/opt/fs25/docs"
- "/opt/game-servers/fs25/wine:/home/nobody/.fs_server"
environment:
SERVER_NAME: "SnarfNet FS25 Countryside"
GAME_PORT: 10823
AUTOSTART_ENABLED: "true"
WEB_PORT: 8088
backup:
schedule: "0 4 * * *"
retentionDays: 14

View File

@@ -0,0 +1,54 @@
apiVersion: yggdrasil.snarfnet.net/v1alpha1
kind: GameSeed
metadata:
name: runescape-dragonwilds
displayName: "RuneScape: Dragonwilds Dedicated Server"
version: "1.0.0"
spec:
game:
appId: 4019830
branch: public
autoUpdate: true
server:
name: "SnarfNet Dragonwilds Sanctuary"
passwordSecret: "DRAGONWILDS_SERVER_PASSWORD"
adminPasswordSecret: "DRAGONWILDS_ADMIN_PASSWORD"
ownerIdSecret: "DRAGONWILDS_OWNER_ID"
maxPlayers: 6
saveDirectory: "/opt/game-servers/runescape-dragonwilds/server-files/RSDragonwilds/Saved/SaveGames"
network:
ip: "140.44.44.80"
ports:
- port: 7777
protocol: UDP
description: "Game Traffic Port"
- port: 8888
protocol: UDP
description: "Beacon & Query Port"
resources:
cpuLimit: "6"
memoryLimit: "12Gi"
memoryReservation: "6Gi"
runtime:
image: "indifferentbroccoli/runescape-dragonwilds-server-docker:latest"
restartPolicy: unless-stopped
volumes:
- "/opt/game-servers/runescape-dragonwilds/server-files:/home/steam/server-files"
environment:
PUID: 1000
PGID: 1000
SERVER_NAME: "SnarfNet Dragonwilds Sanctuary"
DEFAULT_WORLD_NAME: "SnarfWilds"
DEFAULT_PORT: 7777
BEACON_PORT: 8888
MAX_PLAYERS: 6
PLATFORM_POLICY: "Crossplay"
UPDATE_ON_START: "true"
OWNER_ID: "${DRAGONWILDS_OWNER_ID}"
ADMIN_PASSWORD: "${DRAGONWILDS_ADMIN_PASSWORD}"
WORLD_PASSWORD: "${DRAGONWILDS_SERVER_PASSWORD}"
backup:
schedule: "0 4 * * *" # Daily 04:00 AM
retentionDays: 14
targetPath: "/mnt/nas/game-backups/runescape-dragonwilds"

View File

@@ -29,7 +29,7 @@ spec:
memoryLimit: "8Gi"
memoryReservation: "4Gi"
runtime:
image: "sprits/stationeers-server:latest"
image: "didstopia/stationeers-server:latest"
restartPolicy: unless-stopped
environment:
SERVER_NAME: "SnarfNet Stationeers Moonbase"