Skip to content

feat(torrent): block peers by address - #675

Merged
linroid merged 4 commits into
mainfrom
feat/torrent-ip-filter
Nov 14, 2026
Merged

linroid merged 4 commits into
mainfrom
feat/torrent-ip-filter

Conversation

@linroid

@linroid linroid commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Stacked on the seed queue PR; only the last two commits belong to this PR.

What

The IP filter part of the "Network control" row of #162.

  • Setting: TorrentConfig.blockedAddresses, [torrent] blocklist and TorrentEngineSettings.blockedAddresses (live through setBlockedAddresses and PUT /api/torrents/settings) take single addresses, CIDR blocks and ranges, IPv4 or IPv6, up to 10,000. Devices list the ip-filter capability.
  • Engine: no peer at a blocked address is dialed, for payload or a magnet's metadata, over TCP or uTP (the check sits where every peer dial passes), and a blocked incoming connection is closed before its handshake. An IPv4-mapped IPv6 address is matched as its IPv4 one. Open connections keep running; trackers and DHT nodes are not peers and are not filtered.
  • Validation: the controller refuses entries that are no address, block or range; entries in a config file that are none are ignored with a warning that counts them and never prints them.
  • Apps: Settings → BitTorrent → Blocked addresses, for devices with the capability; paste several at once. Translated in every language. The CLI and server save the list like the other torrent settings.

Snapshots

New settings group, so there is no before.

Light Dark

Testing

TorrentIpFilterTest (addresses, blocks, ranges, mapped addresses, bounds, refusals), TorrentBlockedPeersTest against a real engine and a loopback seeder (never dialed while blocked, completes once unblocked), BlockedAddressesTest for the app's parsing. The full suites are running on this branch as this is opened.

Not built here: proxies and interface binding for torrents, the rest of that roadmap row.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T05:09:23.763438Z c6f48df PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Nov 14, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6f48df28e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 2 315 files  +17   2 343 suites  +17   59m 31s ⏱️ + 1m 13s
16 315 tests +31  16 029 ✅ +30  286 💤 +1  0 ❌ ±0 
19 870 runs  +47  19 584 ✅ +46  286 💤 +1  0 ❌ ±0 

Results for commit 3957849. ± Comparison against base commit 9d97000.

♻️ This comment has been updated with latest results.

@linroid
linroid force-pushed the feat/torrent-ip-filter branch 3 times, most recently from 6595921 to eebc386 Compare November 14, 2026 12:32
Base automatically changed from feat/torrent-seed-queue to main November 14, 2026 13:11
@linroid
linroid force-pushed the feat/torrent-ip-filter branch from eebc386 to 3957849 Compare November 14, 2026 13:12
@linroid
linroid merged commit f5afa9e into main Nov 14, 2026
24 of 27 checks passed
@linroid
linroid deleted the feat/torrent-ip-filter branch November 14, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant