diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-04-17 01:53:27 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-04-17 01:53:27 +0800 |
commit | af48a331bf1ec8d30cff7d411afcce37741cbede (patch) | |
tree | 45463b9cf2bb65345ac748ccbf358c587dc678e4 /cmd/puppeth/wizard_faucet.go | |
parent | 80e74fc1e09ccc3cf48a65fd89d2d872dc68fda3 (diff) | |
download | go-tangerine-af48a331bf1ec8d30cff7d411afcce37741cbede.tar go-tangerine-af48a331bf1ec8d30cff7d411afcce37741cbede.tar.gz go-tangerine-af48a331bf1ec8d30cff7d411afcce37741cbede.tar.bz2 go-tangerine-af48a331bf1ec8d30cff7d411afcce37741cbede.tar.lz go-tangerine-af48a331bf1ec8d30cff7d411afcce37741cbede.tar.xz go-tangerine-af48a331bf1ec8d30cff7d411afcce37741cbede.tar.zst go-tangerine-af48a331bf1ec8d30cff7d411afcce37741cbede.zip |
cmd: integrate invisible recaptcha into puppeth
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 == "" { |