Skip to content
Snippets Groups Projects
Verified Commit 175d7012 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Fix #982: Removed "nodeinfo disabled" setting, as nodeinfo is required for the UI to work

parent dd9cca43
No related branches found
No related tags found
No related merge requests found
......@@ -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": [
{
......
......@@ -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
......
......@@ -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)
......@@ -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(
......
......@@ -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)
......
Removed "nodeinfo disabled" setting, as nodeinfo is required for the UI to work (#982)
......@@ -159,7 +159,6 @@ export default {
label: statisticsLabel,
id: "statistics",
settings: [
"instance__nodeinfo_enabled",
"instance__nodeinfo_stats_enabled",
"instance__nodeinfo_private"
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment