Commit Graph

101 Commits

Author SHA1 Message Date
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
Širhoe Biazhkovič 9122aefdd7 Fix storage tests
* reformat sources #JR1356
2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič beb4736b86 Implement simple PGDC methods for storage
* sanitize code a little
* move e2e build to 'e2e' tag
2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič 566d99fcd7 Gegin work on shared store for handlers 2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič af1cbc543c Don't return error while converting hash to v1
Mark clientapproval as broken because of incorrect client_id parsing
2021-12-21 15:24:25 +03:00
Širhoe Biazhkovič 823b92fe83 Disable prometheus fot in-memory store if period set to 0 2021-10-20 17:16:11 +03:00
Širhoe Biazhkovič 25879a0f3a Sanitize hash sums in modules 2021-09-05 19:51:21 +03:00
Širhoe Biazhkovič d0e13b3273 Change containter builder struct to func 2021-09-05 18:22:10 +03:00
Širhoe Biazhkovič 2fcc536e87 Fix utests 2021-09-05 17:44:11 +03:00
Širhoe Biazhkovič 20f1a99ec2 Fix utests 2021-09-05 17:32:31 +03:00
Širhoe Biazhkovič cb4ac3c7f8 Remove zeebo/bencode dependency because of anacrolix/torrent usage 2021-09-05 16:17:21 +03:00
Širhoe Biazhkovič 8580bb37e0 WIP Add support for custom torrents' approval storages
* migrate torrentapproval to list storage
* add initial support for torrent file storage (watch directory with fsnotify)
* replace frontend/http/bencode package with github.com/zeebo/bencode module
* sanitize code (fix warnings)

TODO:
* parse torrent files to get hashes,
* watch directory event types

DON'T use for now
2021-09-04 01:49:01 +03:00
onestraw e09d11e4b9 fix goimports error
Change-Id: I0f6e383ec1081cc47c690fdaab3fd35590a2634b
2018-12-17 16:59:44 +08:00
Justin Li 3c80ed8a8e Fix goimports violations 2018-10-24 09:25:03 -04:00
Pierre-Alain TORET 757ebf1241 middleware/torrentapproval : make use of ErrTorrentUnapproved 2018-09-21 08:49:03 +02:00
Pierre-Alain TORET 6450a2fa00 middleware/clientapproval : add tests 2018-09-20 14:10:36 +02:00
Pierre-Alain TORET 12c9f95eb1 middleware/clientapproval : add error when using blacklist and whitelist at the same time 2018-09-20 11:47:14 +02:00
Pierre-Alain TORET 82c9f08f4f middleware : add torrent approval package
this makes it possible to specify a torrent whitelist/blacklist in the
configuration file based on their hexadecimal hash.

Fixes #375

Signed-off-by: Pierre-Alain TORET <pierre-alain.toret@protonmail.com>
2018-09-19 14:11:13 +02:00
Justin Li d95120c817 Return []error from Stop() channel, allow recursive stop groups 2018-09-09 11:30:15 -04:00
Jimmy Zelinskie 40f6456138 Merge pull request #381 from jzelinskie/subtests
*: add subtests for all table driven tests
2018-02-03 13:19:28 -05:00
Jimmy Zelinskie 2004489016 *: add subtests for all table driven tests
Because we use testify, this is less useful than normal, but this is
still best practice for table-driven tests.
2017-12-29 17:44:45 -05:00