Minor updates to Tor service

This commit is contained in:
Sunil Mohan Adapa committed 2014-10-20 00:22:19 +05:30
1 parent 84640560b5
commit 71b27be720
3 files changed
+17 -15

No files matched your search

+3 -3
View File
@@ -26,9 +26,9 @@
<br style='clear:both'>
{% if is_running %}
<div class='circle active'></div> Tor is running
<div class='running-status active'></div> Tor is running
{% else %}
<div class='circle inactive'></div> Tor is not running
<div class='running-status inactive'></div> Tor is not running
{% endif %}
<br style='clear:both'>
@@ -84,7 +84,7 @@ A Tor SOCKS port is available on your FreedomBox on TCP port
website. For best protection when web surfing, the Tor Project
recommends that you use
the <a href="https://www.torproject.org/download/download-easy.html.en">Tor
Browser Bundle</a>.</p>
Browser Bundle</a>.</p>
</div>
+8 -8
View File
@@ -39,7 +39,7 @@ class TorForm(forms.Form): # pylint: disable=W0232
def init():
"""Initialize the Tor module"""
menu = cfg.main_menu.get('apps:index')
menu.add_urlname("Tor", "icon-eye-close", "tor:index", 30)
menu.add_urlname('Tor', 'icon-eye-close', 'tor:index', 30)
@login_required
@@ -71,10 +71,10 @@ def index(request):
def get_status():
"""Return the current status"""
is_running = actions.superuser_run("tor", ["is-running"]).strip() == "yes"
is_running = actions.superuser_run('tor', ['is-running']).strip() == 'yes'
output = actions.superuser_run("tor-get-ports")
port_info = output.split("\n")
output = actions.superuser_run('tor-get-ports')
port_info = output.split('\n')
ports = {}
for line in port_info:
try:
@@ -83,12 +83,12 @@ def get_status():
except ValueError:
continue
output = actions.superuser_run("tor", ["get-hs"])
output = actions.superuser_run('tor', ['get-hs'])
output = output.strip()
if output == "":
if output == '':
hs_enabled = False
hs_hostname = "Not Configured"
hs_ports = ""
hs_hostname = 'Not Configured'
hs_ports = ''
else:
hs_enabled = True
hs_info = output.split()