From 56cea081dbc10c2b2937dc395911d084179ec69f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 4 Mar 2020 12:17:48 +0000 Subject: add large logo --- doc/logo-large.png | Bin 0 -> 22726 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/logo-large.png diff --git a/doc/logo-large.png b/doc/logo-large.png new file mode 100644 index 0000000..cef5eb9 Binary files /dev/null and b/doc/logo-large.png differ -- cgit v1.2.3 From 6622def60bb96652b19e5f63185b1b9cc8b01a48 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 6 Mar 2020 18:18:09 +0000 Subject: make Mr. Lint happy --- go.mod | 2 +- go.sum | 2 ++ internal/config/config.go | 4 ++-- internal/pprof/pprof.go | 18 ------------------ internal/server/server.go | 8 ++++---- 5 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 internal/pprof/pprof.go diff --git a/go.mod b/go.mod index 9a50e44..d5c65b7 100644 --- a/go.mod +++ b/go.mod @@ -5,5 +5,5 @@ go 1.13 require ( github.com/DataDog/zstd v1.4.4 golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 - golang.org/x/lint v0.0.0-20200130185559-910be7a94367 // indirect + golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect ) diff --git a/go.sum b/go.sum index 39af4c9..b40dedd 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 h1:sKJQZMuxjOAR/Uo2LBfU90 golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= diff --git a/internal/config/config.go b/internal/config/config.go index 166e143..7241276 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -9,8 +9,8 @@ import ( // ControlUser is used for various DTail specific operations. const ControlUser string = "DTAIL-CONTROL-USER" -// ScheduledUser is used for scheduled queries. -const ScheduleUser string = "DTAIL-SCHEDULED-USER" +// ScheduleUser is used for scheduled queries. +const ScheduleUser string = "DTAIL-SCHEDULE-USER" // Client holds a DTail client configuration. var Client *ClientConfig diff --git a/internal/pprof/pprof.go b/internal/pprof/pprof.go deleted file mode 100644 index c6d11ca..0000000 --- a/internal/pprof/pprof.go +++ /dev/null @@ -1,18 +0,0 @@ -package pprof - -import ( - "fmt" - "net/http" - _ "net/http" - _ "net/http/pprof" - - "github.com/mimecast/dtail/internal/config" - "github.com/mimecast/dtail/internal/io/logger" -) - -// Start the profiler HTTP server. -func Start() { - bindAddr := fmt.Sprintf("%s:%d", config.Common.PProfBindAddress, config.Common.PProfPort) - logger.Info("Starting PProf server", bindAddr) - go http.ListenAndServe(bindAddr, nil) -} diff --git a/internal/server/server.go b/internal/server/server.go index 0b93537..4ffe4d9 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -224,15 +224,15 @@ func (s *Server) schedueleUserCanHaveSSHSession(addr string, user *user.User, jo continue } for _, myAddr := range job.AllowFrom { - myIps, err := net.LookupIP(myAddr) + myIPs, err := net.LookupIP(myAddr) if err != nil { logger.Error(user, myAddr, err) continue } - for _, myIp := range myIps { - logger.Debug("schedueleUserCanHaveSSHSession", "Comparing IP addresses", ip, myIp.String()) - if ip == myIp.String() { + for _, myIP := range myIPs { + logger.Debug("schedueleUserCanHaveSSHSession", "Comparing IP addresses", ip, myIP.String()) + if ip == myIP.String() { return true } } -- cgit v1.2.3 From a4f8e0926a1a6888cbab1cfd94229cf1cc5cba7d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 6 Mar 2020 18:21:02 +0000 Subject: simplify and get rid of pperf --- cmd/dcat/main.go | 7 ------- cmd/dgrep/main.go | 7 ------- cmd/dmap/main.go | 6 ------ cmd/drun/main.go | 6 ------ cmd/dserver/main.go | 7 ------- cmd/dtail/main.go | 7 ------- internal/config/common.go | 9 --------- samples/dtail.json.sample | 3 --- 8 files changed, 52 deletions(-) diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 1ec945d..af46db1 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -9,7 +9,6 @@ import ( "github.com/mimecast/dtail/internal/color" "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/io/logger" - "github.com/mimecast/dtail/internal/pprof" "github.com/mimecast/dtail/internal/user" "github.com/mimecast/dtail/internal/version" ) @@ -23,7 +22,6 @@ func main() { var displayVersion bool var files string var noColor bool - var pprofEnable bool var serversStr string var silentEnable bool var sshPort int @@ -34,7 +32,6 @@ func main() { flag.BoolVar(&debugEnable, "debug", false, "Activate debug messages") flag.BoolVar(&displayVersion, "version", false, "Display version") flag.BoolVar(&noColor, "noColor", false, "Disable ANSII terminal colors") - flag.BoolVar(&pprofEnable, "pprofEnable", false, "Enable pprof server") flag.BoolVar(&silentEnable, "silent", false, "Reduce output") flag.BoolVar(&trustAllHosts, "trustAllHosts", false, "Auto trust all unknown host keys") flag.IntVar(&connectionsPerCPU, "cpc", 10, "How many connections established per CPU core concurrently") @@ -59,10 +56,6 @@ func main() { logger.Start(ctx, serverEnable, debugEnable, silentEnable, silentEnable) - if pprofEnable || config.Common.PProfEnable { - pprof.Start() - } - args := clients.Args{ ConnectionsPerCPU: connectionsPerCPU, ServersStr: serversStr, diff --git a/cmd/dgrep/main.go b/cmd/dgrep/main.go index 74a501f..9393cf6 100644 --- a/cmd/dgrep/main.go +++ b/cmd/dgrep/main.go @@ -9,7 +9,6 @@ import ( "github.com/mimecast/dtail/internal/color" "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/io/logger" - "github.com/mimecast/dtail/internal/pprof" "github.com/mimecast/dtail/internal/user" "github.com/mimecast/dtail/internal/version" ) @@ -23,7 +22,6 @@ func main() { var displayVersion bool var files string var noColor bool - var pprofEnable bool var regex string var serversStr string var silentEnable bool @@ -35,7 +33,6 @@ func main() { flag.BoolVar(&debugEnable, "debug", false, "Activate debug messages") flag.BoolVar(&displayVersion, "version", false, "Display version") flag.BoolVar(&noColor, "noColor", false, "Disable ANSII terminal colors") - flag.BoolVar(&pprofEnable, "pprofEnable", false, "Enable pprof server") flag.BoolVar(&silentEnable, "silent", false, "Reduce output") flag.BoolVar(&trustAllHosts, "trustAllHosts", false, "Auto trust all unknown host keys") flag.IntVar(&connectionsPerCPU, "cpc", 10, "How many connections established per CPU core concurrently") @@ -60,10 +57,6 @@ func main() { serverEnable := false logger.Start(ctx, serverEnable, debugEnable, silentEnable, silentEnable) - if pprofEnable || config.Common.PProfEnable { - pprof.Start() - } - args := clients.Args{ ConnectionsPerCPU: connectionsPerCPU, ServersStr: serversStr, diff --git a/cmd/dmap/main.go b/cmd/dmap/main.go index f3f706a..07b7f2f 100644 --- a/cmd/dmap/main.go +++ b/cmd/dmap/main.go @@ -10,7 +10,6 @@ import ( "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/io/logger" "github.com/mimecast/dtail/internal/omode" - "github.com/mimecast/dtail/internal/pprof" "github.com/mimecast/dtail/internal/user" "github.com/mimecast/dtail/internal/version" ) @@ -24,7 +23,6 @@ func main() { var displayVersion bool var files string var noColor bool - var pprofEnable bool var queryStr string var serversStr string var silentEnable bool @@ -36,7 +34,6 @@ func main() { flag.BoolVar(&debugEnable, "debug", false, "Activate debug messages") flag.BoolVar(&displayVersion, "version", false, "Display version") flag.BoolVar(&noColor, "noColor", false, "Disable ANSII terminal colors") - flag.BoolVar(&pprofEnable, "pprofEnable", false, "Enable pprof server") flag.BoolVar(&silentEnable, "silent", false, "Reduce output") flag.BoolVar(&trustAllHosts, "trustAllHosts", false, "Auto trust all unknown host keys") flag.IntVar(&connectionsPerCPU, "cpc", 10, "How many connections established per CPU core concurrently") @@ -61,9 +58,6 @@ func main() { serverEnable := false logger.Start(ctx, serverEnable, debugEnable, silentEnable, silentEnable) - if pprofEnable || config.Common.PProfEnable { - pprof.Start() - } args := clients.Args{ ConnectionsPerCPU: connectionsPerCPU, diff --git a/cmd/drun/main.go b/cmd/drun/main.go index b1936d4..986b97d 100644 --- a/cmd/drun/main.go +++ b/cmd/drun/main.go @@ -9,7 +9,6 @@ import ( "github.com/mimecast/dtail/internal/color" "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/io/logger" - "github.com/mimecast/dtail/internal/pprof" "github.com/mimecast/dtail/internal/user" "github.com/mimecast/dtail/internal/version" ) @@ -23,7 +22,6 @@ func main() { var discovery string var displayVersion bool var noColor bool - var pprofEnable bool var serversStr string var silentEnable bool var sshPort int @@ -34,7 +32,6 @@ func main() { flag.BoolVar(&debugEnable, "debug", false, "Activate debug messages") flag.BoolVar(&displayVersion, "version", false, "Display version") flag.BoolVar(&noColor, "noColor", false, "Disable ANSII terminal colors") - flag.BoolVar(&pprofEnable, "pprofEnable", false, "Enable pprof server") flag.BoolVar(&silentEnable, "silent", false, "Reduce output") flag.BoolVar(&trustAllHosts, "trustAllHosts", false, "Auto trust all unknown host keys") flag.IntVar(&connectionsPerCPU, "cpc", 10, "How many connections established per CPU core concurrently") @@ -58,9 +55,6 @@ func main() { serverEnable := false logger.Start(ctx, serverEnable, debugEnable, silentEnable, silentEnable) - if pprofEnable || config.Common.PProfEnable { - pprof.Start() - } args := clients.Args{ ConnectionsPerCPU: connectionsPerCPU, diff --git a/cmd/dserver/main.go b/cmd/dserver/main.go index 03834f1..e265023 100644 --- a/cmd/dserver/main.go +++ b/cmd/dserver/main.go @@ -9,7 +9,6 @@ import ( "github.com/mimecast/dtail/internal/color" "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/io/logger" - "github.com/mimecast/dtail/internal/pprof" "github.com/mimecast/dtail/internal/server" "github.com/mimecast/dtail/internal/user" "github.com/mimecast/dtail/internal/version" @@ -21,7 +20,6 @@ func main() { var debugEnable bool var displayVersion bool var noColor bool - var pprofEnable bool var shutdownAfter int var sshPort int @@ -30,7 +28,6 @@ func main() { flag.BoolVar(&debugEnable, "debug", false, "Activate debug messages") flag.BoolVar(&displayVersion, "version", false, "Display version") flag.BoolVar(&noColor, "noColor", false, "Disable ANSII terminal colors") - flag.BoolVar(&pprofEnable, "pprofEnable", false, "Enable pprof server") flag.IntVar(&shutdownAfter, "shutdownAfter", 0, "Automatically shutdown after so many seconds") flag.IntVar(&sshPort, "port", 2222, "SSH server port") flag.StringVar(&cfgFile, "cfg", "", "Config file path") @@ -64,10 +61,6 @@ func main() { }() } - if pprofEnable || config.Common.PProfEnable { - pprof.Start() - } - serv := server.New() status := serv.Start(ctx) logger.Flush() diff --git a/cmd/dtail/main.go b/cmd/dtail/main.go index 76070ff..a243873 100644 --- a/cmd/dtail/main.go +++ b/cmd/dtail/main.go @@ -10,7 +10,6 @@ import ( "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/io/logger" "github.com/mimecast/dtail/internal/omode" - "github.com/mimecast/dtail/internal/pprof" "github.com/mimecast/dtail/internal/user" "github.com/mimecast/dtail/internal/version" ) @@ -25,7 +24,6 @@ func main() { var displayVersion bool var files string var noColor bool - var pprofEnable bool var queryStr string var regex string var serversStr string @@ -39,7 +37,6 @@ func main() { flag.BoolVar(&debugEnable, "debug", false, "Activate debug messages") flag.BoolVar(&displayVersion, "version", false, "Display version") flag.BoolVar(&noColor, "noColor", false, "Disable ANSII terminal colors") - flag.BoolVar(&pprofEnable, "pprofEnable", false, "Enable pprof server") flag.BoolVar(&silentEnable, "silent", false, "Reduce output") flag.BoolVar(&trustAllHosts, "trustAllHosts", false, "Auto trust all unknown host keys") flag.IntVar(&connectionsPerCPU, "cpc", 10, "How many connections established per CPU core concurrently") @@ -74,10 +71,6 @@ func main() { } logger.Start(ctx, serverEnable, debugEnable, silentEnable, silentEnable) - if pprofEnable || config.Common.PProfEnable { - pprof.Start() - } - args := clients.Args{ ConnectionsPerCPU: connectionsPerCPU, ServersStr: serversStr, diff --git a/internal/config/common.go b/internal/config/common.go index 8c07710..57f040c 100644 --- a/internal/config/common.go +++ b/internal/config/common.go @@ -18,12 +18,6 @@ type CommonConfig struct { LogDir string // The cache directory CacheDir string - // Do we want to enable pperf http server? - PProfEnable bool `json:",omitempty"` - // The HTTP port used by PProf - PProfPort int `json:",omitempty"` - // The PProf HTTP server bind address - PProfBindAddress string `json:",omitempty"` } // Create a new default configuration. @@ -35,8 +29,5 @@ func newDefaultCommonConfig() *CommonConfig { ExperimentalFeaturesEnable: false, LogDir: "log", CacheDir: "cache", - PProfEnable: false, - PProfPort: 6060, - PProfBindAddress: "0.0.0.0", } } diff --git a/samples/dtail.json.sample b/samples/dtail.json.sample index 83925c6..bac1f83 100644 --- a/samples/dtail.json.sample +++ b/samples/dtail.json.sample @@ -32,9 +32,6 @@ "LogStrategy": "stdout", "SSHPort": 2222, "DebugEnable": false, - "PPerfEnable": false, - "PPerfPort": 6060, - "PPerfBindAddress": "0.0.0.0", "ExperimentalFeaturesEnable": false } } -- cgit v1.2.3