Skip to content
Permalink
Browse files

Give info about when the registrations are open

  • Loading branch information...
yabirgb committed Feb 16, 2019
1 parent e7557e0 commit 912b0f7b2aca15eadd2131f9fb9041fd9a05de4e
Showing with 17 additions and 8 deletions.
  1. +17 −8 src/api/v1/server.py
@@ -1,7 +1,7 @@
import json
from tornado.web import HTTPError, RequestHandler

from settings import (ID, NODENAME, DOMAIN, SCHEME)
from settings import (ID, NODENAME, DOMAIN, SCHEME, REG_OPEN)
from release_info import VERSION

from models.followers import FollowerRelation
@@ -17,14 +17,19 @@ class WellKnownNodeInfo(BaseHandler):

def get(self):

links = [
data = {'links':[
{
"rel": "http://nodeinfo.diaspora.software/ns/schema/2.0",
"href": "{}/nodeinfo.json".format(ID),
"href": "{}/api/nodeinfo/2.0.json".format(ID),
}
]
]}

self.write(links)
self.write(data)

class RegistrationOpen(BaseHandler):

def get(self):
self.write({"Open": REG_OPEN})


class NodeInfo(BaseHandler):
@@ -38,20 +43,24 @@ class NodeInfo(BaseHandler):
"version": "2.0",
"software": {
"name": "Anfora",
"version": "Anfora {}".format(VERSION),
"version": "{}".format(VERSION),
},
"protocols": ["activitypub"],
"services": {"inbound": [], "outbound": []},
"openRegistrations": False,
"openRegistrations": REG_OPEN,
"usage": {
"users": {
"total": number_of_users
},
"localPosts": number_of_statuses
},
"metadata": {
"sourceCode": "https://github.com/anforaProject/anfora",
"nodeName": NODENAME,
"software": {
"homepage": "https://anfora.app",
"github": "https://github.com/anforaProject/anfora",
"follow": "https://mastodon.social/@anfora"
},
},
}

0 comments on commit 912b0f7

Please sign in to comment.
You can’t perform that action at this time.