Introduce firewall component for opening/closing ports

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-06-13 20:17:45 -04:00
1 parent 4c4a59e5fe
commit ca2c7dbeb0
48 files changed
+647 -401

No files matched your search

+9 -6
View File
@@ -26,6 +26,7 @@ from django.utils.translation import ugettext_lazy as _
from plinth import app as app_module
from plinth import frontpage, menu
from plinth import service as service_module
from plinth.modules.firewall.components import Firewall
from .manifest import backup, clients
@@ -66,6 +67,10 @@ class JSXCApp(app_module.App):
icon='jsxc', url=reverse_lazy('jsxc:jsxc'), clients=clients)
self.add(shortcut)
firewall = Firewall('firewall-jsxc', name, ports=['http', 'https'],
is_external=True)
self.add(firewall)
def init():
"""Initialize the JSXC module"""
@@ -75,9 +80,8 @@ def init():
global service
setup_helper = globals()['setup_helper']
if setup_helper.get_state() != 'needs-setup':
service = service_module.Service(
'jsxc', name, ports=['http', 'https'], is_external=True,
is_enabled=is_enabled, enable=enable, disable=disable)
service = service_module.Service('jsxc', name, is_enabled=is_enabled,
enable=enable, disable=disable)
if is_enabled():
app.set_enabled(True)
@@ -88,9 +92,8 @@ def setup(helper, old_version=None):
global service
if not service:
service = service_module.Service(
'jsxc', name, ports=['http', 'https'], is_external=True,
is_enabled=is_enabled, enable=enable, disable=disable)
service = service_module.Service('jsxc', name, is_enabled=is_enabled,
enable=enable, disable=disable)
helper.call('post', app.enable)