added gettoraddress private endpoint

This commit is contained in:
Kevin 2020-06-21 17:54:30 -05:00
parent 7d8c3f75e4
commit 6c75c525d2

View File

@ -20,6 +20,7 @@ from onionrutils import mnemonickeys
from onionrutils import bytesconverter from onionrutils import bytesconverter
from etc import onionrvalues from etc import onionrvalues
from utils import reconstructhash from utils import reconstructhash
from utils.gettransports import get as get_tor
""" """
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -140,3 +141,8 @@ class PrivateEndpoints:
def is_tor_ready(): def is_tor_ready():
"""If Tor is starting up, the web UI is not ready to be used.""" """If Tor is starting up, the web UI is not ready to be used."""
return Response(str(g.too_many.get(NetController).readyState).lower()) return Response(str(g.too_many.get(NetController).readyState).lower())
@private_endpoints_bp.route('/gettoraddress')
def get_tor_address():
"""Return public Tor v3 Onion address for this node"""
return Response(get_tor()[0])