Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Add “services” and “metadata” to NodeInfo/2.0 (#1922)

Meisam1a3c854b23fc
diff --git a/activitypub/controllers/nodeinfo.go b/activitypub/controllers/nodeinfo.go
index 6d25894e14..5f73bf8d7a 100644
--- a/activitypub/controllers/nodeinfo.go
+++ b/activitypub/controllers/nodeinfo.go
@@ -59,6 +59,13 @@ func NodeInfoController(w http.ResponseWriter, r *http.Request) {
// NodeInfoV2Controller returns the V2 node info response.
func NodeInfoV2Controller(w http.ResponseWriter, r *http.Request) {
+ type metadata struct {
+ ChatEnabled bool `json:"chat_enabled"`
+ }
+ type services struct {
+ Outbound []string `json:"outbound"`
+ Inbound []string `json:"inbound"`
+ }
type software struct {
Name string `json:"name"`
Version string `json:"version"`
@@ -74,10 +81,12 @@ func NodeInfoV2Controller(w http.ResponseWriter, r *http.Request) {
}
type response struct {
Version string `json:"version"`
+ Services services `json:"services"`
Software software `json:"software"`
Protocols []string `json:"protocols"`
Usage usage `json:"usage"`
OpenRegistrations bool `json:"openRegistrations"`
+ Metadata metadata `json:"metadata"`
}
if !data.GetFederationEnabled() {
@@ -89,6 +98,10 @@ func NodeInfoV2Controller(w http.ResponseWriter, r *http.Request) {
res := response{
Version: "2.0",
+ Services: services{
+ Inbound: []string{""},
+ Outbound: []string{""},
+ },
Software: software{
Name: "owncast",
Version: config.VersionNumber,
@@ -103,6 +116,9 @@ func NodeInfoV2Controller(w http.ResponseWriter, r *http.Request) {
},
OpenRegistrations: false,
Protocols: []string{"activitypub"},
+ Metadata: metadata{
+ ChatEnabled: !data.GetChatDisabled(),
+ },
}
if err := writeResponse(res, w); err != nil {