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

+11 -6
View File
@@ -24,6 +24,7 @@ from plinth import action_utils, actions
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
@@ -81,6 +82,10 @@ class RoundcubeApp(app_module.App):
clients=clients, login_required=True)
self.add(shortcut)
firewall = Firewall('firewall-roundcube', name,
ports=['http', 'https'], is_external=True)
self.add(firewall)
def init():
"""Intialize the module."""
@@ -90,9 +95,9 @@ def init():
global service
setup_helper = globals()['setup_helper']
if setup_helper.get_state() != 'needs-setup':
service = service_module.Service(
'roundcube', name, ports=['http', 'https'], is_external=True,
is_enabled=is_enabled, enable=enable, disable=disable)
service = service_module.Service('roundcube', name,
is_enabled=is_enabled, enable=enable,
disable=disable)
if is_enabled():
app.set_enabled(True)
@@ -105,9 +110,9 @@ def setup(helper, old_version=None):
helper.call('post', actions.superuser_run, 'roundcube', ['setup'])
global service
if service is None:
service = service_module.Service(
'roundcube', name, ports=['http', 'https'], is_external=True,
is_enabled=is_enabled, enable=enable, disable=disable)
service = service_module.Service('roundcube', name,
is_enabled=is_enabled, enable=enable,
disable=disable)
helper.call('post', app.enable)