Ensure that services are registered when modules complete setup

This commit is contained in:
James Valleroy 2016-12-04 13:27:35 -05:00
parent 5f1c72d647
commit b234d0e1b3
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
18 changed files with 109 additions and 0 deletions

View File

@ -61,6 +61,10 @@ def init():
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['ntp'], is_external=False)
helper.call('post', service.notify_enabled, None, True)

View File

@ -71,6 +71,12 @@ def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
helper.call('post', actions.superuser_run, 'deluge', ['enable'])
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['http', 'https'],
is_external=True, is_enabled=is_enabled, enable=enable,
disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -69,6 +69,11 @@ def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
helper.call('post', actions.superuser_run, 'ikiwiki', ['setup'])
global service
if service is None:
service = service_module.Service(
'ikiwiki', title, ports=['http', 'https'], is_external=True,
is_enabled=is_enabled, enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcuts)

View File

@ -78,6 +78,12 @@ def init():
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
global service
if service is None:
service = service_module.Service(
managed_services[0], title,
ports=['minetest-plinth'], is_external=True, enable=enable,
disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -78,6 +78,12 @@ class MumbleServiceView(ServiceView):
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['mumble-plinth'],
is_external=True,
enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -67,6 +67,10 @@ def init():
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['openvpn'], is_external=True)
def is_setup():

View File

@ -77,6 +77,11 @@ def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
helper.call('post', actions.superuser_run, 'owncloud-setup', ['enable'])
global service
if service is None:
service = service_module.Service(
'owncloud', title, ports=['http', 'https'], is_external=True,
is_enabled=is_enabled, enable=_enable, disable=_disable)
helper.call('post', service.notify_enabled, None, True)

View File

@ -83,6 +83,12 @@ def setup(helper, old_version=None):
"""Install and configure the module."""
helper.call('pre', actions.superuser_run, 'privoxy', ['pre-install'])
helper.install(managed_packages)
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['privoxy'],
is_external=False,
enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -85,6 +85,11 @@ class QuasselServiceView(ServiceView):
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['quassel-plinth'],
is_external=True, enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -76,6 +76,12 @@ def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
helper.call('post', actions.superuser_run, 'radicale', ['setup'])
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['http', 'https'],
is_external=True,
enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -90,6 +90,12 @@ def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
helper.call('post', actions.superuser_run, 'repro', ['setup'])
global service
if service is None:
service = service_module.Service(
managed_services[0], title,
ports=['sip', 'sips', 'rtp-plinth'],
is_external=True, enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -68,3 +68,8 @@ def init():
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['http', 'https'],
is_external=False)

View File

@ -83,6 +83,11 @@ def setup(helper, old_version=None):
helper.install(managed_packages)
helper.call('post', actions.superuser_run, 'roundcube', ['setup'])
helper.call('post', add_shortcut)
global service
if service is None:
service = service_module.Service(
'roundcube', title, ports=['http', 'https'], is_external=True,
is_enabled=is_enabled, enable=enable, disable=disable)
def add_shortcut():

View File

@ -67,6 +67,11 @@ def init():
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
global service
if service is None:
service = service_module.Service(
'shaarli', title, ports=['http', 'https'], is_external=True,
is_enabled=is_enabled, enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -103,8 +103,24 @@ def setup(helper, old_version=None):
helper.call('post', actions.superuser_run, 'tor', ['setup'])
helper.call('post', actions.superuser_run, 'tor',
['configure', '--apt-transport-tor', 'enable'])
global socks_service
if socks_service is None:
socks_service = service_module.Service(
'tor-socks', _('Tor Anonymity Network'), ports=['tor-socks'],
is_external=False, is_enabled=utils.is_enabled,
is_running=utils.is_running)
helper.call('post', socks_service.notify_enabled, None, True)
global bridge_service
if bridge_service is None:
bridge_service = service_module.Service(
'tor-bridge', _('Tor Bridge Relay'),
ports=['tor-orport', 'tor-obfs3', 'tor-obfs4'],
is_external=True, is_enabled=utils.is_enabled,
is_running=utils.is_running)
helper.call('post', bridge_service.notify_enabled, None, True)
helper.call('post', update_hidden_service_domain)

View File

@ -76,6 +76,12 @@ def setup(helper, old_version=None):
input=json.dumps(new_configuration).encode())
helper.call('post', actions.superuser_run, 'transmission', ['enable'])
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['http', 'https'],
is_external=True, is_enabled=is_enabled,
enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -72,6 +72,12 @@ def setup(helper, old_version=None):
helper.call('pre', actions.superuser_run, 'ttrss', ['pre-setup'])
helper.install(managed_packages)
helper.call('post', actions.superuser_run, 'ttrss', ['setup'])
global service
if service is None:
service = service_module.Service(
managed_services[0], title, ports=['http', 'https'],
is_external=True,
is_enabled=is_enabled, enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)

View File

@ -88,6 +88,13 @@ def setup(helper, old_version=None):
['pre-install', '--domainname', domainname])
helper.install(managed_packages)
helper.call('post', actions.superuser_run, 'xmpp', ['setup'])
global service
if service is None:
service = service_module.Service(
'ejabberd', title,
ports=['xmpp-client', 'xmpp-server', 'xmpp-bosh'],
is_external=True, is_enabled=is_enabled, enable=enable,
disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)