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{
|
apiKeyFlag = &cli.StringFlag{
|
||||||
Name: "api-key",
|
Name: "api-key",
|
||||||
EnvVars: []string{"LK_API_KEY"},
|
EnvVars: []string{"LIVEKIT_API_KEY"},
|
||||||
Required: true,
|
Required: true,
|
||||||
}
|
}
|
||||||
secretFlag = &cli.StringFlag{
|
secretFlag = &cli.StringFlag{
|
||||||
Name: "api-secret",
|
Name: "api-secret",
|
||||||
EnvVars: []string{"LK_API_SECRET"},
|
EnvVars: []string{"LIVEKIT_API_SECRET"},
|
||||||
Required: true,
|
Required: true,
|
||||||
}
|
}
|
||||||
devFlag = &cli.BoolFlag{
|
devFlag = &cli.BoolFlag{
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ func main() {
|
|||||||
Name: "key-file",
|
Name: "key-file",
|
||||||
Usage: "path to file that contains API keys/secrets",
|
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{
|
&cli.StringFlag{
|
||||||
Name: "redis-host",
|
Name: "redis-host",
|
||||||
Usage: "host (incl. port) to redis server",
|
Usage: "host (incl. port) to redis server",
|
||||||
|
|||||||
@@ -64,6 +64,12 @@ func (conf *Config) UpdateFromCLI(c *cli.Context) error {
|
|||||||
if c.IsSet("key-file") {
|
if c.IsSet("key-file") {
|
||||||
conf.KeyFile = c.String("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") {
|
if c.IsSet("redis-host") {
|
||||||
conf.Redis.Address = c.String("redis-host")
|
conf.Redis.Address = c.String("redis-host")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user