mirror of https://gitlab.com/bashrc2/epicyon
Metadata for monthly active accounts
parent
4e97b26bfa
commit
d0c1ff3603
|
@ -10,11 +10,14 @@ import os
|
||||||
import json
|
import json
|
||||||
import commentjson
|
import commentjson
|
||||||
from utils import noOfAccounts
|
from utils import noOfAccounts
|
||||||
|
from utils import noOfActiveAccountsMonthly
|
||||||
|
|
||||||
def metaDataNodeInfo(baseDir: str,registration: bool,version: str) -> {}:
|
def metaDataNodeInfo(baseDir: str,registration: bool,version: str) -> {}:
|
||||||
""" /nodeinfo/2.0 endpoint
|
""" /nodeinfo/2.0 endpoint
|
||||||
"""
|
"""
|
||||||
activeAccounts=noOfAccounts(baseDir)
|
activeAccounts=noOfAccounts(baseDir)
|
||||||
|
activeAccountsMonthly=noOfActiveAccountsMonthly(baseDir,1)
|
||||||
|
activeAccountsHalfYear=noOfActiveAccountsMonthly(baseDir,6)
|
||||||
nodeinfo = {
|
nodeinfo = {
|
||||||
'openRegistrations': registration,
|
'openRegistrations': registration,
|
||||||
'protocols': ['activitypub'],
|
'protocols': ['activitypub'],
|
||||||
|
@ -25,8 +28,8 @@ def metaDataNodeInfo(baseDir: str,registration: bool,version: str) -> {}:
|
||||||
'usage': {
|
'usage': {
|
||||||
'localPosts': 1,
|
'localPosts': 1,
|
||||||
'users': {
|
'users': {
|
||||||
'activeHalfyear': 1,
|
'activeHalfyear': activeAccountsHalfYear,
|
||||||
'activeMonth': 1,
|
'activeMonth': activeAccountsMonthly,
|
||||||
'total': activeAccounts
|
'total': activeAccounts
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue