add admin email to nodeinfo metadata

This commit is contained in:
Nicolas Constant 2020-07-08 18:41:47 -04:00
parent e52f2b8c73
commit a23271613d
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
6 changed files with 22 additions and 4 deletions

View File

@ -3,7 +3,7 @@
public class InstanceSettings
{
public string Domain { get; set; }
public string AdminEmail { get; set; }
public string PostgresConnString { get; set; }
}
}

View File

@ -77,6 +77,10 @@ namespace BirdsiteLive.Controllers
{
inbound = new object[0],
outbound = new object[0]
},
metadata = new Metadata()
{
email = _settings.AdminEmail
}
};
return new JsonResult(nodeInfo);
@ -109,6 +113,10 @@ namespace BirdsiteLive.Controllers
{
inbound = new object[0],
outbound = new object[0]
},
metadata = new Metadata()
{
email = _settings.AdminEmail
}
};
return new JsonResult(nodeInfo);

View File

@ -0,0 +1,7 @@
namespace BirdsiteLive.Models.WellKnownModels
{
public class Metadata
{
public string email { get; set; }
}
}

View File

@ -1,4 +1,6 @@
namespace BirdsiteLive.Models.WellKnownModels
using System.ComponentModel.DataAnnotations;
namespace BirdsiteLive.Models.WellKnownModels
{
public class NodeInfoV20
{
@ -8,6 +10,6 @@
public Usage usage { get; set; }
public bool openRegistrations { get; set; }
public Services services { get; set; }
//public object metadata { get; set; }
public Metadata metadata { get; set; }
}
}

View File

@ -8,6 +8,6 @@
public bool openRegistrations { get; set; }
public SoftwareV21 software { get; set; }
public Services services { get; set; }
//public object metadata { get; set; }
public Metadata metadata { get; set; }
}
}

View File

@ -9,6 +9,7 @@
"AllowedHosts": "*",
"Instance": {
"Domain": "domain.name",
"AdminEmail": "me@domain.name",
"PostgresConnString": "Host=127.0.0.1;Username=username;Password=password;Database=mydb"
},
"Twitter": {