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": {