Commit Graph

121 Commits

Author SHA1 Message Date
Lawrence, Rendall
d1ad0eb687 Merge branch 'fasthttp' into ctxCancel 2023-03-19 20:36:38 +03:00
Lawrence, Rendall
63e0b93db4 remove randseed package 2023-03-19 20:13:44 +03:00
Lawrence, Rendall
88f1ef7ca5 suppress context canceled error 2023-03-19 19:52:52 +03:00
Lawrence, Rendall
34c2921be8 add support for no_peer_id HTTP announce parameter
* remove `compact` from req/resp structures, because
it used only in HTTP and only while response write
2023-03-19 18:37:57 +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
3e5a26dd50 fix lint warnings, update wf go version 2023-03-03 12:21:57 +03:00
Lawrence, Rendall
3b1c713c85 move PRNG to pkg, fix lint warnings 2022-11-30 23:20:05 +03:00
Lawrence, Rendall
d8d6f2cf4b refactor code for context fallthrough 2022-11-01 17:02:24 +03:00
Lawrence, Rendall
d6de38bdbd (wip) pass context from frontend request down to store 2022-10-31 18:57:57 +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
170639eb3e (minor) remove double bearer trim 2022-08-26 11:58:22 +03:00
Lawrence, Rendall
d7777ca583 (minor) refactor jwt 2022-08-26 11:13:18 +03:00
Lawrence, Rendall
498779aeaf (partially tested) add scrape JWT validation
* remove `xorshift` package, add internal function in `varinterval`
* change `bittorrent.QueryParams` getters to search case insensitive keys
2022-08-25 18:31:48 +03:00
Lawrence, Rendall
f5a58630db (tested) add simple jwt middleware tests 2022-08-18 17:06:22 +03:00
Lawrence, Rendall
048ace4d42 (untested) reimplement jwt middleware
* change github.com/SermoDigital/jose to github.com/golang-jwt/jwt
* remove pkg/errors dependency
* update dependencies

TODO:
* add test
* flag if announce/scrape handle needed
2022-08-17 15:10:23 +03:00
Lawrence, Rendall
0fd0e06360 (tested) change DataStorage interface to accept byte array as value 2022-06-23 21:01:05 +03:00
Lawrence, Rendall
0564dfce4b (untested) add pg storage tests 2022-06-18 20:52:57 +03:00
Lawrence, Rendall
79c92df0f8 (tested) add hooks check when ping http route called 2022-05-14 01:36:21 +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
6aab7e8340 (minor) change log level in HandleAnnounce 2022-04-27 01:01:07 +03:00
Lawrence, Rendall
64b27c2df6 (tested) preserve all addresses of peer
* add multiple addresses in request structures and frontend parsers

* move per-ip peer fetch/store from storage to internal hooks

* fetch/store both v1 and v2 info hashes
2022-04-27 00:52:17 +03:00
Lawrence, Rendall
b365abd296 (untested) sanitize code
* remove peer argument from scrape swarm storage call

* replace Peer field with netip.Addr in ScrapeRequest

* add man for keydb storage

* update readme
2022-04-25 19:05:41 +03:00
Lawrence, Rendall
72a03db654 (tested) fix panic while IPv6Peers/IPv4Peers append
* change memory swarm key type to Peer (it became comparable)
2022-04-25 14:27:05 +03:00
Lawrence, Rendall
ef03291efe (tested) rollback to separate v4 and v6 keys in redis/keydb
* sanitize log fields
* remove miniredis dependency
* store/collect information about hybrid (v2to1) hashes
2022-04-24 20:32:15 +03:00
Lawrence, Rendall
22f459315b (wip) implement keydb store
* make redis store reusable for keydb
* replace redis HKeys calls in AnnouncePeers with HRandField
* change signature of storage.ScrapeSwarm
2022-04-24 02:23:18 +03:00
Lawrence, Rendall
4131c64e89 (wip) create new driver for KeyDB
* move GC and prometheus aware storage functions to separate interfaces
2022-04-23 01:28:06 +03:00
Lawrence, Rendall
01064fd21a (tested) split storage to data and peer interfaces,
add option for persisting (or not) torrent approval data
2022-04-16 18:50:19 +03:00
Lawrence, Rendall
965df2a9c3 (untested) Merge commit 24ab4ae from https://github.com/jzelinskie/chihaya 2022-04-16 01:22:24 +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
397e106396 (tested) fix redis to pass tests
* delete info hash count key from redis (replaced with SCARD on infohash set)
* add GC test
* add peer.Addr() functio to always return unwrapped address if 4to6 appear
2022-04-15 01:33:45 +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
57d9c8e78e clear store error in responseHook if ErrResourceDoesNotExist appear 2022-04-14 01:52:52 +03:00
Lawrence, Rendall
781fa9440f (done) replace redigo with go-redis
* replace redis keys with RawString encoded values (delete SerializedPeer)
* merge peers got from pre-hools with store data
2022-04-14 01:13:18 +03:00
Lawrence, Rendall
c9e0af8b1e fix lint errors 2022-04-12 21:48:54 +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
Lawrence, Rendall
c1956d68f6 Remove YAML/MD lint configs, reformat stdlib imports 2022-04-12 18:10:51 +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
d20b2fb64b Minor fix: preallocate arrays with known size 2021-12-28 21:01:15 +03:00
Lawrence, Rendall
4dbbb4ad83 Rename to MoChi 2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič
5a1ac73a3d Update dependencies, fix invalid directory config parse 2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič
d438ad58fe Test v2 hashes with qbt 2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič
e7c5263dd7 Fix approval hook build 2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič
04f1a9efb9 Reformat code 2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič
360ac9d08d Add man to exported functions/fields 2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič
0a5ac35c4d Fix e2e execution, append 2to1 hash in approvals, update dependencies 2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič
239a642bfc Fix varinterval panic if request IH is not provided 2021-12-21 15:24:25 +03:00