web frontend for git repositories, written in Go git.pocka.jp/legit.git
3

Configure Feed

Select the types of activity you want to include in your feed.

Add -server.host and -server.port CLI flags

This is handy for development inside a container / VM.

Shota FUJI (Jul 11, 2026, 9:25 PM +0900) 932dc3e7 fbc46772

+17
+17
main.go
··· 4 4 "flag" 5 5 "fmt" 6 6 "log" 7 + "math" 7 8 "net/http" 8 9 9 10 "github.com/pocka/legit/config" ··· 12 13 13 14 func main() { 14 15 var cfg string 16 + var host string 17 + var port uint 15 18 flag.StringVar(&cfg, "config", "./config.yaml", "path to config file") 19 + flag.StringVar(&host, "server.host", "", "override server.host config") 20 + flag.UintVar(&port, "server.port", 0, "override server.port config") 16 21 flag.Parse() 17 22 18 23 c, err := config.Read(cfg) 19 24 if err != nil { 20 25 log.Fatal(err) 26 + } 27 + 28 + if port > 0 { 29 + if port > math.MaxUint16 { 30 + log.Fatalf("server.port should be in 0 < x <= %d range", math.MaxUint16) 31 + } 32 + 33 + c.Server.Port = int(port) 34 + } 35 + 36 + if host != "" { 37 + c.Server.Host = host 21 38 } 22 39 23 40 if err := UnveilPaths([]string{