aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/puppeth/wizard_ethstats.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-18 16:23:56 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-08-18 16:23:56 +0800
commit059c767adf4956d6d7bae16066a798d02a367f01 (patch)
tree1cbcce71bd2933d1e4ac1be7270d61f661cb20ba /cmd/puppeth/wizard_ethstats.go
parent104375f398bdfca88183010cc3693e377ea74163 (diff)
downloadgo-tangerine-059c767adf4956d6d7bae16066a798d02a367f01.tar
go-tangerine-059c767adf4956d6d7bae16066a798d02a367f01.tar.gz
go-tangerine-059c767adf4956d6d7bae16066a798d02a367f01.tar.bz2
go-tangerine-059c767adf4956d6d7bae16066a798d02a367f01.tar.lz
go-tangerine-059c767adf4956d6d7bae16066a798d02a367f01.tar.xz
go-tangerine-059c767adf4956d6d7bae16066a798d02a367f01.tar.zst
go-tangerine-059c767adf4956d6d7bae16066a798d02a367f01.zip
cmd/puppeth: support blacklisting malicious IPs on ethstats
Diffstat (limited to 'cmd/puppeth/wizard_ethstats.go')
-rw-r--r--cmd/puppeth/wizard_ethstats.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/cmd/puppeth/wizard_ethstats.go b/cmd/puppeth/wizard_ethstats.go
index c117a6027..504d8fd9c 100644
--- a/cmd/puppeth/wizard_ethstats.go
+++ b/cmd/puppeth/wizard_ethstats.go
@@ -60,6 +60,22 @@ func (w *wizard) deployEthstats() {
fmt.Printf("What should be the secret password for the API? (default = %s)\n", infos.secret)
infos.secret = w.readDefaultString(infos.secret)
}
+ // Gather any blacklists to ban from reporting
+ fmt.Println()
+ fmt.Printf("Keep existing IP %v blacklist (y/n)? (default = yes)\n", infos.banned)
+ if w.readDefaultString("y") != "y" {
+ infos.banned = nil
+
+ fmt.Println()
+ fmt.Println("Which IP addresses should be blacklisted?")
+ for {
+ if ip := w.readIPAddress(); ip != nil {
+ infos.banned = append(infos.banned, ip.String())
+ continue
+ }
+ break
+ }
+ }
// Try to deploy the ethstats server on the host
trusted := make([]string, 0, len(w.servers))
for _, client := range w.servers {
@@ -67,7 +83,7 @@ func (w *wizard) deployEthstats() {
trusted = append(trusted, client.address)
}
}
- if out, err := deployEthstats(client, w.network, infos.port, infos.secret, infos.host, trusted); err != nil {
+ if out, err := deployEthstats(client, w.network, infos.port, infos.secret, infos.host, trusted, infos.banned); err != nil {
log.Error("Failed to deploy ethstats container", "err", err)
if len(out) > 0 {
fmt.Printf("%s\n", out)