mirror of
https://github.com/livekit/livekit.git
synced 2026-06-06 15:31:51 +00:00
allow keys to be passed in from env (again), cli to use LIVEKIT prefix
This commit is contained in:
@@ -28,12 +28,12 @@ var (
|
||||
}
|
||||
apiKeyFlag = &cli.StringFlag{
|
||||
Name: "api-key",
|
||||
EnvVars: []string{"LK_API_KEY"},
|
||||
EnvVars: []string{"LIVEKIT_API_KEY"},
|
||||
Required: true,
|
||||
}
|
||||
secretFlag = &cli.StringFlag{
|
||||
Name: "api-secret",
|
||||
EnvVars: []string{"LK_API_SECRET"},
|
||||
EnvVars: []string{"LIVEKIT_API_SECRET"},
|
||||
Required: true,
|
||||
}
|
||||
devFlag = &cli.BoolFlag{
|
||||
|
||||
@@ -42,6 +42,11 @@ func main() {
|
||||
Name: "key-file",
|
||||
Usage: "path to file that contains API keys/secrets",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "keys",
|
||||
Usage: "api keys (key: secret\\n)",
|
||||
EnvVars: []string{"LIVEKIT_KEYS"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "redis-host",
|
||||
Usage: "host (incl. port) to redis server",
|
||||
|
||||
@@ -64,6 +64,12 @@ func (conf *Config) UpdateFromCLI(c *cli.Context) error {
|
||||
if c.IsSet("key-file") {
|
||||
conf.KeyFile = c.String("key-file")
|
||||
}
|
||||
if c.IsSet("keys") {
|
||||
keys := []byte(c.String("keys"))
|
||||
if err := yaml.Unmarshal(keys, &conf.Keys); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if c.IsSet("redis-host") {
|
||||
conf.Redis.Address = c.String("redis-host")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user