Add the iCloud Private Relay list to the IP lookup, with is_relay (closes #237)
check / check (push) Successful in 1m11s
check / check (push) Successful in 1m11s
`icloud_private_relay` is Apple's list of Private Relay networks, downloaded once a day. Every result gains `flags.is_relay`. `parseProtonVPN` becomes `parseLinesNotEmpty`, shared with the new parser, which reads only each line's first column. Judgement call: a line with no comma fails the parse, so a plain list of networks at Apple's URL cannot replace a good copy. Model: opus-5-5
This commit is contained in:
1 parent
b2553f044d
commit
9aaf877e2f
9 files changed
+179
-36
No files matched your search
@@ -797,6 +797,9 @@ type IPLookupFlags struct {
|
||||
// IsVPN says that the address is on a list of VPN servers.
|
||||
IsVPN bool `json:"is_vpn"`
|
||||
|
||||
// IsRelay says that the address is on the iCloud Private Relay list.
|
||||
IsRelay bool `json:"is_relay"`
|
||||
|
||||
// IsBogon says that the address is reserved, as package bogon tells.
|
||||
IsBogon bool `json:"is_bogon"`
|
||||
}
|
||||
@@ -1025,6 +1028,9 @@ func ipLookupFlags(ip string, listings []iplist.Listing) IPLookupFlags {
|
||||
IsVPN: slices.ContainsFunc(listings, func(l iplist.Listing) bool {
|
||||
return l.VPN
|
||||
}),
|
||||
IsRelay: slices.ContainsFunc(listings, func(l iplist.Listing) bool {
|
||||
return l.Name == iplist.ICloudPrivateRelayList
|
||||
}),
|
||||
IsBogon: isBogon(ip),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user