podterminal/main.go

35 lines
539 B
Go
Raw Normal View History

2024-01-27 11:20:40 +01:00
package main
import (
"log"
"golang.org/x/sync/errgroup"
2024-01-27 11:20:40 +01:00
"git.jmbit.de/jmb/podterminal/pods"
"git.jmbit.de/jmb/podterminal/utils"
"git.jmbit.de/jmb/podterminal/web"
)
var (
g errgroup.Group
)
2024-01-27 11:20:40 +01:00
func main() {
readConfigFile()
2024-01-27 11:20:40 +01:00
pods.ConnectSocket()
// Start Webserver
g.Go(web.Run)
2024-01-27 11:20:40 +01:00
utils.DropPrivileges("podterminal")
log.Println("Dropped Privileges")
g.Go(pods.GarbageCollector)
g.Go(pods.PullImage)
2024-02-03 11:11:10 +01:00
g.Go(web.IdleSessionCleanup)
// prevent main thread from dying
if err := g.Wait(); err != nil {
log.Fatal(err)
}
2024-01-27 11:20:40 +01:00
}