mirror of
https://github.com/appleboy/drone-ssh.git
synced 2026-02-17 09:48:50 +08:00
refactor: HostKeyCallback is the function type used for verifying server (#68)
This commit is contained in:
26
vendor/github.com/appleboy/easyssh-proxy/Makefile
generated
vendored
26
vendor/github.com/appleboy/easyssh-proxy/Makefile
generated
vendored
@@ -1,11 +1,29 @@
|
||||
.PHONY: test drone-ssh build fmt vet errcheck lint install update release-dirs release-build release-copy release-check release coverage embedmd
|
||||
.PHONY: test drone-ssh fmt vet errcheck lint install update coverage embedmd
|
||||
|
||||
GOFMT ?= gofmt "-s"
|
||||
|
||||
GOFILES := find . -name "*.go" -type f -not -path "./vendor/*"
|
||||
PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
|
||||
|
||||
all: build
|
||||
all: install lint
|
||||
|
||||
install:
|
||||
@hash govendor > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
go get -u github.com/kardianos/govendor; \
|
||||
fi
|
||||
govendor sync
|
||||
|
||||
fmt:
|
||||
find . -name "*.go" -type f -not -path "./vendor/*" | xargs gofmt -s -w
|
||||
$(GOFILES) | xargs $(GOFMT) -w
|
||||
|
||||
.PHONY: fmt-check
|
||||
fmt-check:
|
||||
# get all go files and run go fmt on them
|
||||
@files=$$($(GOFILES) | xargs $(GOFMT) -l); if [ -n "$$files" ]; then \
|
||||
echo "Please run 'make fmt' and commit the result:"; \
|
||||
echo "$${files}"; \
|
||||
exit 1; \
|
||||
fi;
|
||||
|
||||
vet:
|
||||
go vet $(PACKAGES)
|
||||
@@ -34,7 +52,7 @@ embedmd:
|
||||
fi
|
||||
embedmd -d *.md
|
||||
|
||||
test:
|
||||
test: fmt-check
|
||||
for PKG in $(PACKAGES); do go test -v -cover -coverprofile $$GOPATH/src/$$PKG/coverage.txt $$PKG || exit 1; done;
|
||||
|
||||
html:
|
||||
|
||||
3
vendor/github.com/appleboy/easyssh-proxy/README.md
generated
vendored
3
vendor/github.com/appleboy/easyssh-proxy/README.md
generated
vendored
@@ -40,6 +40,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/appleboy/easyssh-proxy"
|
||||
)
|
||||
@@ -53,7 +54,7 @@ func main() {
|
||||
//Password: "password",
|
||||
Key: "/.ssh/id_rsa",
|
||||
Port: "22",
|
||||
Timeout: 60,
|
||||
Timeout: 60 * time.Second,
|
||||
}
|
||||
|
||||
// Call Run method with command you want to run on remote server.
|
||||
|
||||
7
vendor/github.com/appleboy/easyssh-proxy/easyssh.go
generated
vendored
7
vendor/github.com/appleboy/easyssh-proxy/easyssh.go
generated
vendored
@@ -91,9 +91,10 @@ func getSSHConfig(config DefaultConfig) *ssh.ClientConfig {
|
||||
}
|
||||
|
||||
return &ssh.ClientConfig{
|
||||
Timeout: config.Timeout,
|
||||
User: config.User,
|
||||
Auth: auths,
|
||||
Timeout: config.Timeout,
|
||||
User: config.User,
|
||||
Auth: auths,
|
||||
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user