From 193abb68c1986a8d67c1a3c94bcb1493889c0f67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 24 Jul 2023 10:30:42 +0200 Subject: [PATCH] Continued: - added more aliases, please don't touch this part of your software or else other software cannot maybe handle it correctly --- fba/helpers/software.py | 9 +++++++++ fba/http/federation.py | 16 ++++++++-------- templates/views/scoreboard.html | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/fba/helpers/software.py b/fba/helpers/software.py index bc1e2ce..bd9905b 100644 --- a/fba/helpers/software.py +++ b/fba/helpers/software.py @@ -46,6 +46,15 @@ def alias(software: str) -> str: elif software in ["nextcloud social", "nextcloudpi", "storage share"]: logger.debug("Setting nextcloud: software='%s'", software) software = "nextcloud" + elif software == "activity-relay": + logger.debug("Setting activityrelay: software='%s'", software) + software = "activityrelay" + elif "owncast" in software: + logger.debug("Setting owncast: software='%s'", software) + software = "owncast" + elif software in ["streams-hubzilla-social", "streams13"]: + logger.debug("Setting streams: software='%s'", software) + software = "streams" elif software == "roadhouse": logger.debug("Setting hubzilla: software='%s'", software) software = "hubzilla" diff --git a/fba/http/federation.py b/fba/http/federation.py index 540f741..895a509 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -497,14 +497,6 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str: if software is not None and software != "": logger.info("domain='%s' is generated by software='%s' - Setting detection_mode=GENERATOR ...", domain, software) instances.set_detection_mode(domain, "GENERATOR") - elif isinstance(site_name, bs4.element.Tag) and isinstance(site_name.get("content"), str): - logger.debug("Found property=og:site_name, domain='%s'", domain) - software = tidyup.domain(site_name.get("content")) - - logger.debug("software[%s]='%s'", type(software), software) - if software is not None and software != "": - logger.debug("domain='%s' has og:site_name='%s' - Setting detection_mode=SITE_NAME ...", domain, software) - instances.set_detection_mode(domain, "SITE_NAME") elif isinstance(platform, bs4.element.Tag) and isinstance(platform.get("content"), str): logger.debug("Found property=og:platform, domain='%s'", domain) software = tidyup.domain(platform.get("content")) @@ -513,6 +505,14 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str: if software is not None and software != "": logger.debug("domain='%s' has og:platform='%s' - Setting detection_mode=PLATFORM ...", domain, software) instances.set_detection_mode(domain, "PLATFORM") + elif isinstance(site_name, bs4.element.Tag) and isinstance(site_name.get("content"), str): + logger.debug("Found property=og:site_name, domain='%s'", domain) + software = tidyup.domain(site_name.get("content")) + + logger.debug("software[%s]='%s'", type(software), software) + if software is not None and software != "": + logger.debug("domain='%s' has og:site_name='%s' - Setting detection_mode=SITE_NAME ...", domain, software) + instances.set_detection_mode(domain, "SITE_NAME") elif not domain_helper.is_in_url(domain, response.url): logger.warning("domain='%s' doesn't match response.url='%s', maybe redirect to other domain?", domain, response.url) diff --git a/templates/views/scoreboard.html b/templates/views/scoreboard.html index bb25f1f..776dbc7 100644 --- a/templates/views/scoreboard.html +++ b/templates/views/scoreboard.html @@ -82,8 +82,8 @@
  • AUTO_DISCOVERY: /.well-known/nodeinfo was reachable and software type was found in nodeinfo response
  • STATIC_CHECK: Node information was found by probing for well-known URLs
  • GENERATOR: Meta data generator was found in HTML code
  • -
  • SITE_NAME: Meta data og:site_name was found in HTML code
  • PLATFORM: Meta data og:platform was found in HTML code
  • +
  • SITE_NAME: Meta data og:site_name was found in HTML code
  • None: the instance was not reachable or the used software was not stated
  • -- 2.39.2