311 Commits

Author SHA1 Message Date
Roardom
a447269552 refactor: use moderation status enum and cast
For consistency and less magic numbers hard coded everywhere.
2025-02-26 14:23:02 +00:00
Roardom
604b7e1937 add: spell check ci
Just an initial portion for now fixing incorrect text and preventing future incorrect text. Eventually, I'd like to fix everything still listed under "ignoredWords" in cspell.json.
2025-01-24 11:30:34 +00:00
HDVinnie
fc7272bbb1 PHP Style Change (Laravel Pint CI) 2024-12-24 01:59:20 +00:00
Roardom
18b3735085 add: log unregistered torrents 2024-11-13 09:56:43 +00:00
HDVinnie
428bf63910 add: base donation system 2024-09-12 13:03:38 -04:00
HDVinnie
a0e95fcd4c PHP Style Change (Laravel Pint CI) 2024-09-03 16:20:04 +00:00
Roardom
10fc1b2368 update: use composite primary key for peers
The same as was done in #2446 and reverted in ace8dcb but this time using workarounds for Eloquent when it tries to use the non-existing `id` column.
2024-07-16 09:45:03 +00:00
Roardom
947c4dec4f update: reduce interval for unapproved torrents
This way when the torrent is approved, the uploader has more of a chance of seeding right away without being on the cooldown.
2024-06-19 10:54:57 +00:00
Roardom
12903f64ac fix: strict type issues
Don't pass null into functions that don't accept null.
2024-05-23 17:40:16 +00:00
alkl58
17bbd99514 Fix Announce: Seeder not getting Leecher Peers 2024-04-02 17:10:11 +02:00
HDVinnie
93b17f0419 chore: license 2024-03-19 17:56:44 -04:00
Roardom
0b8e73c1e9 fix: generate warning announce response invalid bencode typo 2024-02-20 23:36:52 +00:00
Roardom
67abd92364 fix: only send warning message when slot limited
If a user has started a torrent, the torrent client will cache peers, which the user may then pause and clear those peers out of the peerlist. A user might then start enough torrents to fill their download slots, and then resume the originally paused torrents, allowing them to download more torrents than their slot limits allow. When this happens, we send a failure message and don't send a peerlist. However, because the torrent client already cached peers, it will continue downloading the torrent and sending announces. However, libtorrent clients will continue sending started events until they receive a successful announce without a failure message. The logic in our announce hard codes the peer's uploaded/downloaded values to 0 on any started event. This means that all of the deltas are recorded as 0 until the user completes the torrent, at which point it saves the currently uploaded/downloaded values and only saves the delta once the event is no longer a started event. This PR uses a warning message instead of a failure message, that way the response will be assumed to be successful, but will still provide a message to the client that will show up in the trackers tab, and the client will not continue sending started events.
2024-02-20 18:20:05 +00:00
HDVinnie
a60ea05345 update: AnnounceController 2024-02-18 23:18:21 -05:00
Roardom
e9fe003b63 fix: select peer during the lock instead of before it
The peer must be selected while we hold the `WithoutOverlapping()` middleware lock. Previously, the peer was selected beforehand, which caused previous data (single digit seconds sooner) to be used to calculate the delta in the case where a user quickly sent a stopped event right after a completed event. Selecting the peer during the lock means that the data is selected and updated before any other job can process its own delta.
2024-02-14 01:26:37 +00:00
Roardom
51cbb9105c update: update slot-limited peers but exclude from peer lists
Sometimes, for whatever reason, a user might have more peers than their slot limit. This occurs because we don't ensure every user completes every download they start. This means a user could stop a torrent, clear the slot, and start a new one, and then resume the first one using peers cached by the client. When a user did this, the peer that was stopped would no longer be shown by the tracker and stats weren't affected. When the user completed the torrent, they got a error saying they couldn't send a completed event without first sending a started event. This could only be resolved by restarting the client or pausing/resuming the torrent which would reset the stats for that torrent session. This PR accounts for this fact and will allow peers updates to continue, but the user will no longer be able to receive peers in the peer list, and other users won't receive their peer in the list.
2024-02-08 00:59:50 +00:00
Roardom
9ad5bed8e2 update: use queued announce updates
There were very minor edge cases with the previous system that had issues when users paused a torrent immediately after they completed it, causing data to be duplicated. We now opt to use DTOs to transfer the data into the job queue instead of models to prevent the extra database queries caused by passing models into a job queue.
2024-02-04 20:45:09 -05:00
Roardom
bebb838453 update: don't change the freeleech/double upload when featured
That way, when the feature ends, it will remain with the same freeleech / double upload state it started with.
2024-02-03 13:35:57 +00:00
HDVinnie
de87f975a6 PHP Style Change (Laravel Pint CI) 2024-01-09 21:13:21 +00:00
HDVinnie
b544437e82 Merge pull request #2828 from Roardom/client-blacklist
(Update) use peer id for client blacklist instead of user agent
2024-01-02 23:17:17 -05:00
HDVinnie
6aea8edee7 update: announce controller 2024-01-02 16:48:20 -05:00
HDVinnie
cf6526e445 Merge branch '7.x.x' into block-reserved-ports 2024-01-01 20:56:37 -05:00
Roardom
c26e2233b9 update: block system reserved ports
They have a very high chance to be fake and not connectable.
2024-01-01 11:27:01 +00:00
Roardom
e4dc02a627 update: cast int announce query parameters to ints 2024-01-01 11:17:46 +00:00
Roardom
a37e2013c4 update: use peer id for client blacklist instead of user agent 2023-12-31 09:27:48 +00:00
Roardom
2c10ccb2bd fix: peer connectability check
Updating all of a user's peers to either be connectable or unconnectable causes deadlocks when updated at the same time as a bulk peer upsert. We need to combine the peer connectability updates with the regular bulk peer upserts.
2023-11-27 23:48:16 +00:00
Roardom
9319f7fb66 add: announce logging for debugging 2023-11-16 16:37:38 +00:00
HDVinnie
3f03214e39 PHP Style Change (Laravel Pint CI) 2023-11-07 23:54:38 +00:00
HDVinnie
80d184c607 PHP Style Change (Laravel Pint CI) 2023-10-12 10:57:30 +00:00
HDVinnie
441f13c02c update: announce controller 2023-10-12 06:56:12 -04:00
HDVinnie
164de06fb7 update: announce controller type declarations 2023-10-11 22:38:31 -04:00
HDVinnie
86d5dbb2fd fix: #3144
- cache returns -1 as a string
2023-10-10 17:39:11 -04:00
HDVinnie
7dc1be3ce0 fix: announce
- checkMinInterval should not be able to be turned off
2023-10-06 05:38:16 -04:00
HDVinnie
22b538ffc0 fix: typo 2023-10-06 05:23:02 -04:00
Roardom
e1ea7b1c68 fix: phpredis compatibility for checking announce min interval
phpredis has a different function signature for the redis set command compared to predis. Laravel just passes the arguments directly through to the underlying package.
2023-10-06 06:19:21 +00:00
HDVinnie
777969b9b4 fix: checkMinInterval function
- phpredis support
2023-10-06 01:06:16 -04:00
HDVinnie
77bec4c06c update: phpredis support 2023-10-05 22:46:12 -04:00
Roardom
361a9b3c0f fix: announce torrent cache misses 2023-09-23 22:07:56 +00:00
HDVinnie
95aadb2e93 fix: TrackerException 2023-09-11 19:22:04 -04:00
Roardom
f055335aec fix: announce torrent cache busting
We don't select the info_hash on the torrent. We have to take it from the validated query parameter instead.
2023-09-10 23:44:00 +00:00
HDVinnie
d52b9e2815 Merge pull request #3131 from Roardom/optimize-process-announce-loop
(Update) Optimize process announce peer loop
2023-09-10 00:51:46 -04:00
Roardom
7e32ff041b update: optimize process announce peer loop
Only loop over once instead of once for each property, check both properties in each iteration, and break early.
2023-09-10 04:47:51 +00:00
HDVinnie
a8c5bbfef4 Merge pull request #3130 from Roardom/fix-announce-user-update
(Fix) Announce user uploaded/downloaded update
2023-09-10 00:45:21 -04:00
Roardom
10dfb5ffef fix: announce user uploaded/downloaded update
Bug caused from 31e7b73549
2023-09-10 03:21:59 +00:00
Roardom
88f8a67d1b update: optimize announce return peer loop
Only loop through the peers when absolutely needed. Don't loop through more peers after we reach the limit. Do logic before looping instead of inside it.
2023-09-10 02:05:43 +00:00
HDVinnie
e04cb67336 Merge pull request #3128 from Roardom/dont-convert-ip-format
(Update) Don't convert ip format
2023-09-09 20:40:51 -04:00
HDVinnie
4c32ed6d63 Merge pull request #3127 from Roardom/fix-inactive-peer-counts
(Fix) Decrease torrent seeders/leechers when a peer is marked inactive
2023-09-09 20:40:25 -04:00
HDVinnie
d3901b0ef0 Merge pull request #3124 from Roardom/increase-cache-expiry
(Update) Increase announce cache expiry
2023-09-09 20:39:14 -04:00
Roardom
c092c30a3e update: don't convert ip format
Bittorrent, MySQL, and Linux (and therefore PHP) all store IP addresses in network byte order, so we don't have to convert them.
2023-09-10 00:13:24 +00:00
Roardom
e62d342cb3 fix: decrease torrent seeders/leechers when a peer is marked inactive 2023-09-09 21:13:00 +00:00