forked from forks/microblog.pub
Also update the nodeinfo endpoint
This commit is contained in:
parent
285d2fa890
commit
354a9ad13f
1 changed files with 6 additions and 1 deletions
7
app.py
7
app.py
|
@ -762,6 +762,11 @@ def note_by_id(note_id):
|
||||||
|
|
||||||
@app.route("/nodeinfo")
|
@app.route("/nodeinfo")
|
||||||
def nodeinfo():
|
def nodeinfo():
|
||||||
|
q = {
|
||||||
|
"box": Box.OUTBOX.value,
|
||||||
|
"meta.deleted": False, # TODO(tsileo): retrieve deleted and expose tombstone
|
||||||
|
'type': {'$in': [ActivityType.CREATE.value, ActivityType.ANNOUNCE.value]},
|
||||||
|
}
|
||||||
return Response(
|
return Response(
|
||||||
headers={
|
headers={
|
||||||
"Content-Type": "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#"
|
"Content-Type": "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#"
|
||||||
|
@ -778,7 +783,7 @@ def nodeinfo():
|
||||||
"openRegistrations": False,
|
"openRegistrations": False,
|
||||||
"usage": {
|
"usage": {
|
||||||
"users": {"total": 1},
|
"users": {"total": 1},
|
||||||
"localPosts": DB.activities.count({"box": Box.OUTBOX.value}),
|
"localPosts": DB.activities.count(q),
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"sourceCode": "https://github.com/tsileo/microblog.pub",
|
"sourceCode": "https://github.com/tsileo/microblog.pub",
|
||||||
|
|
Loading…
Reference in a new issue