1 Commits
Author SHA1 Message Date
sneak 8c1811aab4 Take the Tor exit list from Onionoo, which has the IPv6 exits (closes #234)
check / check (push) Canceled after 0s
check.torproject.org lists IPv4 exits only, so is_tor was false for an IPv6
exit. tor_exits now comes from Onionoo's details document, read by a new
format that takes every address in exit_addresses and or_addresses.

Model: opus-5-5
2026-11-10 09:55:47 +00:00
+12 -7
View File
@@ -164,6 +164,17 @@ func addDShieldNetwork(builder *netipx.IPSetBuilder, line string) error {
return nil
}
// onionooDetails is the part of an Onionoo details document that holds the
// relays' addresses.
//
//nolint:tagliatelle // Onionoo's own field names
type onionooDetails struct {
Relays []struct {
ExitAddresses []string `json:"exit_addresses"`
ORAddresses []string `json:"or_addresses"`
} `json:"relays"`
}
// parseOnionoo returns every address in the exit_addresses and or_addresses
// fields of the relays in an Onionoo details document. A document with no
// addresses fails, because the Tor network always has relays.
@@ -173,13 +184,7 @@ func parseOnionoo(r io.Reader) (*netipx.IPSet, error) {
return nil, err
}
//nolint:tagliatelle // Onionoo's own field names
var details struct {
Relays []struct {
ExitAddresses []string `json:"exit_addresses"`
ORAddresses []string `json:"or_addresses"`
} `json:"relays"`
}
var details onionooDetails
err = json.Unmarshal(data, &details)
if err != nil {