mirror of
				https://github.com/appleboy/drone-ssh.git
				synced 2025-10-29 00:51:15 +08:00 
			
		
		
		
	chore(cli): upgrade urfave/cli to v2 (#152)
This commit is contained in:
		
							parent
							
								
									59b08e1b4c
								
							
						
					
					
						commit
						d83798f25b
					
				
							
								
								
									
										3
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								go.mod
									
									
									
									
									
								
							| @ -6,7 +6,7 @@ require ( | |||||||
| 	github.com/appleboy/easyssh-proxy v1.3.9 | 	github.com/appleboy/easyssh-proxy v1.3.9 | ||||||
| 	github.com/joho/godotenv v1.4.0 | 	github.com/joho/godotenv v1.4.0 | ||||||
| 	github.com/stretchr/testify v1.8.1 | 	github.com/stretchr/testify v1.8.1 | ||||||
| 	github.com/urfave/cli v1.22.10 | 	github.com/urfave/cli/v2 v2.23.7 | ||||||
| 	golang.org/x/crypto v0.4.0 | 	golang.org/x/crypto v0.4.0 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -17,6 +17,7 @@ require ( | |||||||
| 	github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect | 	github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect | ||||||
| 	github.com/pmezard/go-difflib v1.0.0 // indirect | 	github.com/pmezard/go-difflib v1.0.0 // indirect | ||||||
| 	github.com/russross/blackfriday/v2 v2.1.0 // indirect | 	github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||||||
|  | 	github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect | ||||||
| 	golang.org/x/sys v0.3.0 // indirect | 	golang.org/x/sys v0.3.0 // indirect | ||||||
| 	gopkg.in/yaml.v3 v3.0.1 // indirect | 	gopkg.in/yaml.v3 v3.0.1 // indirect | ||||||
| ) | ) | ||||||
|  | |||||||
							
								
								
									
										10
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								go.sum
									
									
									
									
									
								
							| @ -1,10 +1,8 @@ | |||||||
| github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= |  | ||||||
| github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o= | github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o= | ||||||
| github.com/ScaleFT/sshkeys v1.2.0 h1:5BRp6rTVIhJzXT3VcUQrKgXR8zWA3sOsNeuyW15WUA8= | github.com/ScaleFT/sshkeys v1.2.0 h1:5BRp6rTVIhJzXT3VcUQrKgXR8zWA3sOsNeuyW15WUA8= | ||||||
| github.com/ScaleFT/sshkeys v1.2.0/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o= | github.com/ScaleFT/sshkeys v1.2.0/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o= | ||||||
| github.com/appleboy/easyssh-proxy v1.3.9 h1:b+sVSTz+cVFvfA23HQywMMpm0s5g3gH7jYdBcQqaCQI= | github.com/appleboy/easyssh-proxy v1.3.9 h1:b+sVSTz+cVFvfA23HQywMMpm0s5g3gH7jYdBcQqaCQI= | ||||||
| github.com/appleboy/easyssh-proxy v1.3.9/go.mod h1:G1eQomBEME7NWKA3hE49s5HsT44S5fn0aBxX7k9Yjug= | github.com/appleboy/easyssh-proxy v1.3.9/go.mod h1:G1eQomBEME7NWKA3hE49s5HsT44S5fn0aBxX7k9Yjug= | ||||||
| github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= |  | ||||||
| github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= | github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= | ||||||
| github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | ||||||
| github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||||||
| @ -16,10 +14,8 @@ github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= | |||||||
| github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= | github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= | ||||||
| github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||||||
| github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||||||
| github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= |  | ||||||
| github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= | github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= | ||||||
| github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= | github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= | ||||||
| github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= |  | ||||||
| github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||||||
| github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= | ||||||
| github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= | github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= | ||||||
| @ -29,8 +25,10 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ | |||||||
| github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= | ||||||
| github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= | github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= | ||||||
| github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= | github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= | ||||||
| github.com/urfave/cli v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk= | github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY= | ||||||
| github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= | github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= | ||||||
|  | github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= | ||||||
|  | github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= | ||||||
| golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | ||||||
| golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= | golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= | ||||||
| golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= | golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= | ||||||
|  | |||||||
							
								
								
									
										245
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										245
									
								
								main.go
									
									
									
									
									
								
							| @ -7,7 +7,8 @@ import ( | |||||||
| 
 | 
 | ||||||
| 	"github.com/appleboy/easyssh-proxy" | 	"github.com/appleboy/easyssh-proxy" | ||||||
| 	"github.com/joho/godotenv" | 	"github.com/joho/godotenv" | ||||||
| 	"github.com/urfave/cli" | 	_ "github.com/joho/godotenv/autoload" | ||||||
|  | 	"github.com/urfave/cli/v2" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| // Version set at compile-time
 | // Version set at compile-time
 | ||||||
| @ -27,7 +28,7 @@ func main() { | |||||||
| 	app.Name = "Drone SSH" | 	app.Name = "Drone SSH" | ||||||
| 	app.Usage = "Executing remote ssh commands" | 	app.Usage = "Executing remote ssh commands" | ||||||
| 	app.Copyright = "Copyright (c) 2019 Bo-Yi Wu" | 	app.Copyright = "Copyright (c) 2019 Bo-Yi Wu" | ||||||
| 	app.Authors = []cli.Author{ | 	app.Authors = []*cli.Author{ | ||||||
| 		{ | 		{ | ||||||
| 			Name:  "Bo-Yi Wu", | 			Name:  "Bo-Yi Wu", | ||||||
| 			Email: "appleboy.tw@gmail.com", | 			Email: "appleboy.tw@gmail.com", | ||||||
| @ -36,157 +37,157 @@ func main() { | |||||||
| 	app.Action = run | 	app.Action = run | ||||||
| 	app.Version = Version | 	app.Version = Version | ||||||
| 	app.Flags = []cli.Flag{ | 	app.Flags = []cli.Flag{ | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "ssh-key", | 			Name:    "ssh-key", | ||||||
| 			Usage:  "private ssh key", | 			Usage:   "private ssh key", | ||||||
| 			EnvVar: "PLUGIN_SSH_KEY,PLUGIN_KEY,SSH_KEY,KEY,INPUT_KEY", | 			EnvVars: []string{"PLUGIN_SSH_KEY", "PLUGIN_KEY", "SSH_KEY", "KEY", "INPUT_KEY"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "ssh-passphrase", | 			Name:    "ssh-passphrase", | ||||||
| 			Usage:  "The purpose of the passphrase is usually to encrypt the private key.", | 			Usage:   "The purpose of the passphrase is usually to encrypt the private key.", | ||||||
| 			EnvVar: "PLUGIN_SSH_PASSPHRASE,PLUGIN_PASSPHRASE,SSH_PASSPHRASE,PASSPHRASE,INPUT_PASSPHRASE", | 			EnvVars: []string{"PLUGIN_SSH_PASSPHRASE", "PLUGIN_PASSPHRASE", "SSH_PASSPHRASE", "PASSPHRASE", "INPUT_PASSPHRASE"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "key-path,i", | 			Name:    "key-path,i", | ||||||
| 			Usage:  "ssh private key path", | 			Usage:   "ssh private key path", | ||||||
| 			EnvVar: "PLUGIN_KEY_PATH,SSH_KEY_PATH,INPUT_KEY_PATH", | 			EnvVars: []string{"PLUGIN_KEY_PATH", "SSH_KEY_PATH", "INPUT_KEY_PATH"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "username,user,u", | 			Name:    "username,user,u", | ||||||
| 			Usage:  "connect as user", | 			Usage:   "connect as user", | ||||||
| 			EnvVar: "PLUGIN_USERNAME,PLUGIN_USER,SSH_USERNAME,USERNAME,INPUT_USERNAME", | 			EnvVars: []string{"PLUGIN_USERNAME", "PLUGIN_USER", "SSH_USERNAME", "USERNAME", "INPUT_USERNAME"}, | ||||||
| 			Value:  "root", | 			Value:   "root", | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "password,P", | 			Name:    "password,P", | ||||||
| 			Usage:  "user password", | 			Usage:   "user password", | ||||||
| 			EnvVar: "PLUGIN_PASSWORD,SSH_PASSWORD,PASSWORD,INPUT_PASSWORD", | 			EnvVars: []string{"PLUGIN_PASSWORD", "SSH_PASSWORD", "PASSWORD", "INPUT_PASSWORD"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringSliceFlag{ | 		&cli.StringSliceFlag{ | ||||||
| 			Name:   "ciphers", | 			Name:    "ciphers", | ||||||
| 			Usage:  "The allowed cipher algorithms. If unspecified then a sensible", | 			Usage:   "The allowed cipher algorithms. If unspecified then a sensible", | ||||||
| 			EnvVar: "PLUGIN_CIPHERS,SSH_CIPHERS,CIPHERS,INPUT_CIPHERS", | 			EnvVars: []string{"PLUGIN_CIPHERS", "SSH_CIPHERS", "CIPHERS", "INPUT_CIPHERS"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.BoolFlag{ | 		&cli.BoolFlag{ | ||||||
| 			Name:   "useInsecureCipher", | 			Name:    "useInsecureCipher", | ||||||
| 			Usage:  "include more ciphers with use_insecure_cipher", | 			Usage:   "include more ciphers with use_insecure_cipher", | ||||||
| 			EnvVar: "PLUGIN_USE_INSECURE_CIPHER,SSH_USE_INSECURE_CIPHER,USE_INSECURE_CIPHER,INPUT_USE_INSECURE_CIPHER", | 			EnvVars: []string{"PLUGIN_USE_INSECURE_CIPHER", "SSH_USE_INSECURE_CIPHER", "USE_INSECURE_CIPHER", "INPUT_USE_INSECURE_CIPHER"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "fingerprint", | 			Name:    "fingerprint", | ||||||
| 			Usage:  "fingerprint SHA256 of the host public key, default is to skip verification", | 			Usage:   "fingerprint SHA256 of the host public key, default is to skip verification", | ||||||
| 			EnvVar: "PLUGIN_FINGERPRINT,SSH_FINGERPRINT,FINGERPRINT,INPUT_FINGERPRINT", | 			EnvVars: []string{"PLUGIN_FINGERPRINT", "SSH_FINGERPRINT", "FINGERPRINT", "INPUT_FINGERPRINT"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringSliceFlag{ | 		&cli.StringSliceFlag{ | ||||||
| 			Name:     "host,H", | 			Name:     "host,H", | ||||||
| 			Usage:    "connect to host", | 			Usage:    "connect to host", | ||||||
| 			EnvVar:   "PLUGIN_HOST,SSH_HOST,HOST,INPUT_HOST", | 			EnvVars:  []string{"PLUGIN_HOST", "SSH_HOST", "HOST", "INPUT_HOST"}, | ||||||
| 			FilePath: ".host", | 			FilePath: ".host", | ||||||
| 		}, | 		}, | ||||||
| 		cli.IntFlag{ | 		&cli.IntFlag{ | ||||||
| 			Name:   "port,p", | 			Name:    "port,p", | ||||||
| 			Usage:  "connect to port", | 			Usage:   "connect to port", | ||||||
| 			EnvVar: "PLUGIN_PORT,SSH_PORT,PORT,INPUT_PORT", | 			EnvVars: []string{"PLUGIN_PORT", "SSH_PORT", "PORT", "INPUT_PORT"}, | ||||||
| 			Value:  22, | 			Value:   22, | ||||||
| 		}, | 		}, | ||||||
| 		cli.BoolFlag{ | 		&cli.BoolFlag{ | ||||||
| 			Name:   "sync", | 			Name:    "sync", | ||||||
| 			Usage:  "sync mode", | 			Usage:   "sync mode", | ||||||
| 			EnvVar: "PLUGIN_SYNC,SYNC,INPUT_SYNC", | 			EnvVars: []string{"PLUGIN_SYNC", "SYNC", "INPUT_SYNC"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.DurationFlag{ | 		&cli.DurationFlag{ | ||||||
| 			Name:   "timeout,t", | 			Name:    "timeout,t", | ||||||
| 			Usage:  "connection timeout", | 			Usage:   "connection timeout", | ||||||
| 			EnvVar: "PLUGIN_TIMEOUT,SSH_TIMEOUT,TIMEOUT,INPUT_TIMEOUT", | 			EnvVars: []string{"PLUGIN_TIMEOUT", "SSH_TIMEOUT", "TIMEOUT", "INPUT_TIMEOUT"}, | ||||||
| 			Value:  30 * time.Second, | 			Value:   30 * time.Second, | ||||||
| 		}, | 		}, | ||||||
| 		cli.DurationFlag{ | 		&cli.DurationFlag{ | ||||||
| 			Name:   "command.timeout,T", | 			Name:    "command.timeout,T", | ||||||
| 			Usage:  "command timeout", | 			Usage:   "command timeout", | ||||||
| 			EnvVar: "PLUGIN_COMMAND_TIMEOUT,SSH_COMMAND_TIMEOUT,COMMAND_TIMEOUT,INPUT_COMMAND_TIMEOUT", | 			EnvVars: []string{"PLUGIN_COMMAND_TIMEOUT", "SSH_COMMAND_TIMEOUT", "COMMAND_TIMEOUT", "INPUT_COMMAND_TIMEOUT"}, | ||||||
| 			Value:  10 * time.Minute, | 			Value:   10 * time.Minute, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringSliceFlag{ | 		&cli.StringSliceFlag{ | ||||||
| 			Name:   "script,s", | 			Name:    "script,s", | ||||||
| 			Usage:  "execute commands", | 			Usage:   "execute commands", | ||||||
| 			EnvVar: "PLUGIN_SCRIPT,SSH_SCRIPT,SCRIPT", | 			EnvVars: []string{"PLUGIN_SCRIPT", "SSH_SCRIPT", "SCRIPT"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "script.string", | 			Name:    "script.string", | ||||||
| 			Usage:  "execute single commands for github action", | 			Usage:   "execute single commands for github action", | ||||||
| 			EnvVar: "INPUT_SCRIPT", | 			EnvVars: []string{"INPUT_SCRIPT"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.BoolFlag{ | 		&cli.BoolFlag{ | ||||||
| 			Name:   "script.stop", | 			Name:    "script.stop", | ||||||
| 			Usage:  "stop script after first failure", | 			Usage:   "stop script after first failure", | ||||||
| 			EnvVar: "PLUGIN_SCRIPT_STOP,STOP,INPUT_SCRIPT_STOP", | 			EnvVars: []string{"PLUGIN_SCRIPT_STOP", "STOP", "INPUT_SCRIPT_STOP"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "proxy.ssh-key", | 			Name:    "proxy.ssh-key", | ||||||
| 			Usage:  "private ssh key of proxy", | 			Usage:   "private ssh key of proxy", | ||||||
| 			EnvVar: "PLUGIN_PROXY_SSH_KEY,PLUGIN_PROXY_KEY,PROXY_SSH_KEY,INPUT_PROXY_KEY", | 			EnvVars: []string{"PLUGIN_PROXY_SSH_KEY", "PLUGIN_PROXY_KEY", "PROXY_SSH_KEY", "INPUT_PROXY_KEY"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "proxy.ssh-passphrase", | 			Name:    "proxy.ssh-passphrase", | ||||||
| 			Usage:  "The purpose of the passphrase is usually to encrypt the private key.", | 			Usage:   "The purpose of the passphrase is usually to encrypt the private key.", | ||||||
| 			EnvVar: "PLUGIN_PROXY_SSH_PASSPHRASE,PLUGIN_PROXY_PASSPHRASE,PROXY_SSH_PASSPHRASE,PROXY_PASSPHRASE,INPUT_PROXY_PASSPHRASE", | 			EnvVars: []string{"PLUGIN_PROXY_SSH_PASSPHRASE", "PLUGIN_PROXY_PASSPHRASE", "PROXY_SSH_PASSPHRASE", "PROXY_PASSPHRASE", "INPUT_PROXY_PASSPHRASE"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "proxy.key-path", | 			Name:    "proxy.key-path", | ||||||
| 			Usage:  "ssh private key path of proxy", | 			Usage:   "ssh private key path of proxy", | ||||||
| 			EnvVar: "PLUGIN_PROXY_KEY_PATH,PROXY_SSH_KEY_PATH,INPUT_PROXY_KEY_PATH", | 			EnvVars: []string{"PLUGIN_PROXY_KEY_PATH", "PROXY_SSH_KEY_PATH", "INPUT_PROXY_KEY_PATH"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "proxy.username", | 			Name:    "proxy.username", | ||||||
| 			Usage:  "connect as user of proxy", | 			Usage:   "connect as user of proxy", | ||||||
| 			EnvVar: "PLUGIN_PROXY_USERNAME,PLUGIN_PROXY_USER,PROXY_SSH_USERNAME,INPUT_PROXY_USERNAME", | 			EnvVars: []string{"PLUGIN_PROXY_USERNAME", "PLUGIN_PROXY_USER", "PROXY_SSH_USERNAME", "INPUT_PROXY_USERNAME"}, | ||||||
| 			Value:  "root", | 			Value:   "root", | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "proxy.password", | 			Name:    "proxy.password", | ||||||
| 			Usage:  "user password of proxy", | 			Usage:   "user password of proxy", | ||||||
| 			EnvVar: "PLUGIN_PROXY_PASSWORD,PROXY_SSH_PASSWORD,INPUT_PROXY_PASSWORD", | 			EnvVars: []string{"PLUGIN_PROXY_PASSWORD", "PROXY_SSH_PASSWORD", "INPUT_PROXY_PASSWORD"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "proxy.host", | 			Name:    "proxy.host", | ||||||
| 			Usage:  "connect to host of proxy", | 			Usage:   "connect to host of proxy", | ||||||
| 			EnvVar: "PLUGIN_PROXY_HOST,PROXY_SSH_HOST,INPUT_PROXY_HOST", | 			EnvVars: []string{"PLUGIN_PROXY_HOST", "PROXY_SSH_HOST", "INPUT_PROXY_HOST"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "proxy.port", | 			Name:    "proxy.port", | ||||||
| 			Usage:  "connect to port of proxy", | 			Usage:   "connect to port of proxy", | ||||||
| 			EnvVar: "PLUGIN_PROXY_PORT,PROXY_SSH_PORT,INPUT_PROXY_PORT", | 			EnvVars: []string{"PLUGIN_PROXY_PORT", "PROXY_SSH_PORT", "INPUT_PROXY_PORT"}, | ||||||
| 			Value:  "22", | 			Value:   "22", | ||||||
| 		}, | 		}, | ||||||
| 		cli.DurationFlag{ | 		&cli.DurationFlag{ | ||||||
| 			Name:   "proxy.timeout", | 			Name:    "proxy.timeout", | ||||||
| 			Usage:  "proxy connection timeout", | 			Usage:   "proxy connection timeout", | ||||||
| 			EnvVar: "PLUGIN_PROXY_TIMEOUT,PROXY_SSH_TIMEOUT,INPUT_PROXY_TIMEOUT", | 			EnvVars: []string{"PLUGIN_PROXY_TIMEOUT", "PROXY_SSH_TIMEOUT", "INPUT_PROXY_TIMEOUT"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringSliceFlag{ | 		&cli.StringSliceFlag{ | ||||||
| 			Name:   "proxy.ciphers", | 			Name:    "proxy.ciphers", | ||||||
| 			Usage:  "The allowed cipher algorithms. If unspecified then a sensible", | 			Usage:   "The allowed cipher algorithms. If unspecified then a sensible", | ||||||
| 			EnvVar: "PLUGIN_PROXY_CIPHERS,SSH_PROXY_CIPHERS,PROXY_CIPHERS,INPUT_PROXY_CIPHERS", | 			EnvVars: []string{"PLUGIN_PROXY_CIPHERS", "SSH_PROXY_CIPHERS", "PROXY_CIPHERS", "INPUT_PROXY_CIPHERS"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.BoolFlag{ | 		&cli.BoolFlag{ | ||||||
| 			Name:   "proxy.useInsecureCipher", | 			Name:    "proxy.useInsecureCipher", | ||||||
| 			Usage:  "include more ciphers with use_insecure_cipher", | 			Usage:   "include more ciphers with use_insecure_cipher", | ||||||
| 			EnvVar: "PLUGIN_PROXY_USE_INSECURE_CIPHER,SSH_PROXY_USE_INSECURE_CIPHER,PROXY_USE_INSECURE_CIPHER,INPUT_PROXY_USE_INSECURE_CIPHER", | 			EnvVars: []string{"PLUGIN_PROXY_USE_INSECURE_CIPHER", "SSH_PROXY_USE_INSECURE_CIPHER", "PROXY_USE_INSECURE_CIPHER", "INPUT_PROXY_USE_INSECURE_CIPHER"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringFlag{ | 		&cli.StringFlag{ | ||||||
| 			Name:   "proxy.fingerprint", | 			Name:    "proxy.fingerprint", | ||||||
| 			Usage:  "fingerprint SHA256 of the host public key, default is to skip verification", | 			Usage:   "fingerprint SHA256 of the host public key, default is to skip verification", | ||||||
| 			EnvVar: "PLUGIN_PROXY_FINGERPRINT,SSH_PROXY_FINGERPRINT,PROXY_FINGERPRINT,INPUT_PROXY_FINGERPRINT", | 			EnvVars: []string{"PLUGIN_PROXY_FINGERPRINT", "SSH_PROXY_FINGERPRINT", "PROXY_FINGERPRINT", "INPUT_PROXY_FINGERPRINT"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.StringSliceFlag{ | 		&cli.StringSliceFlag{ | ||||||
| 			Name:   "envs", | 			Name:    "envs", | ||||||
| 			Usage:  "pass environment variable to shell script", | 			Usage:   "pass environment variable to shell script", | ||||||
| 			EnvVar: "PLUGIN_ENVS,INPUT_ENVS", | 			EnvVars: []string{"PLUGIN_ENVS", "INPUT_ENVS"}, | ||||||
| 		}, | 		}, | ||||||
| 		cli.BoolFlag{ | 		&cli.BoolFlag{ | ||||||
| 			Name:   "debug", | 			Name:    "debug", | ||||||
| 			Usage:  "debug mode", | 			Usage:   "debug mode", | ||||||
| 			EnvVar: "PLUGIN_DEBUG,DEBUG,INPUT_DEBUG", | 			EnvVars: []string{"PLUGIN_DEBUG", "DEBUG", "INPUT_DEBUG"}, | ||||||
| 		}, | 		}, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Bo-Yi Wu
						Bo-Yi Wu