From f245e7e76398867951b7be5292fd5a1792ae18da Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 3 Jun 2016 18:04:20 +0530 Subject: [PATCH] firewall: Explicitly specify ports for services It has become confusing to reuse the name of the service for name of the systemd unit file and firewall port. This has lead to the regression that quassel, mumble and minetest can no longer open firewall ports. Fix this by explicitly specifying ports all services. --- plinth/modules/datetime/__init__.py | 2 +- plinth/modules/minetest/__init__.py | 4 +++- plinth/modules/mumble/__init__.py | 2 +- plinth/modules/privoxy/__init__.py | 2 +- plinth/modules/quassel/__init__.py | 2 +- plinth/modules/shaarli/__init__.py | 1 - plinth/modules/tor/__init__.py | 2 +- plinth/modules/xmpp/__init__.py | 3 ++- 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/plinth/modules/datetime/__init__.py b/plinth/modules/datetime/__init__.py index ad9ff12d0..a3d0eb585 100644 --- a/plinth/modules/datetime/__init__.py +++ b/plinth/modules/datetime/__init__.py @@ -51,7 +51,7 @@ def init(): global service service = service_module.Service( - managed_services[0], title, is_external=False) + managed_services[0], title, ports=['ntp'], is_external=False) def setup(helper, old_version=None): diff --git a/plinth/modules/minetest/__init__.py b/plinth/modules/minetest/__init__.py index fa5b49071..9c90416e2 100644 --- a/plinth/modules/minetest/__init__.py +++ b/plinth/modules/minetest/__init__.py @@ -47,6 +47,7 @@ description = [ 'is needed.'), box_name=_(cfg.box_name)), ] + def init(): """Initialize the module.""" menu = cfg.main_menu.get('apps:index') @@ -54,7 +55,8 @@ def init(): global service service = service_module.Service( - managed_services[0], title, is_external=True) + managed_services[0], title, ports=['minetest-plinth'], + is_external=True) def setup(helper, old_version=None): diff --git a/plinth/modules/mumble/__init__.py b/plinth/modules/mumble/__init__.py index ff5ea1dba..a54bd72bd 100644 --- a/plinth/modules/mumble/__init__.py +++ b/plinth/modules/mumble/__init__.py @@ -54,7 +54,7 @@ def init(): global service service = service_module.Service( - managed_services[0], title, is_external=True) + managed_services[0], title, ports=['mumble-plinth'], is_external=True) class MumbleServiceView(ServiceView): diff --git a/plinth/modules/privoxy/__init__.py b/plinth/modules/privoxy/__init__.py index 52e345327..8108c4306 100644 --- a/plinth/modules/privoxy/__init__.py +++ b/plinth/modules/privoxy/__init__.py @@ -64,7 +64,7 @@ def init(): global service service = service_module.Service( - managed_services[0], title, is_external=False) + managed_services[0], title, ports=['privoxy'], is_external=False) def setup(helper, old_version=None): diff --git a/plinth/modules/quassel/__init__.py b/plinth/modules/quassel/__init__.py index 2b5ab8c78..a9f737dfe 100644 --- a/plinth/modules/quassel/__init__.py +++ b/plinth/modules/quassel/__init__.py @@ -62,7 +62,7 @@ def init(): global service service = service_module.Service( - managed_services[0], title, is_external=True) + managed_services[0], title, ports=['quassel-plinth'], is_external=True) class QuasselServiceView(ServiceView): diff --git a/plinth/modules/shaarli/__init__.py b/plinth/modules/shaarli/__init__.py index 0fdcecfa6..6e696bfe8 100644 --- a/plinth/modules/shaarli/__init__.py +++ b/plinth/modules/shaarli/__init__.py @@ -62,7 +62,6 @@ def setup(helper, old_version=None): helper.call('post', service.notify_enabled, None, True) - def is_enabled(): """Return whether the module is enabled.""" return action_utils.webserver_is_enabled('shaarli') diff --git a/plinth/modules/tor/__init__.py b/plinth/modules/tor/__init__.py index 259288edc..08d2e13a2 100644 --- a/plinth/modules/tor/__init__.py +++ b/plinth/modules/tor/__init__.py @@ -58,7 +58,7 @@ def init(): global socks_service socks_service = service_module.Service( - 'tor-socks', _('Tor Anonymity Network'), + 'tor-socks', _('Tor Anonymity Network'), ports=['tor-socks'], is_external=False, is_enabled=utils.is_enabled, is_running=utils.is_running) diff --git a/plinth/modules/xmpp/__init__.py b/plinth/modules/xmpp/__init__.py index dd97dbe76..2503a9a6f 100644 --- a/plinth/modules/xmpp/__init__.py +++ b/plinth/modules/xmpp/__init__.py @@ -63,7 +63,8 @@ def init(): global service service = service_module.Service( 'ejabberd', title, ports=['xmpp-client', 'xmpp-server', 'xmpp-bosh'], - is_external=True, is_enabled=is_enabled, enable=enable, disable=disable) + is_external=True, is_enabled=is_enabled, enable=enable, + disable=disable) pre_hostname_change.connect(on_pre_hostname_change) post_hostname_change.connect(on_post_hostname_change)