]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 15 Mar 2025 00:14:24 +0000 (01:14 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 15 Mar 2025 00:14:24 +0000 (01:14 +0100)
- formatted SQL command
- added alias for misskey/pleroma

daemon.py
fba/commands.py
fba/helpers/software.py

index cc268d021d7d2824ce8ebfb1c58e37517be4a199..da2b1c4c0837184571ce643be06ea0e87969692e 100755 (executable)
--- 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()
 
index 5a1d960403a35f70f12f4ab27e2d58b22a76a2c5..e0b662f92ea5d054728ffca80399af13241469ba 100644 (file)
@@ -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"
     )
 
index 342ee513453dba802cb3fa0b969b2b750a49aa43..84a0a9475944d450d10b1489b2b288ae263cdd10 100644 (file)
@@ -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)