feat: Add companion agent one-click deployment + fix frontend TS errors
All checks were successful
Build Companion Agent / build (push) Successful in 30s
Test Asgard Runner / test (push) Successful in 3s

Go deployment orchestrator with platform-specific SteamCMD install,
Rust server download, server.cfg generation, and service registration.
Wire deploy command subscription in daemon, make GameServerPath optional,
add InstallDir config with OS-aware defaults. Fix unused imports and
WebSocket subscribe API in ServerView.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell
2026-02-21 14:49:48 -05:00
parent b94717d51b
commit 358adde496
7 changed files with 628 additions and 20 deletions

View File

@@ -5,6 +5,7 @@ import (
"log"
"os"
"os/signal"
"runtime"
"syscall"
"time"
@@ -24,9 +25,12 @@ type Config struct {
// Game server configuration
SteamCMDPath string `envconfig:"STEAMCMD_PATH" default:"/usr/games/steamcmd"`
GameServerPath string `envconfig:"GAME_SERVER_PATH" required:"true"`
GameServerPath string `envconfig:"GAME_SERVER_PATH" default:""`
GameServerArgs string `envconfig:"GAME_SERVER_ARGS" default:"-batchmode"`
// Install directory for deployment
InstallDir string `envconfig:"INSTALL_DIR" default:""`
// Optional settings
HeartbeatInterval int `envconfig:"HEARTBEAT_INTERVAL" default:"60"`
LogLevel string `envconfig:"LOG_LEVEL" default:"info"`
@@ -44,11 +48,21 @@ func main() {
log.Fatalf("Failed to load configuration: %v", err)
}
// Set default InstallDir based on OS if not configured
if cfg.InstallDir == "" {
if runtime.GOOS == "windows" {
cfg.InstallDir = `C:\RustServer`
} else {
cfg.InstallDir = "/opt/rustserver"
}
}
log.Printf("Configuration loaded:")
log.Printf(" NATS URL: %s", cfg.NATSUrl)
log.Printf(" License ID: %s", cfg.LicenseID)
log.Printf(" Game Server Path: %s", cfg.GameServerPath)
log.Printf(" SteamCMD Path: %s", cfg.SteamCMDPath)
log.Printf(" Install Dir: %s", cfg.InstallDir)
log.Printf(" Heartbeat Interval: %ds", cfg.HeartbeatInterval)
// Create context with signal handling for graceful shutdown
@@ -73,6 +87,7 @@ func main() {
GameServerPath: cfg.GameServerPath,
GameServerArgs: cfg.GameServerArgs,
Version: version,
InstallDir: cfg.InstallDir,
}
// Start daemon