mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
ejabberd: Rename xmpp to ejabberd
This commit is contained in:
parent
d84b02adcf
commit
7a9554cbf7
@ -16,7 +16,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Plinth module to configure XMPP server
|
Plinth module to configure ejabberd server
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
@ -41,7 +41,7 @@ managed_services = ['ejabberd']
|
|||||||
|
|
||||||
managed_packages = ['ejabberd']
|
managed_packages = ['ejabberd']
|
||||||
|
|
||||||
title = _('Chat Server \n (XMPP)')
|
title = _('Chat Server \n (ejabberd)')
|
||||||
|
|
||||||
description = [
|
description = [
|
||||||
_('XMPP is an open and standardized communication protocol. Here '
|
_('XMPP is an open and standardized communication protocol. Here '
|
||||||
@ -58,9 +58,9 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
"""Initialize the XMPP module"""
|
"""Initialize the ejabberd module"""
|
||||||
menu = cfg.main_menu.get('apps:index')
|
menu = cfg.main_menu.get('apps:index')
|
||||||
menu.add_urlname(title, 'glyphicon-comment', 'xmpp:index')
|
menu.add_urlname(title, 'glyphicon-comment', 'ejabberd:index')
|
||||||
|
|
||||||
global service
|
global service
|
||||||
setup_helper = globals()['setup_helper']
|
setup_helper = globals()['setup_helper']
|
||||||
@ -80,12 +80,12 @@ def init():
|
|||||||
def setup(helper, old_version=None):
|
def setup(helper, old_version=None):
|
||||||
"""Install and configure the module."""
|
"""Install and configure the module."""
|
||||||
domainname = get_domainname()
|
domainname = get_domainname()
|
||||||
logger.info('XMPP service domainname - %s', domainname)
|
logger.info('ejabberd service domainname - %s', domainname)
|
||||||
|
|
||||||
helper.call('pre', actions.superuser_run, 'xmpp',
|
helper.call('pre', actions.superuser_run, 'ejabberd',
|
||||||
['pre-install', '--domainname', domainname])
|
['pre-install', '--domainname', domainname])
|
||||||
helper.install(managed_packages)
|
helper.install(managed_packages)
|
||||||
helper.call('post', actions.superuser_run, 'xmpp', ['setup'])
|
helper.call('post', actions.superuser_run, 'ejabberd', ['setup'])
|
||||||
global service
|
global service
|
||||||
if service is None:
|
if service is None:
|
||||||
service = service_module.Service(
|
service = service_module.Service(
|
||||||
@ -98,16 +98,15 @@ def setup(helper, old_version=None):
|
|||||||
|
|
||||||
|
|
||||||
def add_shortcut():
|
def add_shortcut():
|
||||||
frontpage.add_shortcut('xmpp', title,
|
frontpage.add_shortcut('ejabberd', title,
|
||||||
details=description,
|
details=description,
|
||||||
configure_url=reverse_lazy('xmpp:index'),
|
configure_url=reverse_lazy('ejabberd:index'),
|
||||||
login_required=True)
|
login_required=True)
|
||||||
|
|
||||||
|
|
||||||
def is_enabled():
|
def is_enabled():
|
||||||
"""Return whether the module is enabled."""
|
"""Return whether the module is enabled."""
|
||||||
return (action_utils.service_is_enabled('ejabberd') and
|
return (action_utils.service_is_enabled('ejabberd'))
|
||||||
action_utils.webserver_is_enabled('jwchat-plinth'))
|
|
||||||
|
|
||||||
|
|
||||||
def get_domainname():
|
def get_domainname():
|
||||||
@ -118,14 +117,14 @@ def get_domainname():
|
|||||||
|
|
||||||
def enable():
|
def enable():
|
||||||
"""Enable the module."""
|
"""Enable the module."""
|
||||||
actions.superuser_run('xmpp', ['enable'])
|
actions.superuser_run('ejabberd', ['enable'])
|
||||||
add_shortcut()
|
add_shortcut()
|
||||||
|
|
||||||
|
|
||||||
def disable():
|
def disable():
|
||||||
"""Enable the module."""
|
"""Enable the module."""
|
||||||
actions.superuser_run('xmpp', ['disable'])
|
actions.superuser_run('ejabberd', ['disable'])
|
||||||
frontpage.remove_shortcut('xmpp')
|
frontpage.remove_shortcut('ejabberd')
|
||||||
|
|
||||||
|
|
||||||
def on_pre_hostname_change(sender, old_hostname, new_hostname, **kwargs):
|
def on_pre_hostname_change(sender, old_hostname, new_hostname, **kwargs):
|
||||||
@ -135,7 +134,7 @@ def on_pre_hostname_change(sender, old_hostname, new_hostname, **kwargs):
|
|||||||
del sender # Unused
|
del sender # Unused
|
||||||
del kwargs # Unused
|
del kwargs # Unused
|
||||||
|
|
||||||
actions.superuser_run('xmpp',
|
actions.superuser_run('ejabberd',
|
||||||
['pre-change-hostname',
|
['pre-change-hostname',
|
||||||
'--old-hostname', old_hostname,
|
'--old-hostname', old_hostname,
|
||||||
'--new-hostname', new_hostname])
|
'--new-hostname', new_hostname])
|
||||||
@ -146,7 +145,7 @@ def on_post_hostname_change(sender, old_hostname, new_hostname, **kwargs):
|
|||||||
del sender # Unused
|
del sender # Unused
|
||||||
del kwargs # Unused
|
del kwargs # Unused
|
||||||
|
|
||||||
actions.superuser_run('xmpp',
|
actions.superuser_run('ejabberd',
|
||||||
['change-hostname',
|
['change-hostname',
|
||||||
'--old-hostname', old_hostname,
|
'--old-hostname', old_hostname,
|
||||||
'--new-hostname', new_hostname],
|
'--new-hostname', new_hostname],
|
||||||
@ -159,7 +158,7 @@ def on_domainname_change(sender, old_domainname, new_domainname, **kwargs):
|
|||||||
del old_domainname # Unused
|
del old_domainname # Unused
|
||||||
del kwargs # Unused
|
del kwargs # Unused
|
||||||
|
|
||||||
actions.superuser_run('xmpp',
|
actions.superuser_run('ejabberd',
|
||||||
['change-domainname',
|
['change-domainname',
|
||||||
'--domainname', new_domainname],
|
'--domainname', new_domainname],
|
||||||
async=True)
|
async=True)
|
||||||
|
|||||||
@ -56,7 +56,7 @@ logger = logging.getLogger(__name__)
|
|||||||
def init():
|
def init():
|
||||||
"""Initialize the XMPP module"""
|
"""Initialize the XMPP module"""
|
||||||
menu = cfg.main_menu.get('apps:index')
|
menu = cfg.main_menu.get('apps:index')
|
||||||
menu.add_urlname(title, 'glyphicon-comment', 'xmpp:index')
|
menu.add_urlname(title, 'glyphicon-comment', 'jsxc:index')
|
||||||
|
|
||||||
global service
|
global service
|
||||||
setup_helper = globals()['setup_helper']
|
setup_helper = globals()['setup_helper']
|
||||||
@ -68,24 +68,6 @@ def init():
|
|||||||
add_shortcut()
|
add_shortcut()
|
||||||
|
|
||||||
|
|
||||||
def setup(helper, old_version=None):
|
|
||||||
"""Install and configure the module."""
|
|
||||||
domainname = get_domainname()
|
|
||||||
logger.info('XMPP service domainname - %s', domainname)
|
|
||||||
|
|
||||||
helper.call('pre', actions.superuser_run, 'xmpp',
|
|
||||||
['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(
|
|
||||||
'jsxc', 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)
|
|
||||||
|
|
||||||
|
|
||||||
def add_shortcut():
|
def add_shortcut():
|
||||||
frontpage.add_shortcut('jsxc', _('Chat Client \n (jsxc)'),
|
frontpage.add_shortcut('jsxc', _('Chat Client \n (jsxc)'),
|
||||||
url=reverse_lazy('xmpp:jsxc'),
|
url=reverse_lazy('xmpp:jsxc'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user