Commit graph

65 commits

Author SHA1 Message Date
Victor Shyba c8f0c1eed8 preserve Incomplete/Complete 2022-04-13 21:01:25 -03:00
Victor Shyba 737053bd0e accept port 0 but do not store (anonymous mode) 2022-04-13 21:01:05 -03:00
Victor Shyba 441b06169f add fixedpeer middleware 2022-04-13 17:37:28 -03:00
Jimmy Zelinskie 301dd22f15 lint: actually lint all go files 2022-01-15 23:28:52 -05:00
Jimmy Zelinskie 65ce7c7c6b lint: lint files with golangci-lint 2022-01-15 13:31:14 -05: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
Jimmy Zelinskie 7dbbc86380 middleware: add a registration model 2017-12-29 16:55:48 -05:00
mrd0ll4r d28c6717b1
Merge pull request #371 from mrd0ll4r/min-interval
middleware, config: re-add support for min interval
2017-12-07 19:44:19 +01:00
Leo Balduf ef166a6159 middleware, config: re-add support for min interval 2017-12-02 22:56:35 +01:00
Leo Balduf 756a0f6316 middleware: document stop.Stopper behaviour for Hooks 2017-12-02 22:46:09 +01:00
Jimmy Zelinskie 134744a484 middleware: remove sanitization mw 2017-10-08 18:02:34 -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
mrd0ll4r 2dcb4344cb Merge pull request #336 from mrd0ll4r/xorshift
pkg/prand: replace with pkg/xorshift
2017-06-12 22:09:38 +02:00
Leo Balduf 03b98e0090 pkg/prand: replace with pkg/xorshift 2017-06-12 22:07:05 +02:00
Jimmy Zelinskie fa6dcddcb6 Merge pull request #335 from jzelinskie/fix-jwt
middleware/jwt: encode infohashes as hex
2017-06-09 00:11:02 -04:00
mrd0ll4r 3a323d9338 Merge pull request #331 from cedricgc/tracker-logic-context
TrackerLogic returns modified Contexts
2017-06-08 17:39:04 +02:00
Jimmy Zelinskie ad496fceb8 middleware/jwt: encode infohashes as hex
This avoids some corner-cases that can be experienced when trying to
url-escape raw bytes.
2017-06-07 23:07:07 -04:00
Cedric Charly f7becf952b frontend: TrackerLogic interface returns modified context
HandleAnnounce and HandleScrape must return the modified context changed
by the hooks. These contexts are passed to AfterAnnounce and AfterScrape
for further use.

Closes #304
2017-06-07 19:25:12 -05:00
Jimmy Zelinskie 035c5b4960 middleware/jwt: escape infohash when debugging
Without this, the log lines end up looking like:
request=��1�H�7L a���-��7
2017-06-06 13:22:14 -04:00
Jimmy Zelinskie 0d9a2309fc middleware/jwt: add debug logs for JWT failures 2017-06-05 22:09:34 -04:00
Jimmy Zelinskie cb55019ab8 *: add structured logging 2017-05-07 04:30:22 -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 3f29aa358b middleware: sanitize max scrape infohashes
Fixes #268.
2017-02-02 02:32:35 -05:00
Leo Balduf 102b032c43 udp: fix ordering of scrapes 2017-01-30 13:07:14 +01:00
Leo Balduf 3ae3843944 bittorrent: add AddressField to ScrapeRequest 2017-01-20 20:34:39 +01:00
Leo Balduf 3c098c0703 middleware: add sanitization hook 2017-01-20 20:29:59 +01:00
Leo Balduf fe8c74bd9c middleware: add varinterval 2016-12-16 14:19:02 +01: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
Jimmy Zelinskie 5b9de47e7a middleware/jwt: assume KIDs in JWK Set
This also adds additional debug logging.
2016-10-26 13:58:28 -04:00
Jimmy Zelinskie d86b8e14de middleware: fix scrape data in announces
This change adjusts it such that only empty Swarms return the request
Peer. This also increments the Scrape data properly if a peer is added.

Fixes #241.
2016-10-01 22:56:07 -04:00
Leo Balduf 45a5e632ae responseHook: always include the announcing peer
Fixes #231
Fixes #232
2016-09-29 18:51:05 -04:00
Jimmy Zelinskie 46bd349a23 jwt: add initial jwt update
This also changes the signature of the constructor to return an error.
2016-09-26 21:31:34 -04:00
Jimmy Zelinskie 7f7f2726b4 jwt: add updateKeys method and call in constructor
Fixes #225.
2016-09-26 21:31:34 -04:00
Leo Balduf 86ebb108fc cmd/chihaya: stop hooks
Fixes #214.
2016-09-24 19:51:18 -04:00
Leo Balduf 3ec6f10e93 hooks: add response hook
Fixes #216
2016-09-08 16:02:01 -04:00
Leo Balduf 565ac21834 hooks: add swarm interaction 2016-09-08 15:16:25 -04:00
Leo Balduf 1ff41d7882 middleware: make hooks return a context 2016-09-05 18:26:04 -04:00
Leo Balduf 146fbedb86 general: add missing documentation
Fixes #46
2016-09-05 14:58:58 -04:00
Jimmy Zelinskie fa32839623 replace std log w/ logrus
There still needs to be much more logged with the debug level.
2016-09-05 12:10:42 -04:00
Jimmy Zelinskie 7ca15e9943 middleware: add blacklist support 2016-09-01 20:49:15 -04:00
Jimmy Zelinskie e39da6b4e6 main: add CreateHooks() method for ConfigFile
This change simplifies middleware.Logic to having only one list of
PreHooks and one list of PostHooks.
2016-09-01 19:48:49 -04:00