mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
ejabberd, jsxc: Changes made to __init__.py
This commit is contained in:
parent
bfe273ff7c
commit
1797931055
@ -39,7 +39,7 @@ depends = ['apps']
|
|||||||
|
|
||||||
managed_services = ['ejabberd']
|
managed_services = ['ejabberd']
|
||||||
|
|
||||||
managed_packages = ['libjs-jsxc', 'ejabberd']
|
managed_packages = ['ejabberd']
|
||||||
|
|
||||||
title = _('Chat Server \n (XMPP)')
|
title = _('Chat Server \n (XMPP)')
|
||||||
|
|
||||||
@ -98,9 +98,6 @@ def setup(helper, old_version=None):
|
|||||||
|
|
||||||
|
|
||||||
def add_shortcut():
|
def add_shortcut():
|
||||||
frontpage.add_shortcut('jsxc', _('Chat Client \n (jsxc)'),
|
|
||||||
url=reverse_lazy('xmpp:jsxc'),
|
|
||||||
login_required=True)
|
|
||||||
frontpage.add_shortcut('xmpp', title,
|
frontpage.add_shortcut('xmpp', title,
|
||||||
details=description,
|
details=description,
|
||||||
configure_url=reverse_lazy('xmpp:index'),
|
configure_url=reverse_lazy('xmpp:index'),
|
||||||
@ -128,7 +125,6 @@ def enable():
|
|||||||
def disable():
|
def disable():
|
||||||
"""Enable the module."""
|
"""Enable the module."""
|
||||||
actions.superuser_run('xmpp', ['disable'])
|
actions.superuser_run('xmpp', ['disable'])
|
||||||
frontpage.remove_shortcut('jsxc')
|
|
||||||
frontpage.remove_shortcut('xmpp')
|
frontpage.remove_shortcut('xmpp')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Plinth module to configure XMPP server
|
Plinth module to configure XMPP web client/jsxc
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
@ -37,15 +37,11 @@ version = 2
|
|||||||
|
|
||||||
depends = ['apps']
|
depends = ['apps']
|
||||||
|
|
||||||
managed_services = ['ejabberd']
|
managed_packages = ['libjs-jsxc']
|
||||||
|
|
||||||
managed_packages = ['libjs-jsxc', 'ejabberd']
|
|
||||||
|
|
||||||
title = _('Chat Server \n (XMPP)')
|
title = _('Chat Server \n (XMPP)')
|
||||||
|
|
||||||
description = [
|
description = [
|
||||||
_('XMPP is an open and standardized communication protocol. Here '
|
|
||||||
'you can run and configure your XMPP server, called ejabberd.'),
|
|
||||||
|
|
||||||
_('To actually communicate, you can use the web client or any other '
|
_('To actually communicate, you can use the web client or any other '
|
||||||
'<a href=\'http://xmpp.org/xmpp-software/clients/\' target=\'_blank\''
|
'<a href=\'http://xmpp.org/xmpp-software/clients/\' target=\'_blank\''
|
||||||
@ -65,11 +61,9 @@ def init():
|
|||||||
global service
|
global service
|
||||||
setup_helper = globals()['setup_helper']
|
setup_helper = globals()['setup_helper']
|
||||||
if setup_helper.get_state() != 'needs-setup':
|
if setup_helper.get_state() != 'needs-setup':
|
||||||
service = service_module.Service(
|
service = service = service_module.Service(
|
||||||
'ejabberd', title,
|
'jsxc', title, ports=['http', 'https'], is_external=True,
|
||||||
ports=['xmpp-client', 'xmpp-server', 'xmpp-bosh'],
|
is_enabled=is_enabled, enable=enable, disable=disable)
|
||||||
is_external=True, is_enabled=is_enabled, enable=enable,
|
|
||||||
disable=disable)
|
|
||||||
if is_enabled():
|
if is_enabled():
|
||||||
add_shortcut()
|
add_shortcut()
|
||||||
pre_hostname_change.connect(on_pre_hostname_change)
|
pre_hostname_change.connect(on_pre_hostname_change)
|
||||||
@ -101,10 +95,6 @@ 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'),
|
||||||
login_required=True)
|
login_required=True)
|
||||||
frontpage.add_shortcut('xmpp', title,
|
|
||||||
details=description,
|
|
||||||
configure_url=reverse_lazy('xmpp:index'),
|
|
||||||
login_required=True)
|
|
||||||
|
|
||||||
|
|
||||||
def is_enabled():
|
def is_enabled():
|
||||||
@ -167,19 +157,3 @@ def on_domainname_change(sender, old_domainname, new_domainname, **kwargs):
|
|||||||
['change-domainname',
|
['change-domainname',
|
||||||
'--domainname', new_domainname],
|
'--domainname', new_domainname],
|
||||||
async=True)
|
async=True)
|
||||||
|
|
||||||
|
|
||||||
def diagnose():
|
|
||||||
"""Run diagnostics and return the results."""
|
|
||||||
results = []
|
|
||||||
|
|
||||||
results.append(action_utils.diagnose_port_listening(5222, 'tcp4'))
|
|
||||||
results.append(action_utils.diagnose_port_listening(5222, 'tcp6'))
|
|
||||||
results.append(action_utils.diagnose_port_listening(5269, 'tcp4'))
|
|
||||||
results.append(action_utils.diagnose_port_listening(5269, 'tcp6'))
|
|
||||||
results.append(action_utils.diagnose_port_listening(5280, 'tcp4'))
|
|
||||||
results.append(action_utils.diagnose_port_listening(5280, 'tcp6'))
|
|
||||||
results.extend(
|
|
||||||
action_utils.diagnose_url_on_all('http://{host}/http-bind/'))
|
|
||||||
|
|
||||||
return results
|
|
||||||
|
|||||||
@ -26,20 +26,6 @@
|
|||||||
<p>{{ paragraph|safe }}</p>
|
<p>{{ paragraph|safe }}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<p>
|
|
||||||
{% url 'config:index' as index_url %}
|
|
||||||
{% if domainname %}
|
|
||||||
{% blocktrans trimmed with domainname=domainname %}
|
|
||||||
Your XMPP server domain is set to <b>{{ domainname }}</b>. User
|
|
||||||
IDs will look like <i>username@{{ domainname }}</i>. You
|
|
||||||
can setup your domain on the system
|
|
||||||
<a href="{{ index_url }}">Configure</a> page.
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% else %}
|
|
||||||
Your XMPP server domain is not set. You can setup your domain on
|
|
||||||
the system <a href="{{ index_url }}">Configure</a> page.
|
|
||||||
{% endif %}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href='{% url "xmpp:jsxc" %}' target='_blank' class='btn btn-primary'>
|
<a href='{% url "xmpp:jsxc" %}' target='_blank' class='btn btn-primary'>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user