1 Commits
Author SHA1 Message Date
sneak 2ee58665ff Take the Tor exit list from Onionoo, which has the IPv6 exits (closes #234)
check / check (push) Successful in 3m16s
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 10:17:03 +00:00
+7 -12
View File
@@ -164,17 +164,6 @@ 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.
@@ -184,7 +173,13 @@ func parseOnionoo(r io.Reader) (*netipx.IPSet, error) {
return nil, err
}
var details onionooDetails
//nolint:tagliatelle // Onionoo's own field names
var details struct {
Relays []struct {
ExitAddresses []string `json:"exit_addresses"`
ORAddresses []string `json:"or_addresses"`
} `json:"relays"`
}
err = json.Unmarshal(data, &details)
if err != nil {