Enable passing in local IP, refactored IP detection (#48)

* Enable passing in local IP, refactored IP detection

* update docker server instructions
This commit is contained in:
David Zhao
2021-07-11 08:42:11 -07:00
committed by GitHub
parent 4c54234954
commit a80e8cf69f
13 changed files with 199 additions and 129 deletions
+8 -11
View File
@@ -53,6 +53,11 @@ func main() {
Usage: "api keys (key: secret\\n)",
EnvVars: []string{"LIVEKIT_KEYS"},
},
&cli.StringFlag{
Name: "node-ip",
Usage: "IP address of the current node, used to advertise to clients. Automatically determined by default",
EnvVars: []string{"NODE_IP"},
},
&cli.StringFlag{
Name: "redis-host",
Usage: "host (incl. port) to redis server",
@@ -130,15 +135,7 @@ func getConfig(c *cli.Context) (*config.Config, error) {
return nil, err
}
conf, err := config.NewConfig(confString)
if err != nil {
return nil, err
}
if err = conf.UpdateFromCLI(c); err != nil {
return nil, err
}
return conf, nil
return config.NewConfig(confString, c)
}
func startServer(c *cli.Context) error {
@@ -177,8 +174,8 @@ func startServer(c *cli.Context) error {
defer func() {
// run memory profile at termination
runtime.GC()
pprof.WriteHeapProfile(f)
f.Close()
_ = pprof.WriteHeapProfile(f)
_ = f.Close()
}()
}
}