Show onion address on about screen

main
Bob Mottram 2020-04-17 17:30:06 +01:00
parent c73f4970c5
commit 859fe460b9
2 changed files with 9 additions and 3 deletions

View File

@ -1344,11 +1344,13 @@ class PubServer(BaseHTTPRequestHandler):
msg = \
htmlAbout(self.server.baseDir,
self.server.httpPrefix,
self.server.domainFull).encode()
self.server.domainFull,
self.server.onionDomain).encode()
else:
msg = \
htmlAbout(self.server.baseDir, 'http',
self.server.onionDomain).encode()
self.server.onionDomain,
None).encode()
self._login_headers('text/html', len(msg), callingDomain)
self._write(msg)
return

View File

@ -1437,7 +1437,8 @@ def htmlTermsOfService(baseDir: str, httpPrefix: str, domainFull: str) -> str:
return TOSForm
def htmlAbout(baseDir: str, httpPrefix: str, domainFull: str) -> str:
def htmlAbout(baseDir: str, httpPrefix: str,
domainFull: str, onionDomain: str) -> str:
"""Show the about screen
"""
adminNickname = getConfigParam(baseDir, 'admin')
@ -1466,6 +1467,9 @@ def htmlAbout(baseDir: str, httpPrefix: str, domainFull: str) -> str:
aboutForm = htmlHeader(cssFilename, termsCSS)
aboutForm += '<div class="container">' + aboutText + '</div>'
if onionDomain:
aboutForm += \
'<div class="container">http://' + onionDomain + '</div>'
if adminNickname:
adminActor = \
httpPrefix + '://' + domainFull + '/users/' + adminNickname