IP lookup: take the Tor exit list from Onionoo, which also has the IPv6 exits #234

Closed
opened 2026-11-10 10:15:07 +01:00 by clawbot · 1 comment
Collaborator

Part of #203, from item 1 of the proposal sneak agreed to (#203 (comment), #203 (comment)). Depends on the rename issue linked from the plan on that issue.

tor_exits comes from check.torproject.org, which lists IPv4 exits only, so is_tor is false for an IPv6 exit.

Change, all in internal/iplist.

  1. tor_exits is fetched from https://onionoo.torproject.org/details?flag=Exit&running=true&fields=exit_addresses,or_addresses at the same interval. Check first that this returns the addresses described below.
  2. A new format reads that one JSON document: every address in relays[].exit_addresses and relays[].or_addresses, the latter written with a port and IPv6 in brackets. The current parse reads line by line, so the new format reads the whole file.
  3. As with every format, a file that is not this document fails the parse and the previous copy stays.

Tests. Fixture with documentation addresses, IPv4 and IPv6, brackets and ports; a relay without exit_addresses; a non-Onionoo JSON document fails the parse.

Done when. A real download gives a list holding IPv4 and IPv6 exits (say how many on the PR, one line); is_tor is true for an IPv6 exit; the README's tor_exits line names Onionoo.

Model: opus-5-5

Part of https://git.eeqj.de/sneak/routewatch/issues/203, from item 1 of the proposal sneak agreed to (https://git.eeqj.de/sneak/routewatch/issues/203#issuecomment-159864, https://git.eeqj.de/sneak/routewatch/issues/203#issuecomment-165190). Depends on the rename issue linked from the plan on that issue. `tor_exits` comes from check.torproject.org, which lists IPv4 exits only, so `is_tor` is false for an IPv6 exit. **Change**, all in `internal/iplist`. 1. `tor_exits` is fetched from https://onionoo.torproject.org/details?flag=Exit&running=true&fields=exit_addresses,or_addresses at the same interval. Check first that this returns the addresses described below. 2. A new format reads that one JSON document: every address in `relays[].exit_addresses` and `relays[].or_addresses`, the latter written with a port and IPv6 in brackets. The current `parse` reads line by line, so the new format reads the whole file. 3. As with every format, a file that is not this document fails the parse and the previous copy stays. **Tests.** Fixture with documentation addresses, IPv4 and IPv6, brackets and ports; a relay without `exit_addresses`; a non-Onionoo JSON document fails the parse. **Done when.** A real download gives a list holding IPv4 and IPv6 exits (say how many on the PR, one line); `is_tor` is true for an IPv6 exit; the README's `tor_exits` line names Onionoo. Model: opus-5-5
clawbot self-assigned this 2026-11-10 10:15:07 +01:00
Author
Collaborator

Built in #243; the pull request body is the record.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/routewatch/pulls/243; the pull request body is the record. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#234