diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-04-20 22:42:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 22:42:36 +0800 |
commit | d2fda73ad7f4771dadb265d1cbfaecaaabb2cb42 (patch) | |
tree | 74dce173cd1ef71a734a5a74d1ce864686284851 /cmd/puppeth/wizard_faucet.go | |
parent | 5aa21d8b32206867631950ac07645ec8854434b4 (diff) | |
parent | af48a331bf1ec8d30cff7d411afcce37741cbede (diff) | |
download | go-tangerine-d2fda73ad7f4771dadb265d1cbfaecaaabb2cb42.tar go-tangerine-d2fda73ad7f4771dadb265d1cbfaecaaabb2cb42.tar.gz go-tangerine-d2fda73ad7f4771dadb265d1cbfaecaaabb2cb42.tar.bz2 go-tangerine-d2fda73ad7f4771dadb265d1cbfaecaaabb2cb42.tar.lz go-tangerine-d2fda73ad7f4771dadb265d1cbfaecaaabb2cb42.tar.xz go-tangerine-d2fda73ad7f4771dadb265d1cbfaecaaabb2cb42.tar.zst go-tangerine-d2fda73ad7f4771dadb265d1cbfaecaaabb2cb42.zip |
Merge pull request #14339 from karalabe/faucet-block-banned-users
cmd/faucet: further user validations and bot protection
Diffstat (limited to 'cmd/puppeth/wizard_faucet.go')
-rw-r--r-- | cmd/puppeth/wizard_faucet.go | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/cmd/puppeth/wizard_faucet.go b/cmd/puppeth/wizard_faucet.go index 71d1c910b..f3fd7c2a1 100644 --- a/cmd/puppeth/wizard_faucet.go +++ b/cmd/puppeth/wizard_faucet.go @@ -71,7 +71,7 @@ func (w *wizard) deployFaucet() { // Accessing GitHub gists requires API authorization, retrieve it if infos.githubUser != "" { fmt.Println() - fmt.Printf("Reused previous (%s) GitHub API authorization (y/n)? (default = yes)\n", infos.githubUser) + fmt.Printf("Reuse previous (%s) GitHub API authorization (y/n)? (default = yes)\n", infos.githubUser) if w.readDefaultString("y") != "y" { infos.githubUser, infos.githubToken = "", "" } @@ -109,6 +109,29 @@ func (w *wizard) deployFaucet() { return } } + // Accessing the reCaptcha service requires API authorizations, request it + if infos.captchaToken != "" { + fmt.Println() + fmt.Println("Reuse previous reCaptcha API authorization (y/n)? (default = yes)") + if w.readDefaultString("y") != "y" { + infos.captchaToken, infos.captchaSecret = "", "" + } + } + if infos.captchaToken == "" { + // No previous authorization (or old one discarded) + fmt.Println() + fmt.Println("Enable reCaptcha protection against robots (y/n)? (default = no)") + if w.readDefaultString("n") == "y" { + // Captcha protection explicitly requested, read the site and secret keys + fmt.Println() + fmt.Printf("What is the reCaptcha site key to authenticate human users?\n") + infos.captchaToken = w.readString() + + fmt.Println() + fmt.Printf("What is the reCaptcha secret key to verify authentications? (won't be echoed)\n") + infos.captchaSecret = w.readPassword() + } + } // Figure out where the user wants to store the persistent data fmt.Println() if infos.node.datadir == "" { |