LemmyNet / lemmy

🐀 A link aggregator and forum for the fediverse
https://join-lemmy.org
GNU Affero General Public License v3.0
13.26k stars 881 forks source link

Configuration options for nodeinfo #4903

Open lullis opened 3 months ago

lullis commented 3 months ago

Requirements

Is your proposal related to a problem?

When building the database for https://fediverser.network, I'd like to be able to use the nodeinfo endpoint to query an instance about extra capabilities:

Describe the solution you'd like.

I believe that the "metadata" field in the nodeinfo schema should be fine for that. it is a simple freeform key-value property map and it doesn't need to be more complicated than that.

Describe alternatives you've considered.

Using a proxy server to rewrite the response from lemmy. In the case of fediverser specifically, it could work because I already can reroute some of the requests away from Lemmy.

Additional context

What would be the best place to have this? Ideally it would be part of the settings for the instance, but it would okay if it was defined at deploy time on config.hjson.

Nutomic commented 3 months ago

I can definitely see how this would be useful, though Im unsure whats the best way to do it. Having admins manually enter freeform data sounds like a hassle, and easy to mess things up.

We could configure this through the ui, but that requires changes to the database, api and frontend to add various separate form fields. Overall a lot of effort. Doing it through the config would be trivial to implement in comparison so I would use that approach.

dessalines commented 3 months ago

If you know its a lemmy instance from the nodeinfo, you can then call https://voyager.lemmy.ml/api/v3/site to get things like the privacy policy (located at site_view.local_site.legal), and various other site-specific settings.

https://join-lemmy.org/api/interfaces/GetSiteResponse.html

I'm not sure how useful it'd be to try to duplicate all that in the nodeinfo, and especially if its dynamic data, hard-coding that wouldn't work anyway.