diff --git a/api/funkwhale_api/federation/views.py b/api/funkwhale_api/federation/views.py index 35043e8ed5cc35a530b75de0c00dd30001cc3632..f0ac6687dbb789ccf281417f141cd4b5387894b4 100644 --- a/api/funkwhale_api/federation/views.py +++ b/api/funkwhale_api/federation/views.py @@ -143,8 +143,6 @@ class WellKnownViewSet(viewsets.GenericViewSet): @action(methods=["get"], detail=False) def nodeinfo(self, request, *args, **kwargs): - if not preferences.get("instance__nodeinfo_enabled"): - return HttpResponse(status=404) data = { "links": [ { diff --git a/api/funkwhale_api/instance/dynamic_preferences_registry.py b/api/funkwhale_api/instance/dynamic_preferences_registry.py index be360701dd7cb626eee8d6eafb7f3e867b2c7a13..66d8211c155f789c454225d581301cbb435f67b0 100644 --- a/api/funkwhale_api/instance/dynamic_preferences_registry.py +++ b/api/funkwhale_api/instance/dynamic_preferences_registry.py @@ -127,21 +127,6 @@ class RavenDSN(types.StringPreference): field_kwargs = {"required": False} -@global_preferences_registry.register -class InstanceNodeinfoEnabled(types.BooleanPreference): - show_in_api = False - section = instance - name = "nodeinfo_enabled" - default = True - verbose_name = "Enable nodeinfo endpoint" - help_text = ( - "This endpoint is needed for your about page to work. " - "It's also helpful for the various monitoring " - "tools that map and analyzize the fediverse, " - "but you can disable it completely if needed." - ) - - @global_preferences_registry.register class InstanceNodeinfoPrivate(types.BooleanPreference): show_in_api = False diff --git a/api/funkwhale_api/instance/views.py b/api/funkwhale_api/instance/views.py index 1800c3dbc7e60bcc022f24dd3e64d6a0d45b8697..29a947cb16fa2d4628b75d917b64b1e1a2953814 100644 --- a/api/funkwhale_api/instance/views.py +++ b/api/funkwhale_api/instance/views.py @@ -4,7 +4,6 @@ from dynamic_preferences.registries import global_preferences_registry from rest_framework import views from rest_framework.response import Response -from funkwhale_api.common import preferences from funkwhale_api.users.oauth import permissions as oauth_permissions from . import nodeinfo @@ -38,7 +37,5 @@ class NodeInfo(views.APIView): authentication_classes = [] def get(self, request, *args, **kwargs): - if not preferences.get("instance__nodeinfo_enabled"): - return Response(status=404) data = nodeinfo.get() return Response(data, status=200, content_type=NODEINFO_2_CONTENT_TYPE) diff --git a/api/tests/federation/test_views.py b/api/tests/federation/test_views.py index a47fdd198d08a0e051e3cd0f81f5f53ea7cf2eff..4428ae925ae1942d8c56b6dcb3d9f4eaf26911d0 100644 --- a/api/tests/federation/test_views.py +++ b/api/tests/federation/test_views.py @@ -48,13 +48,6 @@ def test_wellknown_nodeinfo(db, preferences, api_client, settings): assert response.data == expected -def test_wellknown_nodeinfo_disabled(db, preferences, api_client): - preferences["instance__nodeinfo_enabled"] = False - url = reverse("federation:well-known-nodeinfo") - response = api_client.get(url) - assert response.status_code == 404 - - def test_local_actor_detail(factories, api_client): user = factories["users.User"](with_actor=True) url = reverse( diff --git a/api/tests/instance/test_views.py b/api/tests/instance/test_views.py index 0b3b7b79ad2e57716159a5fd12396068ef04bdd8..08c448053082f7fad23bb13c9f196b1c623fab14 100644 --- a/api/tests/instance/test_views.py +++ b/api/tests/instance/test_views.py @@ -12,14 +12,6 @@ def test_nodeinfo_endpoint(db, api_client, mocker): assert response.data == payload -def test_nodeinfo_endpoint_disabled(db, api_client, preferences): - preferences["instance__nodeinfo_enabled"] = False - url = reverse("api:v1:instance:nodeinfo-2.0") - response = api_client.get(url) - - assert response.status_code == 404 - - def test_settings_only_list_public_settings(db, api_client, preferences): url = reverse("api:v1:instance:settings") response = api_client.get(url) diff --git a/changes/changelog.d/982.bugfix b/changes/changelog.d/982.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..1e0252c3f14e999aa069c1759f9dbf4287581a23 --- /dev/null +++ b/changes/changelog.d/982.bugfix @@ -0,0 +1 @@ +Removed "nodeinfo disabled" setting, as nodeinfo is required for the UI to work (#982) diff --git a/front/src/views/admin/Settings.vue b/front/src/views/admin/Settings.vue index eeba965ad724a86b13cb352e2062c1bd1d4af007..e9072d51196c2723d4d535f9cef4985adeec48ec 100644 --- a/front/src/views/admin/Settings.vue +++ b/front/src/views/admin/Settings.vue @@ -159,7 +159,6 @@ export default { label: statisticsLabel, id: "statistics", settings: [ - "instance__nodeinfo_enabled", "instance__nodeinfo_stats_enabled", "instance__nodeinfo_private" ]