diff --git a/modules/installed/privacy/templates/tor.html b/modules/installed/privacy/templates/tor.html new file mode 100644 index 000000000..74e129a69 --- /dev/null +++ b/modules/installed/privacy/templates/tor.html @@ -0,0 +1,29 @@ +{% extends "login_nav.html" %} + +{% block main_block %} + +

Tor is an anonymous communication system. You can learn more about +it from the Tor Project +website. For best protection when web surfing, the Tor Project +recommends that you use +the Tor +Browser Bundle.

+ +

A Tor SOCKS port is available on your FreedomBox on TCP port +9050.

+ +

Your FreedomBox is configured as a Tor bridge with obfsproxy, so it +can help circumvent censorship. If your FreedomBox is behind a router +or firewall, you should make sure the following ports are open, and +port-forwarded, if necessary:

+ + + {% for name, port in tor_ports.items %} + + + + + {% endfor %} +
{{ name }}{{ port }}
+ +{% endblock %} diff --git a/modules/installed/privacy/tor.py b/modules/installed/privacy/tor.py index 8396a15e0..404553629 100644 --- a/modules/installed/privacy/tor.py +++ b/modules/installed/privacy/tor.py @@ -40,24 +40,14 @@ class tor(PagePlugin): def index(self): output, error = actions.superuser_run("tor-get-ports") port_info = output.split("\n") - ports = {} + tor_ports = {} for line in port_info: try: (key, val) = line.split() - ports[key] = val + tor_ports[key] = val except ValueError: continue - main = _(""" -

Tor is an anonymous communication system. You can learn more about it from the Tor Project website. For best protection when web surfing, the Tor Project recommends that you use the Tor Browser Bundle.

-

A Tor SOCKS port is available on your FreedomBox on TCP port 9050.

-

Your FreedomBox is configured as a Tor bridge with obfsproxy, so it can help circumvent censorship. If your FreedomBox is behind a router or firewall, you should make sure the following ports are open, and port-forwarded, if necessary:

- """) - - main += '' - for key in ports: - main += "" - main += "" - main += "
" + str(key) + "" + str(ports[key]) + "
" - - return util.render_template(title=_("Tor Control Panel"), main=main) + return util.render_template(template='tor', + title=_('Tor Control Panel'), + tor_ports=tor_ports)