From ec9d02ec3822cc7b181864d83a7d49fd9774d3a6 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 30 Apr 2020 15:49:00 +0800 Subject: [PATCH] missing Ciphers config Signed-off-by: Bo-Yi Wu --- go.mod | 2 +- go.sum | 4 ++-- main.go | 7 +++++++ plugin.go | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 368a647..7221424 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/appleboy/drone-ssh go 1.14 require ( - github.com/appleboy/easyssh-proxy v1.3.3 + github.com/appleboy/easyssh-proxy v1.3.4 github.com/joho/godotenv v1.3.0 github.com/stretchr/testify v1.3.0 github.com/urfave/cli v1.22.4 diff --git a/go.sum b/go.sum index 3bccb02..d210d25 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/ScaleFT/sshkeys v0.0.0-20181112160850-82451a803681 h1:JS2rl38kZmHgWa0xINSaSYH0Whtvem64/4+Ef0+Y5pE= github.com/ScaleFT/sshkeys v0.0.0-20181112160850-82451a803681/go.mod h1:WfDateMPQ/55dPbZRp5Zxrux5WiEaHsjk9puUhz0KgY= -github.com/appleboy/easyssh-proxy v1.3.3 h1:x++oaFLft5hWjAli7IgALQr+OwrzmXzHmLdPrjTRE2w= -github.com/appleboy/easyssh-proxy v1.3.3/go.mod h1:Kk57I3w7OCafOjp5kgZFvxk2fO8Tca5CriBTOsbSbjY= +github.com/appleboy/easyssh-proxy v1.3.4 h1:yNgzsJ9qaDNGzQILDXEK4boioJMmUUaTUsxYtCTSGqo= +github.com/appleboy/easyssh-proxy v1.3.4/go.mod h1:Kk57I3w7OCafOjp5kgZFvxk2fO8Tca5CriBTOsbSbjY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= diff --git a/main.go b/main.go index 0c00a49..26f5d98 100644 --- a/main.go +++ b/main.go @@ -151,6 +151,12 @@ func main() { Usage: "proxy connection timeout", EnvVar: "PLUGIN_PROXY_TIMEOUT,PROXY_SSH_TIMEOUT,INPUT_PROXY_TIMEOUT", }, + cli.StringSliceFlag{ + Name: "proxy.ciphers", + Usage: "The allowed cipher algorithms. If unspecified then a sensible", + EnvVar: "PLUGIN_PROXY_CIPHERS,SSH_PROXY_CIPHERS,PROXY_CIPHERS,INPUT_PROXY_CIPHERS", + Value: &defaultCiphers, + }, cli.StringSliceFlag{ Name: "envs", Usage: "pass environment variable to shell script", @@ -232,6 +238,7 @@ func run(c *cli.Context) error { Server: c.String("proxy.host"), Port: c.String("proxy.port"), Timeout: c.Duration("proxy.timeout"), + Ciphers: c.StringSlice("proxy.ciphers"), }, }, Writer: os.Stdout, diff --git a/plugin.go b/plugin.go index d091429..09186fb 100644 --- a/plugin.go +++ b/plugin.go @@ -73,7 +73,7 @@ func (p Plugin) exec(host string, wg *sync.WaitGroup, errChannel chan error) { KeyPath: p.Config.Proxy.KeyPath, Passphrase: p.Config.Proxy.Passphrase, Timeout: p.Config.Proxy.Timeout, - Ciphers: p.Config.Ciphers, + Ciphers: p.Config.Proxy.Ciphers, }, }