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:
Joseph Nuthalapati committed 2018-06-21 18:01:53 +05:30
1 parent 45253775ef
commit 913d71e9bc
9 files changed
+102 -19

No files matched your search

+6
View File
@@ -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)
+1 -1
View File
@@ -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)
+2
View File
@@ -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">
+6 -5
View File
@@ -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):