mirror of https://gitlab.com/bashrc2/epicyon
Include documents within nodeinfo
parent
d5c23b4dff
commit
eeeec16297
13
daemon.py
13
daemon.py
|
@ -988,7 +988,20 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if brochMode:
|
||||
showNodeInfoAccounts = False
|
||||
|
||||
if callingDomain.endswith('.onion') and \
|
||||
self.server.onionDomain:
|
||||
instanceUrl = 'http://' + self.server.onionDomain
|
||||
elif (callingDomain.endswith('.i2p') and
|
||||
self.server.i2pDomain):
|
||||
instanceUrl = 'http://' + self.server.i2pDomain
|
||||
else:
|
||||
instanceUrl = \
|
||||
self.server.httpPrefix + '://' + self.server.domainFull
|
||||
|
||||
aboutUrl = instanceUrl + '/about'
|
||||
termsOfServiceUrl = instanceUrl + '/terms'
|
||||
info = metaDataNodeInfo(self.server.baseDir,
|
||||
aboutUrl, termsOfServiceUrl,
|
||||
self.server.registration,
|
||||
nodeInfoVersion,
|
||||
showNodeInfoAccounts)
|
||||
|
|
|
@ -12,7 +12,10 @@ from utils import noOfAccounts
|
|||
from utils import noOfActiveAccountsMonthly
|
||||
|
||||
|
||||
def metaDataNodeInfo(baseDir: str, registration: bool, version: str,
|
||||
def metaDataNodeInfo(baseDir: str,
|
||||
aboutUrl: str,
|
||||
termsOfServiceUrl: str,
|
||||
registration: bool, version: str,
|
||||
showAccounts: bool) -> {}:
|
||||
""" /nodeinfo/2.0 endpoint
|
||||
Also see https://socialhub.activitypub.rocks/t/
|
||||
|
@ -40,6 +43,10 @@ def metaDataNodeInfo(baseDir: str, registration: bool, version: str,
|
|||
'name': 'epicyon',
|
||||
'version': version
|
||||
},
|
||||
'documents': {
|
||||
'about': aboutUrl,
|
||||
'terms': termsOfServiceUrl
|
||||
},
|
||||
'usage': {
|
||||
'localPosts': 1,
|
||||
'users': {
|
||||
|
|
Loading…
Reference in New Issue