mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
firewall: Display information that a service is internal only
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
9 files changed
+102
-19
No files matched your search
@@ -78,6 +78,12 @@ def get_enabled_services(zone):
|
||||
return output.split()
|
||||
|
||||
|
||||
def get_interfaces(zone):
|
||||
"""Return the list of interfaces in a zone."""
|
||||
output = _run(['get-interfaces', '--zone', zone], superuser=True)
|
||||
return output.split()
|
||||
|
||||
|
||||
def add_service(port, zone):
|
||||
"""Enable a service in firewall"""
|
||||
_run(['add-service', port, '--zone', zone], superuser=True)
|
||||
|
||||
@@ -74,7 +74,7 @@ def init():
|
||||
if not needs_setup:
|
||||
global socks_service
|
||||
socks_service = service_module.Service(
|
||||
'tor-socks', _('Tor Anonymity Network'), ports=['tor-socks'],
|
||||
'tor-socks', _('Tor Socks Proxy'), ports=['tor-socks'],
|
||||
is_external=False, is_enabled=utils.is_enabled,
|
||||
is_running=utils.is_running)
|
||||
|
||||
|
||||
@@ -80,6 +80,8 @@
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% include "internal-zone.html" with service=socks_service %}
|
||||
|
||||
<h3>{% trans "Configuration" %}</h3>
|
||||
|
||||
<form class="form form-configuration" method="post">
|
||||
|
||||
@@ -57,7 +57,8 @@ def index(request):
|
||||
'manual_page': tor.manual_page,
|
||||
'status': status,
|
||||
'config_running': bool(config_process),
|
||||
'form': form
|
||||
'form': form,
|
||||
'socks_service': tor.socks_service
|
||||
})
|
||||
|
||||
|
||||
@@ -66,10 +67,10 @@ def _apply_changes(request, old_status, new_status):
|
||||
try:
|
||||
__apply_changes(request, old_status, new_status)
|
||||
except ActionError as exception:
|
||||
messages.error(request,
|
||||
_('Action error: {0} [{1}] [{2}]').format(
|
||||
exception.args[0], exception.args[1],
|
||||
exception.args[2]))
|
||||
messages.error(
|
||||
request,
|
||||
_('Action error: {0} [{1}] [{2}]').format(
|
||||
exception.args[0], exception.args[1], exception.args[2]))
|
||||
|
||||
|
||||
def __apply_changes(request, old_status, new_status):
|
||||
|
||||
Reference in new issue
Block a user