Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/agent/core/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,18 @@ func run(ctx context.Context, c *cli.Command, backends []types.Backend) error {
log.Trace().Msg("use ssl for grpc")
}

skipInsecure := c.Bool("grpc-skip-insecure")
if c.IsSet("grpc-skip-insecure-deprecated") && !c.IsSet("grpc-skip-insecure") {
skipInsecure = c.Bool("grpc-skip-insecure-deprecated")
log.Warn().Msg("WOODPECKER_GRPC_VERIFY is deprecated, use WOODPECKER_GRPC_SKIP_VERIFY")
}

agentConn, err := agent_rpc.Dial(grpcClientCtx, agent_rpc.DialConfig{ //nolint:contextcheck
ServerAddr: c.String("server"),
AgentToken: c.String("grpc-token"),
AgentID: agentConfig.AgentID,
Secure: c.Bool("grpc-secure"),
SkipTLSVerify: c.Bool("grpc-skip-insecure"),
SkipTLSVerify: skipInsecure,
KeepaliveTime: c.Duration("grpc-keepalive-time"),
KeepaliveTimeout: c.Duration("grpc-keepalive-timeout"),
AuthRefreshEvery: authInterceptorRefreshInterval,
Expand Down
9 changes: 8 additions & 1 deletion cmd/agent/core/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,16 @@ var flags = []cli.Flag{
Usage: "should the connection to WOODPECKER_SERVER be made using a secure transport (tls)",
},
&cli.BoolFlag{
Sources: cli.EnvVars("WOODPECKER_GRPC_VERIFY"),
Sources: cli.EnvVars("WOODPECKER_GRPC_SKIP_VERIFY"),
Name: "grpc-skip-insecure",
Usage: "should the grpc server certificate be verified, only valid when WOODPECKER_GRPC_SECURE is true",
Value: true, // TODO change to false in next major to enable verification by default
},
// TODO remove this flag in next major
&cli.BoolFlag{
Sources: cli.EnvVars("WOODPECKER_GRPC_VERIFY"),
Name: "grpc-skip-insecure-deprecated",
Usage: "should the grpc server certificate be verified, only valid when WOODPECKER_GRPC_SECURE is true",
Value: true,
},
&cli.DurationFlag{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ If the agents establish a connection via the Internet, TLS encryption should be
environment:
- [...]
+ - WOODPECKER_GRPC_SECURE=true # defaults to false
+ - WOODPECKER_GRPC_VERIFY=true # default
+ - WOODPECKER_GRPC_SKIP_VERIFY=false # default
```

As agents execute pipeline steps as Docker containers, they require access to the Docker daemon of the host machine:
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/30-administration/10-configuration/30-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ Configures if the connection to `WOODPECKER_SERVER` should be made using a secur

---

### GRPC_VERIFY
### GRPC_SKIP_VERIFY

- Name: `WOODPECKER_GRPC_VERIFY`
- Name: `WOODPECKER_GRPC_SKIP_VERIFY`
- Default: `true`

Configures if the gRPC server certificate should be verified, only valid when `WOODPECKER_GRPC_SECURE` is `true`.
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ To enhance the usability of Woodpecker and meet evolving security standards, occ
### Admin-facing migrations

- changed env var `WOODPECKER_CONFIG_SERVICE_ENDPOINT` to `WOODPECKER_CONFIG_EXTENSION_ENDPOINT`
- changed env var `WOODPECKER_GRPC_VERIFY` to `WOODPECKER_GRPC_SKIP_VERIFY`. ⚠️ The env var was inverted before, the naming was fixed. Setting to `true` disables verification.

#### Extensions

Expand Down