From: Roland Häder Date: Thu, 20 Jul 2023 12:51:22 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b4a0ec98a50250efcb83118d807f73d72de1c34e;p=fba.git Continued: - added another alias for misskey - / (index page) should be last --- diff --git a/daemon.py b/daemon.py index 91c43cd..42a7276 100755 --- 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")) diff --git a/fba/helpers/software.py b/fba/helpers/software.py index 085577f..209b588 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 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"]: