From: Roland Häder Date: Wed, 21 Jun 2023 03:37:16 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=dce5267a5a6a8bfbe48dbcff7b3f87de57f4c9a0;p=fba.git Continued: - first check validity and if not wanted TLDs like '.arpa' or '.tld' - then check blacklist --- diff --git a/fba/http/federation.py b/fba/http/federation.py index 28b04a2..492d932 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -628,8 +628,17 @@ def add_peers(rows: dict) -> list: peer = tidyup.domain(peer) # DEBUG: print(f"DEBUG: peer='{peer}' - AFTER!") - if blacklist.is_blacklisted(peer): - # DEBUG: print(f"DEBUG: peer='{peer}' is blacklisted, skipped!") + if not validators.domain(peer): + print(f"WARNING: peer='{peer}' is not a valid domain - SKIPPED!") + continue + elif peer.endswith(".arpa"): + print(f"WARNING: peer='{peer}' is a domain for reversed IP addresses -SKIPPED!") + continue + elif peer.endswith(".tld"): + print(f"WARNING: peer='{peer}' is a fake domain - SKIPPED!") + continue + elif blacklist.is_blacklisted(peer): + print(f"WARNING: peer='{peer}' is blacklisted - SKIPPED!") continue # DEBUG: print(f"DEBUG: Adding peer='{peer}' ...")