]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 20 Jul 2023 12:51:22 +0000 (14:51 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 20 Jul 2023 12:51:22 +0000 (14:51 +0200)
- added another alias for misskey
- / (index page) should be last

daemon.py
fba/helpers/software.py

index 91c43cd1b15f8947aca951a2c3e5c9a91f979c03..42a72761c126afd806c41b8248fc182fb271bbc0 100755 (executable)
--- a/daemon.py
+++ b/daemon.py
@@ -299,21 +299,6 @@ def scoreboard(request: Request, mode: str, amount: int):
         "scores"    : json_helper.from_response(response)
     })
 
-@router.get(config.get("base_url") + "/")
-def index(request: Request):
-    # Get info
-    response = requests.get(f"http://{config.get('host')}:{config.get('port')}{config.get('base_url')}/api/info.json")
-
-    if not response.ok:
-        raise HTTPException(status_code=response.status_code, detail=response.text)
-
-    return templates.TemplateResponse("views/index.html", {
-        "request": request,
-        "theme"  : config.get("theme"),
-        "info"   : response.json(),
-        "slogan" : config.get("slogan"),
-    })
-
 @router.get(config.get("base_url") + "/list")
 def list_domains(request: Request, mode: str, value: str, amount: int = config.get("api_limit")):
     if mode == "detection_mode" and not instances.valid(value, "detection_mode"):
@@ -458,5 +443,20 @@ def robots(request: Request):
         "base_url": config.get("base_url")
     })
 
+@router.get(config.get("base_url") + "/")
+def index(request: Request):
+    # Get info
+    response = requests.get(f"http://{config.get('host')}:{config.get('port')}{config.get('base_url')}/api/info.json")
+
+    if not response.ok:
+        raise HTTPException(status_code=response.status_code, detail=response.text)
+
+    return templates.TemplateResponse("views/index.html", {
+        "request": request,
+        "theme"  : config.get("theme"),
+        "info"   : response.json(),
+        "slogan" : config.get("slogan"),
+    })
+
 if __name__ == "__main__":
     uvicorn.run("daemon:router", host=config.get("host"), port=config.get("port"), log_level=config.get("log_level"))
index 085577fb04866041247f9cb046446e4c37c830e6..209b588d83a1b3030c64c084aaabbdaae1b7d34a 100644 (file)
@@ -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 or "мисскей" in software:
+    elif software in ["slipfox calckey", "calckey", "groundpolis", "foundkey", "cherrypick", "meisskey", "magnetar", "keybump", "dolphin", "calckey social", "azk.sns", "firefish"] or "shumihub" in software or "мисскей" in software:
         logger.debug("Setting misskey: software='%s'", software)
         software = "misskey"
     elif software in ["runtube.re", "islameye"]: