diff options
author | Mark Felder <feld@feld.me> | 2021-01-27 10:00:16 -0600 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2021-01-27 10:00:16 -0600 |
commit | 127c5ad253e75f3d252d6e1a23a49604610164ea (patch) | |
tree | 7330669812f2206a8fdec2013b800e3225bf1a52 | |
parent | 617ec6348312b95e13a558f3480adda0c517aca5 (diff) | |
download | pleroma-127c5ad253e75f3d252d6e1a23a49604610164ea.tar.gz |
Credofeat/mrf-dnsrbl
-rw-r--r-- | lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex b/lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex index fc963a782..f24555718 100644 --- a/lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/dns_rbl_policy.ex @@ -28,9 +28,12 @@ defmodule Pleroma.Web.ActivityPub.MRF.DnsRblPolicy do # If the provided nameserver was an IP, we also need to know the zone because we can't # derive it from the hostname. If the DNSRBL server software is configured to use "bl.pleroma.com" - # -- irrespective of the actual hostname/IP used to reach it -- we need to know this as all queries - # are nested under the zone. e.g., if you're checking the status of pleroma.host you are querying for: + # -- irrespective of the actual hostname/IP used to reach it -- + # we need the configured zone as queries are nested under the zone. e.g., if you're checking the + # status of pleroma.host you are querying for: + # # dig @nameserverip pleroma.host.bl.pleroma.com. in A + # rblzone = rblconfig[:rblzone] || rblhost # concatenate the host we're checking with the zone, e.g., "pleroma.host" <> . <> "bl.pleroma.com" <> . @@ -41,9 +44,9 @@ defmodule Pleroma.Web.ActivityPub.MRF.DnsRblPolicy do |> String.to_charlist() # Timeout of 1s, retry 1 - # We will only be using UDP for queries, so I think if the DNSRBL server is > 500ms away it won't work - # with these values, but you also wouldn't want it to be so far away or it will slow things down. - # I think we should probably try to cache entries in cachex too, maybe 300s TTL ? + # We will only be using UDP for queries, so if the DNSRBL server is > 500ms away it + # may not work. However you wouldn't want it to be this far away or it will slow things + # down. I think we should probably try to cache entries in cachex too, maybe 300s TTL ? rbl_response = :inet_res.lookup(query, :in, :a, nameservers: [{rblnsip, rblport}], timeout: 1000, retry: 1) |