Commit Graph

59 Commits

Author SHA1 Message Date
Lawrence, Rendall
1a3f5b1598 upgrade golangci to v2
* migrate configuration to version 2
* fix new lint warnings
* update lint.yaml to use golangci-lint-action v7
2025-04-22 14:18:18 +03:00
Lawrence, Rendall
af7095d1b8 (minor) fix missing pprof handlers 2025-02-10 14:44:12 +03:00
Lawrence, Rendall
9fc94617ce set mochi-2e2 as submodule
* update go version to 1.23
* remove sha256-simd dependency
* fix logger file path
2024-10-01 16:17:42 +03:00
Lawrence, Rendall
113a02623d (minor) separate metrics server creation and start, allow pretty print log to file 2024-08-06 21:52:25 +03:00
Lawrence, Rendall
1a3a55ab4a switch prometheus listener to fasthttp 2024-07-26 21:38:20 +03:00
Lawrence, Rendall
95b7f5530f change math/rand to crypto/rand in non-test code 2024-03-05 11:01:18 +03:00
Lawrence, Rendall
665899017e (untested) move unsafe string conversion to pkg
* fix invalid UDP f/e start when no workers provided
* add bench for entire server
2023-03-22 17:51:13 +03:00
Lawrence, Rendall
63e0b93db4 remove randseed package 2023-03-19 20:13:44 +03:00
Lawrence, Rendall
da7de52813 change httprouter with fasthttp and simple handler
* add http benchmark
* move HTTP query parameters parsing to http subpackage
* update dependencies
2023-03-18 00:58:35 +03:00
Lawrence, Rendall
100ce660f6 fix nolint directive 2023-02-10 00:24:23 +03:00
Lawrence, Rendall
96cc4f7eac update go-redis to v9 2023-02-10 00:19:42 +03:00
Lawrence, Rendall
3b1c713c85 move PRNG to pkg, fix lint warnings 2022-11-30 23:20:05 +03:00
Lawrence, Rendall
234c65333e Add workers config parameter to start concurrent listeners 2022-11-25 13:58:04 +03:00
Širhoe Biazhkovič
5b5bd57348 (minor) self call to NowUnixNano in TimeCache for Now 2022-11-16 20:04:02 +03:00
Širhoe Biazhkovič
0cbc5854cd refactor timecache
* change clock to `atomic.Int64`
* add `once` fields for starter and stopper
* update dependencies

note: go version updated to 1.19
2022-11-16 19:59:07 +03:00
Lawrence, Rendall
d8d6f2cf4b refactor code for context fallthrough 2022-11-01 17:02:24 +03:00
Lawrence, Rendall
c1e041b4f8 (wip) fix invalid http compact address encode
* add packages to loggers
* split config examples with different storages
2022-10-25 18:38:55 +03:00
Lawrence, Rendall
a9d1642615 (wip) sanitize and refactor code
* replace bencode calls in http response with static generated values
* move bytepool to shared folder
* change receivers for `Scrapes` and `RequestAddresses` (bored of compile warnings)
2022-10-24 19:07:47 +03:00
Lawrence, Rendall
dff0ba6da8 (wip) rework configuration to support multiple frontends 2022-10-21 17:53:03 +03:00
Lawrence, Rendall
694592f881 fix list warnings
* remove deprecated lint checks
* reformat files
* update dependencies
2022-09-06 13:34:57 +03:00
Lawrence, Rendall
96653c45a3 add filter_private_ips option to discard private IPs.
Might be used when tracker is behind reverse proxy and one of provided
addresses in `real_ip_header` is private/local address.

Additional changes:

* check if provided address is not multicast/broadcast
* configure `http.Server.ReadHeaderTimeout` with `http.ReadTimeout` to mitigate Slowloris
* update dependencies
* minor docs fixes
2022-07-23 15:49:22 +03:00
Lawrence, Rendall
4a16fc62a0 (minor) fix invalid random seed 2022-06-23 21:37:17 +03:00
Lawrence, Rendall
0564dfce4b (untested) add pg storage tests 2022-06-18 20:52:57 +03:00
Lawrence, Rendall
463d478dad (minor) sanitize code 2022-05-02 13:30:11 +03:00
Lawrence, Rendall
c50a532181 (tested) complete replace logrus with zerolog
* remove cobra dependency and split execs to mochi and e2e

* add log init synchronization
2022-05-02 03:13:58 +03:00
Lawrence, Rendall
4d646f7c09 (wip) migrate to zerolog 2022-05-01 01:39:21 +03:00
Lawrence, Rendall
f9c72341c0 (minor) refactor redis GC and fix TX calls,
add indicator that metrics are running
2022-04-17 00:57:30 +03:00
Lawrence, Rendall
8cd8343757 (tested) refactor code
* add sentinel master parameter into driver config
* replace yaml double deserialization with `mapstructure` in initializers
* replace struct initializers with registered functions
* add torrent approval MD and a sanitize rest MDs
2022-04-16 00:51:48 +03:00
Lawrence, Rendall
5c2471ca9b (untested) Merge commit e56ad81 from https://github.com/jzelinskie/chihaya
* rename/replace redis keys
2022-04-14 19:14:12 +03:00
Lawrence, Rendall
64eaf9d733 Fix lint gosec and ifshort issues 2022-04-12 18:51:03 +03:00
Lawrence, Rendall
554ae6fcd6 Reformat comments 2022-04-12 18:32:17 +03:00
Širhoe Biazhkovič
c7edbb52f2 Merge commits 129aac230aa..828edb8fd8b from https://github.com/chihaya/chihaya 2022-04-12 15:58:14 +03:00
Lawrence, Rendall
4dbbb4ad83 Rename to MoChi 2021-12-21 15:24:25 +03:00
Jimmy Zelinskie
456f9de190 pkg/metrics: move profiles into the metrics server
This change:
- renames pkg/prometheus into pkg/metrics
- renames the prometheus_addr config to metrics_addr
- adds pprof endpoints to the metrics server
- removes profile/trace cli flags
- adds endpoints for profiling to the metrics server
2021-02-27 12:49:24 -05:00
Jimmy Zelinskie
e266d218db pkg/log: add type field for errors 2020-05-07 13:15:43 -04:00
Jimmy Zelinskie
5b771c47a1 go: bump dependencies, require Go 1.14 2020-04-30 19:39:17 -04:00
Justin Li
3c80ed8a8e Fix goimports violations 2018-10-24 09:25:03 -04:00
Justin Li
d95120c817 Return []error from Stop() channel, allow recursive stop groups 2018-09-09 11:30:15 -04:00
Leo Balduf
55b57549a6 pkg/timecache: implement a time cache 2017-10-15 20:05:35 +02:00
Leo Balduf
13857d5bce pkg/log: fix debug logging 2017-09-03 11:37:17 +02:00
Leo Balduf
3168f50601 log: add SetOutput function 2017-08-24 12:48:13 +02:00
Jimmy Zelinskie
034aa0b5dc glide: update dependencies
This change also moves the logrus library to the lowercase import in
order to avoid breaking downstream projects vendoring chihaya.
2017-07-03 18:57:13 -04:00
Leo Balduf
8ed171b0ea pkg/log: create wrapper around logrus 2017-06-26 20:46:40 +02:00
Leo Balduf
02336d10e7 pkg/xorshift: rebuild to use stack only 2017-06-19 09:45:26 +02:00
Leo Balduf
03b98e0090 pkg/prand: replace with pkg/xorshift 2017-06-12 22:07:05 +02:00
Jimmy Zelinskie
20d1cbf537 pkg/prometheus: init 2017-05-01 15:56:16 -04:00
Jimmy Zelinskie
a4b08c021b mv pkg/stopper pkg/stop
This makes most of the callsites stutter slightly less.
2017-02-02 21:09:25 -05:00
Jimmy Zelinskie
e3e545e22e stopper: move to pkg package
This also adds a package docs for the stopper package.
2016-12-11 21:36:01 -05:00
Leo Balduf
79213c6bbd prand: add Container 2016-11-30 19:54:57 +01:00
Jimmy Zelinskie
1bff8d1571 delete old code 2016-08-16 22:17:10 -04:00