1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-23 21:44:44 +02:00

Various enhancements in configuration (#1645)

- backends: move to cli flags instead of os.Getenv
- ssh: support 2fa with key and password
- allow to set grpc jwt secret (solves todo)
- allow to set default and max timeout (solves todo)

Closes https://github.com/woodpecker-ci/woodpecker/issues/896
Closes https://github.com/woodpecker-ci/woodpecker/issues/1131
This commit is contained in:
qwerty287
2023-03-19 20:24:43 +01:00
committed by GitHub
parent 56e6639396
commit f582ad3159
19 changed files with 221 additions and 104 deletions

View File

@@ -30,20 +30,20 @@ func Init(ctx context.Context) {
}
}
func FindEngine(engineName string) (types.Engine, error) {
func FindEngine(ctx context.Context, engineName string) (types.Engine, error) {
if engineName == "auto-detect" {
for _, engine := range engines {
if engine.IsAvailable() {
if engine.IsAvailable(ctx) {
return engine, nil
}
}
return nil, fmt.Errorf("Can't detect an available backend engine")
return nil, fmt.Errorf("can't detect an available backend engine")
}
engine, ok := enginesByName[engineName]
if !ok {
return nil, fmt.Errorf("Backend engine '%s' not found", engineName)
return nil, fmt.Errorf("backend engine '%s' not found", engineName)
}
return engine, nil