Compare commits

...

62 Commits

Author SHA1 Message Date
dependabot[bot] 981335a946
Bump golang.org/x/term from 0.18.0 to 0.19.0
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.18.0 to 0.19.0.
- [Commits](https://github.com/golang/term/compare/v0.18.0...v0.19.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-14 23:58:22 +00:00
kayos 8078be7ef4
Merge pull request #150 from yunginnanet/dependabot/github_actions/wangyoucao577/go-release-action-1.50 2024-04-14 16:57:28 -07:00
dependabot[bot] b7f3c19794
Bump wangyoucao577/go-release-action from 1.49 to 1.50
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.49 to 1.50.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.49...v1.50)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-14 23:56:35 +00:00
kayos edc9ca9d26
Merge pull request #151 from yunginnanet/development 2024-04-14 16:52:25 -07:00
kayos 77cc1200d7
Merge branch 'main' into development 2024-04-14 16:45:21 -07:00
kayos@tcp.direct fb999514f5
Chore: deprecate internal speedometer in favor of Rate5 implementation 2024-04-14 16:44:01 -07:00
kayos@tcp.direct 25b104d77a
Merge branch 'main' into development 2024-04-14 16:41:41 -07:00
kayos@tcp.direct 619af98029
Merge branch 'main' into development 2024-01-16 03:16:39 -08:00
kayos@tcp.direct 7a88e63cc0
Merge branch 'main' into development 2024-01-16 03:13:40 -08:00
kayos@tcp.direct 7e100317ab
Chore[CD]: Deprecate unused workflow 2023-11-15 23:39:45 -08:00
kayos@tcp.direct c717e6ec5c
Merge branch 'main' into development 2023-11-15 23:38:03 -08:00
kayos@tcp.direct f80435d2e4
Merge branch 'main' into development 2023-11-15 23:34:54 -08:00
kayos@tcp.direct c58a3465ae
Fix[CI]: fix workflow branch name 2023-11-15 23:32:08 -08:00
kayos@tcp.direct add6bd55d7
Fix[CI]: gosec nosec (again) 2023-10-20 01:17:21 -07:00
kayos@tcp.direct 3c39720646
Chore: tidy up 2023-10-20 01:04:55 -07:00
kayos 3f79f26809
Merge branch 'main' into development 2023-10-19 23:18:27 -07:00
kayos@tcp.direct 7633aa3e79
Fix: remediate unit test race condition 2023-10-19 04:14:53 -07:00
kayos@tcp.direct 7c5cc69038
Chore: tidy up 2023-10-19 04:09:17 -07:00
kayos@tcp.direct e3e05258e7
Fix[CI](SAST): gosec nosec 2023-10-19 04:07:52 -07:00
kayos@tcp.direct d88ed900f8
Feat[speedo]: flesh out speedo and add TCP transfer test 2023-10-19 03:52:08 -07:00
kayos@tcp.direct ec44773c45
Chore: deps 2023-08-11 23:07:38 -07:00
dependabot[bot] 37ce853d09
Bump git.tcp.direct/kayos/common from 0.8.5 to 0.8.6
Bumps git.tcp.direct/kayos/common from 0.8.5 to 0.8.6.

---
updated-dependencies:
- dependency-name: git.tcp.direct/kayos/common
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-11 23:07:38 -07:00
dependabot[bot] 85ca012599
Bump git.tcp.direct/kayos/common from 0.8.4 to 0.8.5
Bumps git.tcp.direct/kayos/common from 0.8.4 to 0.8.5.

---
updated-dependencies:
- dependency-name: git.tcp.direct/kayos/common
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-11 23:07:38 -07:00
dependabot[bot] da957a4a5d
Bump github.com/fasthttp/router from 1.4.18 to 1.4.19
Bumps [github.com/fasthttp/router](https://github.com/fasthttp/router) from 1.4.18 to 1.4.19.
- [Release notes](https://github.com/fasthttp/router/releases)
- [Commits](https://github.com/fasthttp/router/compare/v1.4.18...v1.4.19)

---
updated-dependencies:
- dependency-name: github.com/fasthttp/router
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-11 23:07:38 -07:00
dependabot[bot] 42eea5f9dd
Bump git.tcp.direct/kayos/common from 0.8.3 to 0.8.4
Bumps git.tcp.direct/kayos/common from 0.8.3 to 0.8.4.

---
updated-dependencies:
- dependency-name: git.tcp.direct/kayos/common
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-11 23:07:37 -07:00
dependabot[bot] 0005356845
Bump golang.org/x/term from 0.7.0 to 0.8.0
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.7.0 to 0.8.0.
- [Commits](https://github.com/golang/term/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-11 23:07:37 -07:00
dependabot[bot] 3cd2b7a862
Bump git.tcp.direct/kayos/common from 0.8.2 to 0.8.3 (#87)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:37 -07:00
dependabot[bot] 698b4bdda9
Bump github.com/valyala/fasthttp from 1.46.0 to 1.47.0 (#85)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kayos <kayos@tcp.direct>
2023-08-11 23:07:37 -07:00
dependabot[bot] 57526ab3a1
Bump wangyoucao577/go-release-action from 1.37 to 1.38 (#86)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:37 -07:00
dependabot[bot] bab07d7f92
Bump github.com/valyala/fasthttp from 1.45.0 to 1.46.0 (#84)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:37 -07:00
dependabot[bot] 2333643040
Bump github.com/rs/zerolog from 1.29.0 to 1.29.1 (#83)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:37 -07:00
dependabot[bot] 3776301ed0
Bump golang.org/x/term from 0.6.0 to 0.7.0 (#81)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:36 -07:00
dependabot[bot] 9ca252dad4
Bump peter-evans/create-or-update-comment from 2 to 3 (#82)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:36 -07:00
dependabot[bot] a635c6d252
Bump actions/checkout from 2 to 3 (#79)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:36 -07:00
dependabot[bot] bca0f4491a
Bump wangyoucao577/go-release-action from 1.35 to 1.37 (#80)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:36 -07:00
dependabot[bot] ba8ee74863
Bump actions/setup-go from 2 to 4 (#78)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:36 -07:00
kayos 2bfe90cadc
Update dependabot.yml 2023-08-11 23:07:36 -07:00
dependabot[bot] 03113b443a
Bump git.tcp.direct/kayos/common from 0.8.1 to 0.8.2 (#77)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 23:07:36 -07:00
kayos@tcp.direct 4126e2c5ee
Merge branch 'master' into development 2023-03-23 01:26:01 -07:00
kayos@tcp.direct 34323c67f6
Fix: HTTP server failing to listen should be fatal 2023-03-23 01:22:08 -07:00
kayos@tcp.direct 6d43e2e6d2
CI: Add race detector 2023-03-05 03:56:37 -08:00
kayos@tcp.direct c61f6b4a9c
Feat: Fix and finish bandwidth limiting io.Writer 2023-03-05 03:56:26 -08:00
kayos@tcp.direct b8b4b56cba
Fix: Re-add speedometer for bandwidth metering feature 2023-03-05 01:13:07 -08:00
kayos@tcp.direct e99b81b34c
Merge branch 'master' into development 2023-03-05 01:07:18 -08:00
kayos@tcp.direct bcd514c95f
CD: Fix last commit 2023-02-02 21:22:51 -08:00
kayos@tcp.direct 85897a2e2c
CD: Enable automatic builds and releases 2023-02-02 21:18:47 -08:00
kayos@tcp.direct 098e21e803
Merge branch 'master' into development 2023-02-02 20:41:25 -08:00
kayos@tcp.direct 141669f41a
Merge branch 'master' into development 2023-02-02 20:40:35 -08:00
kayos@tcp.direct 6d00df0792
Merge branch 'master' into development 2023-01-03 09:50:49 -08:00
kayos@tcp.direct ecfcc06823
Lint/refactor 2022-12-31 17:11:38 -08:00
kayos@tcp.direct 2210243788
Merge branch 'master' into development 2022-12-17 20:35:29 -08:00
kayos@tcp.direct 7c0edb9708
CI: Update 2022-09-11 04:36:26 -07:00
kayos@tcp.direct 0461e01a60
Fix: log directory 2022-09-11 04:30:27 -07:00
kayos@tcp.direct 20e54b74ff
Merge branch 'master' into development 2022-09-11 04:27:21 -07:00
kayos@tcp.direct 192e18cd54
Fix: Dev versioning 2022-09-11 04:25:11 -07:00
kayos@tcp.direct c86b09018e
Selective merge from development branch
Signed-off-by: kayos@tcp.direct <kayos@tcp.direct>
2022-09-11 04:07:33 -07:00
kayos@tcp.direct b2db55a9d5
Update development versioning mechanism 2022-09-11 04:06:00 -07:00
kayos@tcp.direct 9094317099
Lint: dead code removal 2022-09-11 03:49:41 -07:00
kayos@tcp.direct 84b44f5db0
Adjust robots.txt generation 2022-09-11 03:49:40 -07:00
kayos@tcp.direct 64b0373e52
Minor adjustments 2022-09-11 03:49:37 -07:00
kayos@tcp.direct dca759ac37
Aesthetic: adjust banner version handling 2022-09-11 03:47:01 -07:00
kayos@tcp.direct 01e4853475
Tidy up: stop using globals 2022-09-11 03:46:55 -07:00
6 changed files with 19 additions and 16 deletions

View File

@ -22,7 +22,7 @@ jobs:
export PATH=$PATH:$(go env GOPATH)/bin
go install github.com/securego/gosec/v2/cmd/gosec@latest
gosec ./...
- name: go test -v ./...
run: go test -v ./...
- name: go test -race -v ./...
run: go test -race -v ./...
- name: go build -v ./...
run: go build -v ./...

View File

@ -27,7 +27,7 @@ jobs:
goos: windows
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1.49
- uses: wangyoucao577/go-release-action@v1.50
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}

View File

@ -50,7 +50,7 @@ func main() {
signal.Notify(stopChan, syscall.SIGINT, syscall.SIGTERM)
go func() {
log.Error().Err(http.Serve()).Msg("HTTP error")
log.Fatal().Err(http.Serve()).Msg("HTTP error")
}()
<-stopChan // wait for SIGINT

4
go.mod
View File

@ -9,7 +9,7 @@ require (
github.com/spf13/afero v1.11.0
github.com/spf13/viper v1.18.2
github.com/valyala/fasthttp v1.52.0
golang.org/x/term v0.18.0
golang.org/x/term v0.19.0
)
require (
@ -33,7 +33,7 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

8
go.sum
View File

@ -76,10 +76,10 @@ golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqR
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q=
golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@ -18,9 +18,7 @@ var (
logger zerolog.Logger
)
// StartLogger instantiates an instance of our zerolog loggger so we can hook it in our main package.
// While this does return a logger, it should not be used for additional retrievals of the logger. Use GetLogger()
func StartLogger(pretty bool, targets ...io.Writer) zerolog.Logger {
func prepLogDir() {
logDir = snek.GetString("logger.directory")
if !strings.HasSuffix(logDir, "/") {
logDir += "/"
@ -29,7 +27,11 @@ func StartLogger(pretty bool, targets ...io.Writer) zerolog.Logger {
println("cannot create log directory: " + logDir + "(" + err.Error() + ")")
os.Exit(1)
}
}
// StartLogger instantiates an instance of our zerolog loggger so we can hook it in our main package.
// While this does return a logger, it should not be used for additional retrievals of the logger. Use GetLogger().
func StartLogger(pretty bool, targets ...io.Writer) zerolog.Logger {
logFileName := "HellPot"
if snek.GetBool("logger.use_date_filename") {
@ -44,9 +46,10 @@ func StartLogger(pretty bool, targets ...io.Writer) zerolog.Logger {
case len(targets) > 0:
logFile = io.MultiWriter(targets...)
default:
prepLogDir()
CurrentLogFile = path.Join(logDir, logFileName+".log")
logFile, err = os.OpenFile(CurrentLogFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o666) // #nosec G304 G302
//nolint:lll
logFile, err = os.OpenFile(CurrentLogFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o666) // #nosec G304 G302 -- we are not using user input to create the file
if err != nil {
println("cannot create log file: " + err.Error())
os.Exit(1)
@ -63,7 +66,7 @@ func StartLogger(pretty bool, targets ...io.Writer) zerolog.Logger {
return logger
}
// GetLogger retrieves our global logger object
// GetLogger retrieves our global logger object.
func GetLogger() *zerolog.Logger {
// future logic here
return &logger