From 6d4e8aa243efd15749ac11a493c7a66a040608c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 15 Mar 2025 01:14:24 +0100 Subject: [PATCH] Continued: - formatted SQL command - added alias for misskey/pleroma --- daemon.py | 12 +++++++++++- fba/commands.py | 2 +- fba/helpers/software.py | 4 +++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index cc268d0..da2b1c4 100755 --- a/daemon.py +++ b/daemon.py @@ -59,7 +59,17 @@ templates = Jinja2Templates(directory="templates") @router.get(_base_url + "/api/info.json", response_class=JSONResponse) def api_info() -> None: - database.cursor.execute("SELECT (SELECT COUNT(domain) FROM instances) AS total_websites, (SELECT COUNT(domain) FROM instances WHERE software IN ('pleroma', 'mastodon', 'lemmy', 'friendica', 'misskey', 'peertube', 'takahe', 'gotosocial', 'brighteon', 'wildebeest', 'bookwyrm', 'mitra', 'areionskey', 'mammuthus', 'neodb', 'smithereen', 'vebinet', 'toki', 'snac', 'biblioreads', 'wordpress', 'oolong', 'diaspora')) AS supported_instances, (SELECT COUNT(blocker) FROM blocks) AS total_blocks, (SELECT COUNT(domain) FROM instances WHERE last_error_details IS NOT NULL) AS erroneous_instances") + database.cursor.execute("SELECT ( \ +SELECT COUNT(domain) FROM instances) AS total_websites, \ +(SELECT COUNT(domain) FROM instances WHERE software IN ( \ + 'pleroma' , 'mastodon', 'lemmy' , 'friendica', 'misskey' , \ + 'peertube' , 'takahe' , 'gotosocial', 'brighteon', 'wildebeest' , \ + 'bookwyrm' , 'mitra' , 'areionskey', 'mammuthus', 'neodb' , \ + 'smithereen', 'vebinet' , 'toki' , 'snac' , 'biblioreads', \ + 'wordpress' , 'oolong' , 'diaspora' , 'appy' \ +)) AS supported_instances, \ +(SELECT COUNT(blocker) FROM blocks) AS total_blocks, \ +(SELECT COUNT(domain) FROM instances WHERE last_error_details IS NOT NULL) AS erroneous_instances") row = database.cursor.fetchone() diff --git a/fba/commands.py b/fba/commands.py index 5a1d960..e0b662f 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1071,7 +1071,7 @@ def fetch_instances(args: argparse.Namespace) -> int: database.cursor.execute( "SELECT domain, origin, software \ FROM instances \ -WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'lemmy', 'peertube', 'takahe', 'gotosocial', 'brighteon', 'wildebeest', 'bookwyrm', 'mitra', 'areionskey', 'mammuthus', 'neodb', 'smithereen', 'vebinet', 'toki', 'snac', 'biblioreads', 'wordpress', 'oolong', 'diaspora') \ +WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'lemmy', 'peertube', 'takahe', 'gotosocial', 'brighteon', 'wildebeest', 'bookwyrm', 'mitra', 'areionskey', 'mammuthus', 'neodb', 'smithereen', 'vebinet', 'toki', 'snac', 'biblioreads', 'wordpress', 'oolong', 'diaspora', 'appy') \ ORDER BY total_peers DESC, last_response_time ASC, last_updated ASC" ) diff --git a/fba/helpers/software.py b/fba/helpers/software.py index 342ee51..84a0a94 100644 --- a/fba/helpers/software.py +++ b/fba/helpers/software.py @@ -83,6 +83,7 @@ _misskey_aliases = [ "kookie", "barkle", "yojo-art", + "forkey", ] # Aliases for pleroma @@ -94,7 +95,8 @@ _pleroma_aliases = [ "incestoma", "revolver", "menzoberranzan", - "moon-eyed" + "moon-eyed", + "puppyoma", ] logging.basicConfig(level=logging.INFO) -- 2.39.5