From: Roland Häder Date: Sun, 16 Jul 2023 22:14:53 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ae5597c66caace7a3f8d053503c80d92a5afaeea;p=fba.git Continued: - added flooder to blacklist - added more networks for peers at least: 'gotosocial', 'brighteon', 'wildebeest', 'bookwyrm' --- diff --git a/daemon.py b/daemon.py index a6135a1..91c43cd 100755 --- a/daemon.py +++ b/daemon.py @@ -54,7 +54,7 @@ templates = Jinja2Templates(directory="templates") @router.get(config.get("base_url") + "/api/info.json", response_class=JSONResponse) def api_info(): - database.cursor.execute("SELECT (SELECT COUNT(domain) FROM instances), (SELECT COUNT(domain) FROM instances WHERE software IN ('pleroma', 'mastodon', 'lemmy', 'friendica', 'misskey', 'peertube', 'takahe')), (SELECT COUNT(blocker) FROM blocks), (SELECT COUNT(domain) FROM instances WHERE last_error_details IS NOT NULL)") + database.cursor.execute("SELECT (SELECT COUNT(domain) FROM instances), (SELECT COUNT(domain) FROM instances WHERE software IN ('pleroma', 'mastodon', 'lemmy', 'friendica', 'misskey', 'peertube', 'takahe', 'gotosocial', 'brighteon', 'wildebeest', 'bookwyrm')), (SELECT COUNT(blocker) FROM blocks), (SELECT COUNT(domain) FROM instances WHERE last_error_details IS NOT NULL)") row = database.cursor.fetchone() return { diff --git a/fba/commands.py b/fba/commands.py index 47d21ed..1ecf9e2 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -910,7 +910,7 @@ def fetch_instances(args: argparse.Namespace) -> int: # Loop through some instances database.cursor.execute( - "SELECT domain, origin, software, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'lemmy', 'peertube', 'takahe') AND (last_instance_fetch IS NULL OR last_instance_fetch < ?) ORDER BY rowid DESC", [time.time() - config.get("recheck_instance")] + "SELECT domain, origin, software, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'lemmy', 'peertube', 'takahe', 'gotosocial', 'brighteon', 'wildebeest', 'bookwyrm') AND (last_instance_fetch IS NULL OR last_instance_fetch < ?) ORDER BY rowid DESC", [time.time() - config.get("recheck_instance")] ) rows = database.cursor.fetchall() diff --git a/fba/helpers/blacklist.py b/fba/helpers/blacklist.py index 12c1655..e2e8a00 100644 --- a/fba/helpers/blacklist.py +++ b/fba/helpers/blacklist.py @@ -35,6 +35,7 @@ blacklist = [ "mastotroll.netz.org", "lhr.life", "localhost.run", + "loca.lt", # Testing/developing installations "ngrok.io", "ngrok-free.app", diff --git a/fba/helpers/software.py b/fba/helpers/software.py index 17d33d5..df65409 100644 --- a/fba/helpers/software.py +++ b/fba/helpers/software.py @@ -37,7 +37,7 @@ def alias(software: str) -> str: elif software in ["hometown", "ecko"] or "mastodon" in software: logger.debug("Setting mastodon: software='%s'", software) software = "mastodon" - elif software in ["slipfox calckey", "calckey", "groundpolis", "foundkey", "cherrypick", "meisskey", "magnetar", "keybump", "dolphin", "calckey social", "azk.sns"] or ["shumihub", "мисскей"] in software: + elif software in ["slipfox calckey", "calckey", "groundpolis", "foundkey", "cherrypick", "meisskey", "magnetar", "keybump", "dolphin", "calckey social", "azk.sns"] or "shumihub" in software or "мисскей" in software: logger.debug("Setting misskey: software='%s'", software) software = "misskey" elif software in ["runtube.re", "islameye"]: