All checks were successful
Test Asgard Runner / test (push) Successful in 2s
New oxide package downloads latest Oxide.Rust release from GitHub,
extracts over the server directory, and restarts the game server.
Progress published to NATS (corrosion.{license_id}.oxide.status).
Heartbeat now reports oxide_installed status.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
package oxide
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
// OxideStatus represents a progress update published to NATS during Oxide installation.
|
|
// The frontend listens on corrosion.{license_id}.oxide.status for these messages.
|
|
type OxideStatus struct {
|
|
Stage string `json:"stage"`
|
|
Progress int `json:"progress"`
|
|
Message string `json:"message"`
|
|
Error string `json:"error,omitempty"`
|
|
Timestamp string `json:"timestamp"`
|
|
}
|
|
|
|
// Valid installation stages:
|
|
// fetching_release - Querying GitHub API for latest Oxide.Rust release
|
|
// downloading - Downloading the Oxide zip file
|
|
// installing - Extracting zip over server directory
|
|
// restarting - Restarting the game server to load Oxide
|
|
// complete - Oxide installation finished successfully
|
|
// failed - Installation failed at some stage
|
|
|
|
// CheckOxideInstalled returns true if the oxide/ directory exists in the
|
|
// server installation directory, indicating that Oxide/uMod has been installed.
|
|
func CheckOxideInstalled(installDir string) bool {
|
|
_, err := os.Stat(filepath.Join(installDir, "server", "oxide"))
|
|
return err == nil
|
|
}
|