fix: Fetch nodeinfo endpoint address from .well-known/nodeinfo when checking instance availability

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2561>
This commit is contained in:
Georg Krause 2023-08-29 10:30:15 +02:00 committed by Marge
commit e78191c917
3 changed files with 15 additions and 3 deletions

View file

@ -643,8 +643,7 @@ def check_all_remote_instance_availability():
@celery.app.task(name="federation.check_single_remote_instance_availability")
def check_single_remote_instance_availability(domain):
try:
response = requests.get(f"https://{domain.name}/api/v1/instance/nodeinfo/2.0/")
nodeinfo = response.json()
nodeinfo = fetch_nodeinfo(domain.name)
except Exception as e:
logger.info(
f"Domain {domain.name} could not be reached because of the following error : {e}. \