config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureMetaConfig

func EnsureMetaConfig(db *gorm.DB, cfg *Config) error

EnsureMetaConfig seeds meta_config from cfg if not present.

func EnsureServerConfig

func EnsureServerConfig(db *gorm.DB, serverID uint, cfg *Config) error

EnsureServerConfig seeds server_config for serverID if not present.

func UpdateMetaConfig

func UpdateMetaConfig(db *gorm.DB, m *MetaConfig) error

UpdateMetaConfig updates meta_config in DB.

Types

type Config

type Config struct {
	Host           string
	MumblePort     int
	RESTPort       int
	FrontendEmbed  bool
	DatabasePath   string
	SSLCertPath    string
	SSLKeyPath     string
	MaxUsers       int
	MaxBandwidth   int
	LogLevel       string
	JWTIssuer      string
	JWTAudience    string
	JWTExpiryDays  int
	ChannelDepth   int
	ChannelCount   int
	WelcomeText    string
	ServerPassword string
	DefaultChannel int
	CertRequired   bool
	Bonjour        bool
	RegisterName   string
	VoiceDebug     bool
}

Config holds the server configuration.

func ConfigForServer

func ConfigForServer(meta *MetaConfig, server *ServerConfigData, bootstrap *Config) *Config

ConfigForServer builds a full Config from meta + server config for Mumble protocol use.

func Load

func Load(path string) (*Config, error)

Load reads configuration with precedence: file (if path set) < env (MUMBLE_*) < defaults. Flags (e.g. -frontend-embed) are applied by the caller after Load.

type MetaConfig

type MetaConfig struct {
	Host          string
	MumblePort    int
	RESTPort      int
	Bonjour       bool
	RegisterName  string
	JWTIssuer     string
	JWTAudience   string
	JWTExpiryDays int
}

MetaConfig holds process-level config loaded from DB.

func LoadMetaConfig

func LoadMetaConfig(db *gorm.DB) (*MetaConfig, error)

LoadMetaConfig loads meta_config from DB (row ID 1).

type ServerConfigData

type ServerConfigData struct {
	MaxUsers            int
	MaxBandwidth        int
	WelcomeText         string
	ServerPassword      string
	DefaultChannel      int
	CertRequired        bool
	ChannelNestingLimit int
	ChannelCountLimit   int
	VoiceDebug          bool
}

ServerConfigData holds per-virtual-server config from DB.

func DefaultServerConfig

func DefaultServerConfig() *ServerConfigData

DefaultServerConfig returns default server config values.

func LoadServerConfig

func LoadServerConfig(db *gorm.DB, serverID uint) (*ServerConfigData, error)

LoadServerConfig loads per-server config from DB.

Jump to

Keyboard shortcuts

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