podterminal/main.go

34 lines
509 B
Go
Raw Permalink 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)
// prevent main thread from dying
if err := g.Wait(); err != nil {
log.Fatal(err)
}
2024-01-27 11:20:40 +01:00
}