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:
|
if brochMode:
|
||||||
showNodeInfoAccounts = False
|
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,
|
info = metaDataNodeInfo(self.server.baseDir,
|
||||||
|
aboutUrl, termsOfServiceUrl,
|
||||||
self.server.registration,
|
self.server.registration,
|
||||||
nodeInfoVersion,
|
nodeInfoVersion,
|
||||||
showNodeInfoAccounts)
|
showNodeInfoAccounts)
|
||||||
|
|
|
@ -12,7 +12,10 @@ from utils import noOfAccounts
|
||||||
from utils import noOfActiveAccountsMonthly
|
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) -> {}:
|
showAccounts: bool) -> {}:
|
||||||
""" /nodeinfo/2.0 endpoint
|
""" /nodeinfo/2.0 endpoint
|
||||||
Also see https://socialhub.activitypub.rocks/t/
|
Also see https://socialhub.activitypub.rocks/t/
|
||||||
|
@ -40,6 +43,10 @@ def metaDataNodeInfo(baseDir: str, registration: bool, version: str,
|
||||||
'name': 'epicyon',
|
'name': 'epicyon',
|
||||||
'version': version
|
'version': version
|
||||||
},
|
},
|
||||||
|
'documents': {
|
||||||
|
'about': aboutUrl,
|
||||||
|
'terms': termsOfServiceUrl
|
||||||
|
},
|
||||||
'usage': {
|
'usage': {
|
||||||
'localPosts': 1,
|
'localPosts': 1,
|
||||||
'users': {
|
'users': {
|
||||||
|
|
Loading…
Reference in New Issue