From 2a14c7f569bcfb8a1a87f6519cc11f0af616c8e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 22:06:55 +0000 Subject: [PATCH 1/5] Bump git.tcp.direct/kayos/common from 0.7.6 to 0.7.7 Bumps git.tcp.direct/kayos/common from 0.7.6 to 0.7.7. --- updated-dependencies: - dependency-name: git.tcp.direct/kayos/common dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index dd9d44c..12af002 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/yunginnanet/HellPot go 1.19 require ( - git.tcp.direct/kayos/common v0.7.6 + git.tcp.direct/kayos/common v0.7.7 github.com/fasthttp/router v1.4.14 github.com/rs/zerolog v1.28.0 github.com/spf13/afero v1.9.3 diff --git a/go.sum b/go.sum index 4660b23..f6e619a 100644 --- a/go.sum +++ b/go.sum @@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -git.tcp.direct/kayos/common v0.7.6 h1:RThBVa6xKF6ybRURBgzobEHsRi8nYoYp3Z1PE2qtKx8= -git.tcp.direct/kayos/common v0.7.6/go.mod h1:jVbdX9prBrx9e3aTsNpu643brGVgpLvysl40/F5U2cE= +git.tcp.direct/kayos/common v0.7.7 h1:dyndyUJ1/C4CXbUBUHHzc3sKipwT1W4fei1TXAr5p68= +git.tcp.direct/kayos/common v0.7.7/go.mod h1:kA9YDmz0O2F6NjGybtO+tOTVJN3NVSASrg+le1vNnIY= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= From 15f1838aa89246aa2e246cca497c577a816c3f6f Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Mon, 2 Jan 2023 02:59:29 -0800 Subject: [PATCH 2/5] Update: README.md (typo) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 222ae45..b5c76fd 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ In the event of a missing configuration file, HellPot will attempt to place it's debug = true # extra verbose (-vv) trace = false - # JSON log files will be storn in the below directory. + # JSON log files will be stored in the below directory. directory = "/home/kayos/.local/share/HellPot/logs/" # disable all color in console output. when using Windows this will default to true. nocolor = false From 16f65e62f158009b2ccf48823ba532bef5ee698e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jan 2023 22:04:33 +0000 Subject: [PATCH 3/5] Bump git.tcp.direct/kayos/common from 0.7.7 to 0.8.0 Bumps git.tcp.direct/kayos/common from 0.7.7 to 0.8.0. --- updated-dependencies: - dependency-name: git.tcp.direct/kayos/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 12af002..eb50771 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/yunginnanet/HellPot go 1.19 require ( - git.tcp.direct/kayos/common v0.7.7 + git.tcp.direct/kayos/common v0.8.0 github.com/fasthttp/router v1.4.14 github.com/rs/zerolog v1.28.0 github.com/spf13/afero v1.9.3 @@ -28,7 +28,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - golang.org/x/sys v0.0.0-20220908164124-27713097b956 // indirect + golang.org/x/sys v0.3.0 // indirect golang.org/x/text v0.4.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index f6e619a..cd98ab9 100644 --- a/go.sum +++ b/go.sum @@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -git.tcp.direct/kayos/common v0.7.7 h1:dyndyUJ1/C4CXbUBUHHzc3sKipwT1W4fei1TXAr5p68= -git.tcp.direct/kayos/common v0.7.7/go.mod h1:kA9YDmz0O2F6NjGybtO+tOTVJN3NVSASrg+le1vNnIY= +git.tcp.direct/kayos/common v0.8.0 h1:7Nl44HAKQU5jvHb2eJgU5cwbOLfft3P/XTxZHTMPfyo= +git.tcp.direct/kayos/common v0.8.0/go.mod h1:r7lZuKTQz0uf/jNm61sz1XaMgK/RYRr7wtqr/cNYd8o= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= @@ -334,8 +334,9 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956 h1:XeJjHH1KiLpKGb6lvMiksZ9l0fVUh+AmGcm0nOMEBOY= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 4931c51a6103f41fdd48abf6c4845dae3ccf912b Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Tue, 3 Jan 2023 09:37:12 -0800 Subject: [PATCH 4/5] Logging: fix robots not showing client into --- internal/http/robots.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/http/robots.go b/internal/http/robots.go index 4cbf638..cbb72d4 100644 --- a/internal/http/robots.go +++ b/internal/http/robots.go @@ -10,6 +10,10 @@ import ( ) func robotsTXT(ctx *fasthttp.RequestCtx) { + slog := log.With(). + Str("USERAGENT", string(ctx.UserAgent())). + Str("REMOTE_ADDR", remoteAddr). + Interface("URL", string(ctx.RequestURI())).Logger() paths := &strings.Builder{} paths.WriteString("User-agent: *\r\n") for _, p := range config.Paths { @@ -19,11 +23,11 @@ func robotsTXT(ctx *fasthttp.RequestCtx) { } paths.WriteString("\r\n") - log.Debug(). + slog.Debug(). Strs("PATHS", config.Paths). Msg("SERVE_ROBOTS") if _, err := fmt.Fprintf(ctx, paths.String()); err != nil { - log.Error().Err(err).Msg("SERVE_ROBOTS_ERROR") + slog.Error().Err(err).Msg("SERVE_ROBOTS_ERROR") } } From 9c7c6c763d5706d580104d83f5f529ed9c38b167 Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Tue, 3 Jan 2023 09:47:57 -0800 Subject: [PATCH 5/5] Fix remoteaddr from previous commit --- internal/http/robots.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/http/robots.go b/internal/http/robots.go index cbb72d4..08039c4 100644 --- a/internal/http/robots.go +++ b/internal/http/robots.go @@ -12,7 +12,7 @@ import ( func robotsTXT(ctx *fasthttp.RequestCtx) { slog := log.With(). Str("USERAGENT", string(ctx.UserAgent())). - Str("REMOTE_ADDR", remoteAddr). + Str("REMOTE_ADDR", getRealRemote(ctx)). Interface("URL", string(ctx.RequestURI())).Logger() paths := &strings.Builder{} paths.WriteString("User-agent: *\r\n")