aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/puppeth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-10-30 00:02:33 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-11-21 21:09:39 +0800
commit327dcd3622efd472c4d168cda657c55ef8e19889 (patch)
treedeb67ea5b94dd0a6d257d00def88ce0b5ccb7b81 /cmd/puppeth
parentffc12f63ec57682e7c7f6653332856acbeef3183 (diff)
downloaddexon-327dcd3622efd472c4d168cda657c55ef8e19889.tar
dexon-327dcd3622efd472c4d168cda657c55ef8e19889.tar.gz
dexon-327dcd3622efd472c4d168cda657c55ef8e19889.tar.bz2
dexon-327dcd3622efd472c4d168cda657c55ef8e19889.tar.lz
dexon-327dcd3622efd472c4d168cda657c55ef8e19889.tar.xz
dexon-327dcd3622efd472c4d168cda657c55ef8e19889.tar.zst
dexon-327dcd3622efd472c4d168cda657c55ef8e19889.zip
cmd/faucet, cmd/puppeth: drop GitHub support at official request
Diffstat (limited to 'cmd/puppeth')
-rw-r--r--cmd/puppeth/module_faucet.go17
-rw-r--r--cmd/puppeth/wizard_faucet.go46
2 files changed, 1 insertions, 62 deletions
diff --git a/cmd/puppeth/module_faucet.go b/cmd/puppeth/module_faucet.go
index 09113c3e6..812c32d83 100644
--- a/cmd/puppeth/module_faucet.go
+++ b/cmd/puppeth/module_faucet.go
@@ -42,7 +42,7 @@ ADD account.pass /account.pass
ENTRYPOINT [ \
"faucet", "--genesis", "/genesis.json", "--network", "{{.NetworkID}}", "--bootnodes", "{{.Bootnodes}}", "--ethstats", "{{.Ethstats}}", "--ethport", "{{.EthPort}}", \
"--faucet.name", "{{.FaucetName}}", "--faucet.amount", "{{.FaucetAmount}}", "--faucet.minutes", "{{.FaucetMinutes}}", "--faucet.tiers", "{{.FaucetTiers}}", \
- {{if .GitHubUser}}"--github.user", "{{.GitHubUser}}", "--github.token", "{{.GitHubToken}}", {{end}}"--account.json", "/account.json", "--account.pass", "/account.pass" \
+ "--account.json", "/account.json", "--account.pass", "/account.pass" \
{{if .CaptchaToken}}, "--captcha.token", "{{.CaptchaToken}}", "--captcha.secret", "{{.CaptchaSecret}}"{{end}}{{if .NoAuth}}, "--noauth"{{end}} \
]`
@@ -65,8 +65,6 @@ services:
- FAUCET_AMOUNT={{.FaucetAmount}}
- FAUCET_MINUTES={{.FaucetMinutes}}
- FAUCET_TIERS={{.FaucetTiers}}
- - GITHUB_USER={{.GitHubUser}}
- - GITHUB_TOKEN={{.GitHubToken}}
- CAPTCHA_TOKEN={{.CaptchaToken}}
- CAPTCHA_SECRET={{.CaptchaSecret}}
- NO_AUTH={{.NoAuth}}{{if .VHost}}
@@ -94,8 +92,6 @@ func deployFaucet(client *sshClient, network string, bootnodes []string, config
"Bootnodes": strings.Join(bootnodes, ","),
"Ethstats": config.node.ethstats,
"EthPort": config.node.portFull,
- "GitHubUser": config.githubUser,
- "GitHubToken": config.githubToken,
"CaptchaToken": config.captchaToken,
"CaptchaSecret": config.captchaSecret,
"FaucetName": strings.Title(network),
@@ -114,8 +110,6 @@ func deployFaucet(client *sshClient, network string, bootnodes []string, config
"ApiPort": config.port,
"EthPort": config.node.portFull,
"EthName": config.node.ethstats[:strings.Index(config.node.ethstats, ":")],
- "GitHubUser": config.githubUser,
- "GitHubToken": config.githubToken,
"CaptchaToken": config.captchaToken,
"CaptchaSecret": config.captchaSecret,
"FaucetAmount": config.amount,
@@ -152,8 +146,6 @@ type faucetInfos struct {
minutes int
tiers int
noauth bool
- githubUser string
- githubToken string
captchaToken string
captchaSecret string
}
@@ -171,11 +163,6 @@ func (info *faucetInfos) Report() map[string]string {
"Captha protection": fmt.Sprintf("%v", info.captchaToken != ""),
"Ethstats username": info.node.ethstats,
}
- if info.githubUser != "" {
- report["GitHub authentication"] = info.githubUser
- } else {
- report["GitHub authentication"] = "disabled, rate-limited"
- }
if info.noauth {
report["Debug mode (no auth)"] = "enabled"
}
@@ -249,8 +236,6 @@ func checkFaucet(client *sshClient, network string) (*faucetInfos, error) {
amount: amount,
minutes: minutes,
tiers: tiers,
- githubUser: infos.envvars["GITHUB_USER"],
- githubToken: infos.envvars["GITHUB_TOKEN"],
captchaToken: infos.envvars["CAPTCHA_TOKEN"],
captchaSecret: infos.envvars["CAPTCHA_SECRET"],
noauth: infos.envvars["NO_AUTH"] == "true",
diff --git a/cmd/puppeth/wizard_faucet.go b/cmd/puppeth/wizard_faucet.go
index e7d5ad488..7ecb376de 100644
--- a/cmd/puppeth/wizard_faucet.go
+++ b/cmd/puppeth/wizard_faucet.go
@@ -19,7 +19,6 @@ package main
import (
"encoding/json"
"fmt"
- "net/http"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/log"
@@ -79,51 +78,6 @@ func (w *wizard) deployFaucet() {
log.Error("At least one funding tier must be set")
return
}
- // Accessing GitHub gists requires API authorization, retrieve it
- if infos.githubUser != "" {
- fmt.Println()
- fmt.Printf("Reuse previous (%s) GitHub API authorization (y/n)? (default = yes)\n", infos.githubUser)
- if w.readDefaultString("y") != "y" {
- infos.githubUser, infos.githubToken = "", ""
- }
- }
- if infos.githubUser == "" {
- // No previous authorization (or new one requested)
- fmt.Println()
- fmt.Println("Which GitHub user to verify Gists through? (default = none = rate-limited API)")
- infos.githubUser = w.readDefaultString("")
-
- if infos.githubUser == "" {
- log.Warn("Funding requests via GitHub will be heavily rate-limited")
- } else {
- fmt.Println()
- fmt.Println("What is the GitHub personal access token of the user? (won't be echoed)")
- infos.githubToken = w.readPassword()
-
- // Do a sanity check query against github to ensure it's valid
- req, _ := http.NewRequest("GET", "https://api.github.com/user", nil)
- req.SetBasicAuth(infos.githubUser, infos.githubToken)
- res, err := http.DefaultClient.Do(req)
- if err != nil {
- log.Error("Failed to verify GitHub authentication", "err", err)
- return
- }
- defer res.Body.Close()
-
- var msg struct {
- Login string `json:"login"`
- Message string `json:"message"`
- }
- if err = json.NewDecoder(res.Body).Decode(&msg); err != nil {
- log.Error("Failed to decode authorization response", "err", err)
- return
- }
- if msg.Login != infos.githubUser {
- log.Error("GitHub authorization failed", "user", infos.githubUser, "message", msg.Message)
- return
- }
- }
- }
// Accessing the reCaptcha service requires API authorizations, request it
if infos.captchaToken != "" {
fmt.Println()