firewall: Use service files for showing port forwarding info

- Start showing port ranges properly.

- Fixes issue with Coturn TURN relay ports not being shown.

Closes: #1851.

Tests:

- Visit each of affected apps and see the port forwarding information. The
information is same as before.

- HTTP and HTTPS ports are not shown.

- Coturn app shows additional port ranges for TURN relay ports.

- Shadowsocks app does not show port forwarding information as it is internal
only.

- Visit one of the apps not effected by the patch. There is no section related
to port forwarding.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa authored and Veiko Aasa committed 2020-09-04 16:31:52 +03:00
1 parent c218f3845f
commit 4aa8e6da09
28 files changed
+32 -93

No files matched your search

-5
View File
@@ -36,11 +36,6 @@ _description = [
box_name=_(cfg.box_name)),
]
port_forwarding_info = [
('TCP', 53),
('UDP', 53),
]
CONFIG_FILE = '/etc/bind/named.conf.options'
ZONES_DIR = '/var/bind/pri'
+2 -3
View File
@@ -7,10 +7,10 @@ from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth.views import AppView
from plinth.modules import bind, names
from plinth.views import AppView
from . import get_config, port_forwarding_info
from . import get_config
from .forms import BindForm
@@ -19,7 +19,6 @@ class BindAppView(AppView): # pylint: disable=too-many-ancestors
app_id = 'bind'
form_class = BindForm
template_name = 'bind.html'
port_forwarding_info = port_forwarding_info
def get_context_data(self, *args, **kwargs):
"""