mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-25 00:29:27 +00:00
Add flag for specific grpc server addr (#295)
Adding flag to server for setting up listen addr of grpc: --grpc-addr / $WOODPECKER_GRPC_ADDR
This commit is contained in:
parent
d15769b17a
commit
cf19b41ad4
2 changed files with 7 additions and 1 deletions
|
@ -47,6 +47,12 @@ var flags = []cli.Flag{
|
||||||
Name: "server-key",
|
Name: "server-key",
|
||||||
Usage: "server ssl key path",
|
Usage: "server ssl key path",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
EnvVar: "WOODPECKER_GRPC_ADDR",
|
||||||
|
Name: "grpc-addr",
|
||||||
|
Usage: "grpc address",
|
||||||
|
Value: ":9000",
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
EnvVar: "DRONE_LETS_ENCRYPT,WOODPECKER_LETS_ENCRYPT",
|
EnvVar: "DRONE_LETS_ENCRYPT,WOODPECKER_LETS_ENCRYPT",
|
||||||
Name: "lets-encrypt",
|
Name: "lets-encrypt",
|
||||||
|
|
|
@ -108,7 +108,7 @@ func server(c *cli.Context) error {
|
||||||
// start the grpc server
|
// start the grpc server
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
|
|
||||||
lis, err := net.Listen("tcp", ":9000")
|
lis, err := net.Listen("tcp", c.String("grpc-addr"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue