From fb6b0ad7c749323662841477c0b29fc1f6059e66 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 9 Dec 2024 19:26:59 -0800 Subject: [PATCH] cli flag for auth rpc host --- pkg/cmds/serve.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/cmds/serve.go b/pkg/cmds/serve.go index 32490cc..ae6b787 100644 --- a/pkg/cmds/serve.go +++ b/pkg/cmds/serve.go @@ -60,6 +60,12 @@ func NewServeCommand() *cli.Command { Value: 8080, EnvVars: []string{"PORT"}, }, + &cli.StringFlag{ + Name: "auth-rpc-host", + Usage: "Host of auth rpc", + EnvVars: []string{"AUTH_RPC_HOST"}, + Value: "auth-service:8090", + }, }, } } @@ -73,7 +79,7 @@ func serve(ctx *cli.Context) error { DB: db, } - conn, err := grpc.Dial("auth-service:8090", grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.Dial(ctx.String("auth-rpc-host"), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { log.Fatal(err) }