config

package
v5.3.1-alpha1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// All configuration variables can be found in vars.go
	Version = "5.2.5"
	Branch  = "nightly-fixes"
)
View Source
var (
	ServerName       string
	ServerMaxPlayers string
	ServerPassword   string
	ServerAuthSecret string
	AdminPassword    string
	GamePort         string
	UpdatePort       string
	LocalIpAddress   string
	ServerVisible    bool
	UseSteamP2P      bool
	AdditionalParams string
	UPNPEnabled      bool
	StartLocalHost   bool
	WorldName        string
	BackupWorldName  string
	SaveInfo         string
	SaveInterval     string
	AutoPauseServer  bool
	AutoSave         bool
)

Game Server configuration

View Source
var (
	IsDebugMode          bool //only used for pprof server, keep it like this and check the log level instead. Debug = 10
	CreateSSUILogFile    bool
	LogLevel             int
	LogMessageBuffer     string
	IsFirstTimeSetup     bool
	BufferFlushTicker    *time.Ticker
	SSEMessageBufferSize = 2000
	MaxSSEConnections    = 20
	GameServerAppID      = "600760"
	ExePath              string
	GameBranch           string
	SubsystemFilters     []string
)

Logging, debugging and misc

View Source
var (
	DiscordToken            string
	DiscordSession          *discordgo.Session
	IsDiscordEnabled        bool
	ControlChannelID        string
	StatusChannelID         string
	LogChannelID            string
	ErrorChannelID          string
	ConnectionListChannelID string
	SaveChannelID           string
	ControlPanelChannelID   string
	DiscordCharBufferSize   int
	ControlMessageID        string
	ExceptionMessageID      string
	BlackListFilePath       string
)

Discord integration

View Source
var (
	IsCleanupEnabled        bool
	BackupKeepLastN         int
	BackupKeepDailyFor      time.Duration
	BackupKeepWeeklyFor     time.Duration
	BackupKeepMonthlyFor    time.Duration
	BackupCleanupInterval   time.Duration
	ConfiguredBackupDir     string
	ConfiguredSafeBackupDir string
	BackupWaitTime          time.Duration
)

Backup and cleanup settings

View Source
var (
	AuthEnabled       bool
	JwtKey            string
	AuthTokenLifetime int
	Users             map[string]string
)

Authentication and security

View Source
var (
	IsUpdateEnabled        bool
	AllowPrereleaseUpdates bool
	AllowMajorUpdates      bool
)

SSUI Updates

View Source
var (
	TLSCertPath              = "./UIMod/tls/cert.pem"
	TLSKeyPath               = "./UIMod/tls/key.pem"
	ConfigPath               = "./UIMod/config/config.json"
	CustomDetectionsFilePath = "./UIMod/detectionmanager/customdetections.json"
	LogFolder                = "./UIMod/logs/"
	UIModFolder              = "./UIMod/"
	TwoBoxFormFolder         = "./UIMod/twoboxform/"
	ConfigHtmlPath           = "./UIMod/ui/config.html"
	DetectionManagerHtmlPath = "./UIMod/detectionmanager/detectionmanager.html"
	TwoBoxFormHtmlPath       = "./UIMod/twoboxform/twoboxform.html"
	IndexHtmlPath            = "./UIMod/ui/index.html"
)

File paths

View Source
var ConfigMu sync.Mutex

Functions

This section is empty.

Types

type CustomDetection

type CustomDetection struct {
	ID        string `json:"id"`
	Type      string `json:"type"`
	Pattern   string `json:"pattern"`
	EventType string `json:"eventType"`
	Message   string `json:"message"`
}

type JsonConfig

type JsonConfig struct {
	DiscordToken            string            `json:"discordToken"`
	ControlChannelID        string            `json:"controlChannelID"`
	StatusChannelID         string            `json:"statusChannelID"`
	ConnectionListChannelID string            `json:"connectionListChannelID"`
	LogChannelID            string            `json:"logChannelID"`
	SaveChannelID           string            `json:"saveChannelID"`
	ControlPanelChannelID   string            `json:"controlPanelChannelID"`
	DiscordCharBufferSize   int               `json:"DiscordCharBufferSize"`
	BlackListFilePath       string            `json:"blackListFilePath"`
	IsDiscordEnabled        *bool             `json:"isDiscordEnabled"`
	ErrorChannelID          string            `json:"errorChannelID"`
	BackupKeepLastN         int               `json:"backupKeepLastN"`
	IsCleanupEnabled        *bool             `json:"isCleanupEnabled"`
	BackupKeepDailyFor      int               `json:"backupKeepDailyFor"`
	BackupKeepWeeklyFor     int               `json:"backupKeepWeeklyFor"`
	BackupKeepMonthlyFor    int               `json:"backupKeepMonthlyFor"`
	BackupCleanupInterval   int               `json:"backupCleanupInterval"`
	BackupWaitTime          int               `json:"backupWaitTime"`
	GameBranch              string            `json:"gameBranch"`
	ServerName              string            `json:"ServerName"`
	SaveInfo                string            `json:"SaveInfo"`
	ServerMaxPlayers        string            `json:"ServerMaxPlayers"`
	ServerPassword          string            `json:"ServerPassword"`
	ServerAuthSecret        string            `json:"ServerAuthSecret"`
	AdminPassword           string            `json:"AdminPassword"`
	GamePort                string            `json:"GamePort"`
	UpdatePort              string            `json:"UpdatePort"`
	UPNPEnabled             *bool             `json:"UPNPEnabled"`
	AutoSave                *bool             `json:"AutoSave"`
	SaveInterval            string            `json:"SaveInterval"`
	AutoPauseServer         *bool             `json:"AutoPauseServer"`
	LocalIpAddress          string            `json:"LocalIpAddress"`
	StartLocalHost          *bool             `json:"StartLocalHost"`
	ServerVisible           *bool             `json:"ServerVisible"`
	UseSteamP2P             *bool             `json:"UseSteamP2P"`
	ExePath                 string            `json:"ExePath"`
	AdditionalParams        string            `json:"AdditionalParams"`
	Users                   map[string]string `json:"users"`       // Map of username to hashed password
	AuthEnabled             *bool             `json:"authEnabled"` // Toggle for enabling/disabling auth
	JwtKey                  string            `json:"JwtKey"`
	AuthTokenLifetime       int               `json:"AuthTokenLifetime"`
	Debug                   *bool             `json:"Debug"`
	CreateSSUILogFile       *bool             `json:"CreateSSUILogFile"`
	LogLevel                int               `json:"LogLevel"`
	SubsystemFilters        []string          `json:"subsystemFilters"`
	IsUpdateEnabled         *bool             `json:"IsUpdateEnabled"`
	AllowPrereleaseUpdates  *bool             `json:"AllowPrereleaseUpdates"`
	AllowMajorUpdates       *bool             `json:"AllowMajorUpdates"`
}

func LoadConfig

func LoadConfig() (*JsonConfig, error)

LoadConfig loads and initializes the configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL