mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
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:
1 parent
4c4a59e5fe
commit
ca2c7dbeb0
48 files changed
+647
-401
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user