logger.debug("Initializing parser ...")
_PARSER = argparse.ArgumentParser(
description="Fetches block reasons from the fediverse",
- epilog="Please note that some commands have optional arguments, you may want to try fba.py <command> --help to find them out. Please DO NOT overdose requests that are not limited by themselves. Typically parameters like --domain, --software and --force are unlimited. \"Unlimited\" here means that there is no \"is recently accessed?\" limitation.",
+ epilog="Please note that some commands have optional arguments, you may want to try fba.py <command> --help to find them out. Please DO NOT overdose requests that are not limited by themselves. Typically parameters like --domain, --software and --force-all are unlimited. \"Unlimited\" here means that there is no \"is recently accessed?\" limitation.",
)
# Generic:
parser.set_defaults(command=commands.recheck_obfuscation)
parser.add_argument("--domain", help="Instance name (aka. domain)")
parser.add_argument("--software", help="Name of software, e.g. 'lemmy'")
- parser.add_argument("--force", action="store_true", help="Include also already existing instances, otherwise only new are checked")
+ parser.add_argument("--force-all", action="store_true", help="Include also already existing instances, otherwise only new are checked")
parser.add_argument("--delete-unwanted", action="store_true", help="Whether delete or keep (default) unwanted domains")
parser.add_argument("--no-obfuscation", action="store_true", help="Check instances with no obfuscation of blocked instances")
parser.add_argument("--domain", help="Instance name (aka. domain)")
parser.add_argument("--software", help="Name of software, e.g. 'lemmy'")
parser.add_argument("--only-none", action="store_true", help="Checks only entries which has never been checked.")
- parser.add_argument("--force", action="store_true", help="Forces update of data, no matter what.")
+ parser.add_argument("--force-all", action="store_true", help="Forces update of data, no matter what.")
### Fetch blocks from chaos.social ###
parser = subparser_command.add_parser(
)
parser.set_defaults(command=commands.fetch_instances)
parser.add_argument("--domain", help="Instance name (aka. domain) to fetch further instances from. Start with a large instance, e.g. mastodon.social .")
- parser.add_argument("--force", action="store_true", help="Include also already existing instances, otherwise only new are checked")
+ parser.add_argument("--force-all", action="store_true", help="Include also already existing instances, otherwise only new are checked")
parser.add_argument("--single", action="store_true", help="Only fetch given instance.")
parser.add_argument("--software", help="Name of software, e.g. 'lemmy'")
help="Fetches text/plain files as simple domain lists",
)
parser.set_defaults(command=commands.fetch_txt)
- parser.add_argument("--force", action="store_true", help="Forces update of data, no matter what.")
+ parser.add_argument("--force-all", action="store_true", help="Forces update of data, no matter what.")
### Fetch blocks from joinfediverse.wiki ###
#parser = subparser_command.add_parser(
)
parser.set_defaults(command=commands.fetch_fedilist)
parser.add_argument("--software", help="Name of software, e.g. 'lemmy'")
- parser.add_argument("--force", action="store_true", help="Include also already existing instances, otherwise only new are checked")
+ parser.add_argument("--force-all", action="store_true", help="Include also already existing instances, otherwise only new are checked")
### Update nodeinfo ###
parser = subparser_command.add_parser(
parser.add_argument("--domain", help="Instance name (aka. domain)")
parser.add_argument("--software", help="Name of software, e.g. 'lemmy'")
parser.add_argument("--mode", help="Name of detection mode, e.g. 'auto_discovery'")
- parser.add_argument("--force", action="store_true", help="Forces update of data, no matter what.")
+ parser.add_argument("--force-all", action="store_true", help="Forces update of data, no matter what.")
parser.add_argument("--no-software", action="store_true", help="Checks only entries with no software type detected.")
parser.add_argument("--no-auto", action="store_true", help="Checks only entries with other than AUTO_DISCOVERY as detection mode.")
parser.add_argument("--no-detection", action="store_true", help="Checks only entries with no detection mode set.")
parser.set_defaults(command=commands.fetch_relays)
parser.add_argument("--domain", help="Instance name (aka. 'relay')")
parser.add_argument("--software", help="Name of software, e.g. 'lemmy'")
- parser.add_argument("--force", action="store_true", help="Forces update of data, no matter what.")
+ parser.add_argument("--force-all", action="store_true", help="Forces update of data, no matter what.")
### Fetches relay list from relaylist.com
parser = subparser_command.add_parser(
if not domain_helper.is_wanted(blocker):
logger.warning("blocker='%s' is not wanted - SKIPPED!", blocker)
continue
- elif not args.force and instances.is_recent(blocker, "last_blocked"):
+ elif not args.force_all and instances.is_recent(blocker, "last_blocked"):
logger.debug("blocker='%s' has recently been crawled - SKIPPED!", blocker)
continue
elif software is None:
for row in rows:
logger.debug("row[domain]='%s',row[origin]='%s',row[software]='%s'", row["domain"], row["origin"], row["software"])
if row["software"] is None and instances.is_registered(row["domain"]) :
- logger.warning("row[domain]='%s' has no software detected. You can try to run ./fba.py update_nodeinfo --domain=%s --force to get it updated - SKIPPED!", row["domain"], row["domain"])
+ logger.warning("row[domain]='%s' has no software detected. You can try to run ./fba.py update_nodeinfo --domain=%s --force-all to get it updated - SKIPPED!", row["domain"], row["domain"])
continue
elif row["software"] is not None and software_helper.is_relay(row["software"]) and instances.is_registered(row["domain"]):
logger.warning("row[domain]='%s' is of software type '%s' which is not supported by this command. Please invoke fetch_relays instead - SKIPPED!", row["domain"], row["software"])
continue
- elif not args.force and not args.software in [None, ""] and instances.is_recent(row["domain"]):
+ elif not args.force_all and not args.software in [None, ""] and instances.is_recent(row["domain"]):
logger.debug("row[domain]='%s' has recently been crawled - SKIPPED!", row["domain"])
continue
elif not domain_helper.is_wanted(domain):
logger.debug("domain='%s' is not wanted - SKIPPED!", domain)
continue
- elif not args.force and instances.is_registered(domain):
+ elif not args.force_all and instances.is_registered(domain):
logger.debug("domain='%s' is already registered - SKIPPED!", domain)
continue
logger.debug("Processing domain='%s',row[blocker]='%s' ...", domain, row["blocker"])
- processed = processing.instance(domain, row["blocker"], inspect.currentframe().f_code.co_name, force=args.force)
+ processed = processing.instance(domain, row["blocker"], inspect.currentframe().f_code.co_name, force=args.force_all)
logger.debug("processed='%s'", processed)
logger.debug("Success! - EXIT!")
elif blacklist.is_blacklisted(row["domain"]):
logger.warning("row[domain]='%s' is blacklisted - SKIPPED!", row["domain"])
continue
- elif (args.force is None or not args.force) and args.domain is None and args.software is None and instances.is_recent(row["domain"], "last_blocked"):
- logger.debug("row[domain]='%s' has recently been checked, args.force[]='%s' - SKIPPED!", row["domain"], type(args.force))
+ elif (args.force_all is None or not args.force_all) and args.domain is None and args.software is None and instances.is_recent(row["domain"], "last_blocked"):
+ logger.debug("row[domain]='%s' has recently been checked, args.force_all[]='%s' - SKIPPED!", row["domain"], type(args.force_all))
continue
logger.debug("Invoking federation.fetch_blocks(%s) ...", row["domain"])
if not domain_helper.is_wanted(domain):
logger.debug("domain='%s' is not wanted - SKIPPED!", domain)
continue
- elif (args.force is None or not args.force) and instances.is_registered(domain):
- logger.debug("domain='%s' is already registered, --force not specified: args.force[]='%s'", domain, type(args.force))
+ elif (args.force_all is None or not args.force_all) and instances.is_registered(domain):
+ logger.debug("domain='%s' is already registered, --force-all not specified: args.force_all[]='%s'", domain, type(args.force_all))
continue
elif instances.is_recent(domain):
logger.debug("domain='%s' has recently been crawled - SKIPPED!", domain)
elif blacklist.is_blacklisted(row["domain"]):
logger.debug("row[domain]='%s' is blacklisted - SKIPPED!", row["domain"])
continue
- elif not args.force and instances.is_recent(row["domain"], "last_nodeinfo"):
+ elif not args.force_all and instances.is_recent(row["domain"], "last_nodeinfo"):
logger.debug("row[domain]='%s' has recently been checked - SKIPPED!", row["domain"])
continue
software = federation.determine_software(row["domain"])
logger.debug("Determined software='%s'", software)
- if (software != row["software"] and software is not None) or args.force is True:
+ if (software != row["software"] and software is not None) or args.force_all is True:
logger.debug("software='%s'", software)
if software is None:
logger.debug("Setting nodeinfo_url to 'None' for row[domain]='%s' ...", row["domain"])
logger.info("Checking %d relays ...", len(rows))
for row in rows:
logger.debug("row[domain]='%s',row[software]='%s'", row["domain"], row["software"])
- if not args.force and instances.is_recent(row["domain"]):
+ if not args.force_all and instances.is_recent(row["domain"]):
logger.debug("row[domain]='%s' has recently been fetched - SKIPPED!", row["domain"])
continue
elif row["nodeinfo_url"] is None: