Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enchanced checks #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Enchanced checks #2

wants to merge 1 commit into from

Conversation

fihuer
Copy link
Member

@fihuer fihuer commented Aug 22, 2017

Depends on #1

@fihuer fihuer requested a review from arno August 22, 2017 12:59
route/route.go Outdated
client, err := ssh.Dial("tcp", hostport, ssh_config)
if err != nil {
re_auth_failure := regexp.MustCompile(`handshake failed: ssh: unable to authenticate`)
if re_auth_failure.MatchString(err.Error()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to merge the two lines i.e. regexp.MustCompile(...).MatchString(...).

chosen_item--
}
} else {
return "", errors.New("No proxied connections, unable to pick a random user..")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a trailing dot... 😁

@@ -165,10 +166,41 @@ func (hc *hostChecker) DoCheck(hostport string) State {
if route.CanConnect(hostport) {
state = Up
}
canary_user, err := PickUser()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is never logged.

Copy link
Contributor

@arno arno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, try golint on your modifications.

"time"

"github.com/op/go-logging"

"golang.org/x/crypto/ssh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use glide to manage this new dependency.

@fihuer fihuer force-pushed the enchanced_checks branch 2 times, most recently from f9f001f to 18401ec Compare July 3, 2018 19:18
@arno arno force-pushed the enchanced_checks branch 2 times, most recently from 1940be1 to fe6017b Compare July 5, 2018 10:17
Copy link
Contributor

@arno arno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some little cleanup but looks good. Can you add some doc for pickUser() so I can merge?

hc.Update(hostport, state, time.Now())
return state
}

func pickUser() (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc.

@arno arno force-pushed the enchanced_checks branch from fe6017b to 618df46 Compare July 5, 2018 13:20
Instead of just checking if a port is reachable we try to connect to the
SSH server using an already connected user.
@arno arno force-pushed the enchanced_checks branch from 618df46 to 281532a Compare July 5, 2018 13:32
@cyrilst cyrilst force-pushed the master branch 6 times, most recently from 7ca0082 to 6d3fa42 Compare March 22, 2022 08:47
@cyrilst cyrilst force-pushed the master branch 2 times, most recently from dd3157a to ddf56a4 Compare October 12, 2022 09:15
@cyrilst cyrilst force-pushed the master branch 7 times, most recently from 64c8f1a to 9931db0 Compare November 14, 2022 15:20
@cyrilst cyrilst force-pushed the master branch 3 times, most recently from 1f35892 to 62fe770 Compare October 9, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants