instances.set_has_obfuscation(blocker, False)
# c.s isn't part of oliphant's "hidden" blocklists
- if blocker == "chaos.social" or blocklists.has(blocker):
+ if blocker == "chaos.social" or software_helper.is_relay(software) or blocklists.has(blocker):
logger.debug("Skipping blocker='%s', run ./fba.py fetch_cs or fetch_oliphant instead!", blocker)
continue
origin = row["origin"]
software = row["software"]
+ if software_helper.is_relay(software):
+ logger.warning("args.domain='%s' is of software type '%s' which is not supported by this command. Please invoke fetch_relays instead.", args.domain, software)
+ return 102
+
# Initial fetch
try:
logger.info("Fetching instances from args.domain='%s',origin='%s',software='%s' ...", domain, origin, software)
# c.s isn't part of oliphant's "hidden" blocklists
logger.debug("row[domain]='%s'", row["domain"])
- if row["domain"] != "chaos.social" and not blocklists.has(row["domain"]):
+ if row["domain"] != "chaos.social" and not software_helper.is_relay(software) and not blocklists.has(row["domain"]):
logger.debug("Invoking instances.set_total_blocks(%s, %d) ...", row["domain"], len(blocking))
instances.set_last_blocked(row["domain"])
instances.set_total_blocks(row["domain"], blocking)
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
+# A list of relay software
+relays = [
+ "activityrelay",
+ "aoderelay",
+ "selective-relay",
+ "pub-relay"
+]
+
def alias(software: str) -> str:
logger.debug("software='%s'- CALLED!", software)
logger.debug("software='%s' - EXIT!", software)
return software
+
+def is_relay(software: str) -> bool:
+ logger.debug("software='%s'- CALLED!", software)
+
+ if not isinstance(software, str) and software is not None:
+ raise ValueError(f"software[]='{type(software)}' is not type 'str'")
+
+ found = software in relays
+ logger.debug("found='%s' - EXIT!", found)
+ return found
if not isinstance(software, str) and software is not None:
raise ValueError(f"Parameter software[]='{type(software)}' is not of type 'str'")
+ elif software_helper.is_relay(software):
+ raise ValueError(f"domain='{domain}' is of software='{software}' and isn't supported here.")
elif not isinstance(origin, str) and origin is not None:
raise ValueError(f"Parameter origin[]='{type(origin)}' is not of type 'str'")
elif isinstance(origin, str) and origin == "":