Rename group package and defaults to halls

This commit is contained in:
Storm Dragon
2026-05-17 22:37:38 -04:00
parent 55528b8e62
commit a8ada950d5
26 changed files with 459 additions and 459 deletions
+14 -14
View File
@@ -15,7 +15,7 @@ import (
"time"
"git.stormux.org/storm/skald/diskwriter"
"git.stormux.org/storm/skald/group"
"git.stormux.org/storm/skald/hall"
"git.stormux.org/storm/skald/ice"
"git.stormux.org/storm/skald/limit"
"git.stormux.org/storm/skald/token"
@@ -32,10 +32,10 @@ func main() {
"web server root `directory`")
flag.BoolVar(&webserver.Insecure, "insecure", false,
"act as an HTTP server rather than HTTPS")
flag.StringVar(&group.DataDirectory, "data", "./data/",
flag.StringVar(&hall.DataDirectory, "data", "./data/",
"data `directory`")
flag.StringVar(&group.Directory, "groups", "./groups/",
"group description `directory`")
flag.StringVar(&hall.Directory, "halls", "./halls/",
"hall description `directory`")
flag.StringVar(&diskwriter.Directory, "recordings", "./recordings/",
"recordings `directory`")
flag.StringVar(&cpuprofile, "cpuprofile", "",
@@ -46,7 +46,7 @@ func main() {
"store mutex profile in `file`")
flag.StringVar(&udpRange, "udp-range", "",
"UDP `port` (multiplexing) or port1-port2 (range)")
flag.BoolVar(&group.UseMDNS, "mdns", false, "gather mDNS addresses")
flag.BoolVar(&hall.UseMDNS, "mdns", false, "gather mDNS addresses")
flag.BoolVar(&ice.ICERelayOnly, "relay-only", false,
"require use of TURN relays for all media traffic")
flag.StringVar(&turnserver.Address, "turn", "auto",
@@ -63,14 +63,14 @@ func main() {
if n != 2 || min <= 0 || max <= 0 || min > max {
log.Fatalf("UDP range: bad range")
}
group.UDPMin = min
group.UDPMax = max
hall.UDPMin = min
hall.UDPMax = max
} else {
port, err := strconv.Atoi(udpRange)
if err != nil {
log.Fatalf("UDP: %v", err)
}
err = group.SetUDPMux(port)
err = hall.SetUDPMux(port)
if err != nil {
log.Fatalf("UDP: %v", err)
}
@@ -122,22 +122,22 @@ func main() {
log.Printf("File descriptor limit is %v, please increase it!", n)
}
ice.ICEFilename = filepath.Join(group.DataDirectory, "ice-servers.json")
ice.ICEFilename = filepath.Join(hall.DataDirectory, "ice-servers.json")
token.SetStatefulFilename(
filepath.Join(
filepath.Join(group.DataDirectory, "var"),
filepath.Join(hall.DataDirectory, "var"),
"tokens.jsonl",
),
)
// make sure the list of public groups is updated early
go group.Update()
// make sure the list of public halls is updated early
go hall.Update()
// causes the built-in server to start if required
ice.Update()
defer turnserver.Stop()
err = webserver.Serve(httpAddr, group.DataDirectory)
err = webserver.Serve(httpAddr, hall.DataDirectory)
if err != nil {
log.Fatalf("Server: %v", err)
}
@@ -157,7 +157,7 @@ func main() {
select {
case <-ticker.C:
go func() {
group.Update()
hall.Update()
token.Expire()
}()
case <-slowTicker.C: