[backend] use MetaService to provide instance name and description in nodeinfo
This commit is contained in:
parent
2b124f9e34
commit
b64a8898aa
1 changed files with 5 additions and 3 deletions
|
@ -5,6 +5,7 @@ using Iceshrimp.Backend.Controllers.Shared.Attributes;
|
||||||
using Iceshrimp.Backend.Core.Configuration;
|
using Iceshrimp.Backend.Core.Configuration;
|
||||||
using Iceshrimp.Backend.Core.Database;
|
using Iceshrimp.Backend.Core.Database;
|
||||||
using Iceshrimp.Backend.Core.Federation.WebFinger;
|
using Iceshrimp.Backend.Core.Federation.WebFinger;
|
||||||
|
using Iceshrimp.Backend.Core.Services;
|
||||||
using Microsoft.AspNetCore.Cors;
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
@ -19,7 +20,8 @@ namespace Iceshrimp.Backend.Controllers.Federation;
|
||||||
public class NodeInfoController(
|
public class NodeInfoController(
|
||||||
IOptions<Config.InstanceSection> instanceConfig,
|
IOptions<Config.InstanceSection> instanceConfig,
|
||||||
IOptions<Config.StorageSection> storageConfig,
|
IOptions<Config.StorageSection> storageConfig,
|
||||||
DatabaseContext db
|
DatabaseContext db,
|
||||||
|
MetaService meta
|
||||||
) : ControllerBase
|
) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("2.1")]
|
[HttpGet("2.1")]
|
||||||
|
@ -74,8 +76,8 @@ public class NodeInfoController(
|
||||||
Metadata = new NodeInfoResponse.NodeInfoMetadata
|
Metadata = new NodeInfoResponse.NodeInfoMetadata
|
||||||
{
|
{
|
||||||
//FIXME Implement members
|
//FIXME Implement members
|
||||||
NodeName = "Iceshrimp.NET",
|
NodeName = await meta.GetAsync(MetaEntity.InstanceName),
|
||||||
NodeDescription = "An Iceshrimp.NET instance",
|
NodeDescription = await meta.GetAsync(MetaEntity.InstanceDescription),
|
||||||
Maintainer = new NodeInfoResponse.Maintainer { Name = "todo", Email = "todo" },
|
Maintainer = new NodeInfoResponse.Maintainer { Name = "todo", Email = "todo" },
|
||||||
Languages = [],
|
Languages = [],
|
||||||
TosUrl = "todo",
|
TosUrl = "todo",
|
||||||
|
|
Loading…
Add table
Reference in a new issue