-
Notifications
You must be signed in to change notification settings - Fork 3
/
nodeinfo.go
52 lines (45 loc) · 1.05 KB
/
nodeinfo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package activityserve
import (
"strings"
"github.com/writefreely/go-nodeinfo"
)
type nodeInfoResolver struct {
actors int
}
func nodeInfoConfig(baseURL string) *nodeinfo.Config {
name := "Pherephone"
desc := "An ActivityPub repeater."
return &nodeinfo.Config{
BaseURL: baseURL,
InfoURL: "/api/nodeinfo",
Metadata: nodeinfo.Metadata{
NodeName: name,
NodeDescription: desc,
Software: nodeinfo.SoftwareMeta{
HomePage: "https://pherephone.org",
GitHub: "https://github.com/writeas/pherephone",
},
},
Protocols: []nodeinfo.NodeProtocol{
nodeinfo.ProtocolActivityPub,
},
Services: nodeinfo.Services{
Inbound: []nodeinfo.NodeService{},
Outbound: []nodeinfo.NodeService{},
},
Software: nodeinfo.SoftwareInfo{
Name: strings.ToLower(libName),
Version: version,
},
}
}
func (r nodeInfoResolver) IsOpenRegistration() (bool, error) {
return false, nil
}
func (r nodeInfoResolver) Usage() (nodeinfo.Usage, error) {
return nodeinfo.Usage{
Users: nodeinfo.UsageUsers{
Total: r.actors,
},
}, nil
}