From 8c78449a9ef8f2a77cc1ff94f9a0a3178af21408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 19 Oct 2017 13:59:02 +0300 Subject: cmd/puppeth: reorganize stats reports to make it readable --- cmd/puppeth/wizard_ethstats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/puppeth/wizard_ethstats.go') diff --git a/cmd/puppeth/wizard_ethstats.go b/cmd/puppeth/wizard_ethstats.go index 8bfa1d6e5..ff75a9d5d 100644 --- a/cmd/puppeth/wizard_ethstats.go +++ b/cmd/puppeth/wizard_ethstats.go @@ -112,5 +112,5 @@ func (w *wizard) deployEthstats() { return } // All ok, run a network scan to pick any changes up - w.networkStats(false) + w.networkStats() } -- cgit v1.2.3 From da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 19 Oct 2017 16:00:55 +0300 Subject: cmd/puppeth: support deploying services with forced rebuilds --- cmd/puppeth/wizard_ethstats.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmd/puppeth/wizard_ethstats.go') diff --git a/cmd/puppeth/wizard_ethstats.go b/cmd/puppeth/wizard_ethstats.go index ff75a9d5d..1bde5a3fd 100644 --- a/cmd/puppeth/wizard_ethstats.go +++ b/cmd/puppeth/wizard_ethstats.go @@ -98,13 +98,17 @@ func (w *wizard) deployEthstats() { sort.Strings(infos.banned) } // Try to deploy the ethstats server on the host + fmt.Println() + fmt.Printf("Should the ethstats be built from scratch (y/n)? (default = no)\n") + nocache := w.readDefaultString("n") != "n" + trusted := make([]string, 0, len(w.servers)) for _, client := range w.servers { if client != nil { trusted = append(trusted, client.address) } } - if out, err := deployEthstats(client, w.network, infos.port, infos.secret, infos.host, trusted, infos.banned); err != nil { + if out, err := deployEthstats(client, w.network, infos.port, infos.secret, infos.host, trusted, infos.banned, nocache); err != nil { log.Error("Failed to deploy ethstats container", "err", err) if len(out) > 0 { fmt.Printf("%s\n", out) -- cgit v1.2.3 From ffc12f63ec57682e7c7f6653332856acbeef3183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 27 Oct 2017 14:36:49 +0300 Subject: cmd/puppeth: simplifications and pre-built docker images --- cmd/puppeth/wizard_ethstats.go | 71 +++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 32 deletions(-) (limited to 'cmd/puppeth/wizard_ethstats.go') diff --git a/cmd/puppeth/wizard_ethstats.go b/cmd/puppeth/wizard_ethstats.go index 1bde5a3fd..56dbeb9b4 100644 --- a/cmd/puppeth/wizard_ethstats.go +++ b/cmd/puppeth/wizard_ethstats.go @@ -34,6 +34,8 @@ func (w *wizard) deployEthstats() { client := w.servers[server] // Retrieve any active ethstats configurations from the server + existed := true + infos, err := checkEthstats(client, w.network) if err != nil { infos = ðstatsInfos{ @@ -41,6 +43,7 @@ func (w *wizard) deployEthstats() { host: client.server, secret: "", } + existed = false } // Figure out which port to listen on fmt.Println() @@ -62,46 +65,50 @@ func (w *wizard) deployEthstats() { 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" { - // The user might want to clear the entire list, although generally probably not - fmt.Println() - fmt.Printf("Clear out blacklist and start over (y/n)? (default = no)\n") - if w.readDefaultString("n") != "n" { - infos.banned = nil - } - // Offer the user to explicitly add/remove certain IP addresses + if existed { fmt.Println() - fmt.Println("Which additional IP addresses should be blacklisted?") - for { - if ip := w.readIPAddress(); ip != "" { - infos.banned = append(infos.banned, ip) - continue + fmt.Printf("Keep existing IP %v blacklist (y/n)? (default = yes)\n", infos.banned) + if w.readDefaultString("y") != "y" { + // The user might want to clear the entire list, although generally probably not + fmt.Println() + fmt.Printf("Clear out blacklist and start over (y/n)? (default = no)\n") + if w.readDefaultString("n") != "n" { + infos.banned = nil } - break - } - fmt.Println() - fmt.Println("Which IP addresses should not be blacklisted?") - for { - if ip := w.readIPAddress(); ip != "" { - for i, addr := range infos.banned { - if ip == addr { - infos.banned = append(infos.banned[:i], infos.banned[i+1:]...) - break + // Offer the user to explicitly add/remove certain IP addresses + fmt.Println() + fmt.Println("Which additional IP addresses should be blacklisted?") + for { + if ip := w.readIPAddress(); ip != "" { + infos.banned = append(infos.banned, ip) + continue + } + break + } + fmt.Println() + fmt.Println("Which IP addresses should not be blacklisted?") + for { + if ip := w.readIPAddress(); ip != "" { + for i, addr := range infos.banned { + if ip == addr { + infos.banned = append(infos.banned[:i], infos.banned[i+1:]...) + break + } } + continue } - continue + break } - break + sort.Strings(infos.banned) } - sort.Strings(infos.banned) } // Try to deploy the ethstats server on the host - fmt.Println() - fmt.Printf("Should the ethstats be built from scratch (y/n)? (default = no)\n") - nocache := w.readDefaultString("n") != "n" - + nocache := false + if existed { + fmt.Println() + fmt.Printf("Should the ethstats be built from scratch (y/n)? (default = no)\n") + nocache = w.readDefaultString("n") != "n" + } trusted := make([]string, 0, len(w.servers)) for _, client := range w.servers { if client != nil { -- cgit v1.2.3 From a3a2c6b0d9f963c9377612cae1ed6ded6f216c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 23 Nov 2017 14:22:59 +0200 Subject: cmd/puppeth: fix typos and review suggestions --- cmd/puppeth/wizard_ethstats.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd/puppeth/wizard_ethstats.go') diff --git a/cmd/puppeth/wizard_ethstats.go b/cmd/puppeth/wizard_ethstats.go index 56dbeb9b4..fb2529c26 100644 --- a/cmd/puppeth/wizard_ethstats.go +++ b/cmd/puppeth/wizard_ethstats.go @@ -34,8 +34,6 @@ func (w *wizard) deployEthstats() { client := w.servers[server] // Retrieve any active ethstats configurations from the server - existed := true - infos, err := checkEthstats(client, w.network) if err != nil { infos = ðstatsInfos{ @@ -43,8 +41,9 @@ func (w *wizard) deployEthstats() { host: client.server, secret: "", } - existed = false } + existed := err == nil + // Figure out which port to listen on fmt.Println() fmt.Printf("Which port should ethstats listen on? (default = %d)\n", infos.port) -- cgit v1.2.3