mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Make XMPP work with service framework
- This allows firewall to manage ports automatically
This commit is contained in:
parent
f7dd63c0a6
commit
f77ceedc94
1
Makefile
1
Makefile
@ -32,6 +32,7 @@ install: default apache-install freedombox-setup-install
|
||||
cp -a sudoers.d $(DESTDIR)/etc/sudoers.d
|
||||
cp -a *.py modules templates $(DESTDIR)$(PYDIR)/
|
||||
cp share/init.d/plinth $(DESTDIR)/etc/init.d
|
||||
cp -a lib/* $(DESTDIR)/usr/lib
|
||||
install plinth $(DESTDIR)/usr/bin/
|
||||
mkdir -p $(DESTDIR)/var/lib/plinth/cherrypy_sessions $(DESTDIR)/var/log/plinth $(DESTDIR)/var/run
|
||||
mkdir -p $(DESTDIR)/var/lib/plinth/data
|
||||
|
||||
6
lib/firewalld/services/xmpp-bosh.xml
Normal file
6
lib/firewalld/services/xmpp-bosh.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<service>
|
||||
<short>XMPP (Jabber) web client</short>
|
||||
<description>Extensible Messaging and Presence Protocol (XMPP) web client protocol allows web based chat clients such as JWChat to connect to the XMPP (Jabber) server. This is also know as the Bidirectional-streams Over Synchronous HTTP (BOSH) protocol. Enable this if you run an XMPP (Jabber) server and you wish web clients to connect to your server.</description>
|
||||
<port protocol="tcp" port="5280"/>
|
||||
</service>
|
||||
6
lib/firewalld/services/xmpp-client.xml
Normal file
6
lib/firewalld/services/xmpp-client.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<service>
|
||||
<short>XMPP (Jabber) client</short>
|
||||
<description>Extensible Messaging and Presence Protocol (XMPP) client connection protocol allows XMPP (Jabber) clients such as Empathy, Pidgin, Kopete and Jitsi to connect to an XMPP (Jabber) server. Enable this if you run an XMPP (Jabber) server and you wish clients to be able to connect to the server and communicate with each other.</description>
|
||||
<port protocol="tcp" port="5222"/>
|
||||
</service>
|
||||
6
lib/firewalld/services/xmpp-server.xml
Normal file
6
lib/firewalld/services/xmpp-server.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<service>
|
||||
<short>XMPP (Jabber) server</short>
|
||||
<description>Extensible Messaging and Presence Protocol (XMPP) server connection protocols allows multiple XMPP (Jabber) servers to work in a fedrated fashion. Users on one server will be able to see the presence of and communicate with users on another servers. Enable this if you run an XMPP (Jabber) server and you wish users on your server to communicate with users on other XMPP servers.</description>
|
||||
<port protocol="tcp" port="5269"/>
|
||||
</service>
|
||||
@ -5,6 +5,7 @@ from plugin_mount import PagePlugin, FormPlugin
|
||||
import cfg
|
||||
from forms import Form
|
||||
import actions
|
||||
import service
|
||||
from util import Message
|
||||
|
||||
class xmpp(PagePlugin):
|
||||
@ -15,6 +16,24 @@ class xmpp(PagePlugin):
|
||||
self.register_page("services.xmpp.register")
|
||||
cfg.html_root.services.menu.add_item("XMPP", "icon-comment", "/services/xmpp", 40)
|
||||
|
||||
self.client_service = service.Service(
|
||||
'xmpp-client', _('Chat Server - client connections'), enabled=True)
|
||||
self.server_service = service.Service(
|
||||
'xmpp-server', _('Chat Server - server connections'), enabled=True)
|
||||
self.bosh_service = service.Service(
|
||||
'xmpp-bosh', _('Chat Server - web interface'), enabled=True)
|
||||
|
||||
# XXX: This is not correct. This essentially triggers firewall
|
||||
# to enable XMPP ports. This happen on every start of
|
||||
# Plinth. XMPP should be an option to be enabled on Plinth. If
|
||||
# and when the user enables the following notifications must
|
||||
# sent. If XMPP has be on by default in FreedomBox, then
|
||||
# initial setup process that sets up XMPP also must open the
|
||||
# firewall ports by default.
|
||||
self.client_service.notify_enabled(self, enabled=True)
|
||||
self.server_service.notify_enabled(self, enabled=True)
|
||||
self.bosh_service.notify_enabled(self, enabled=True)
|
||||
|
||||
@cherrypy.expose
|
||||
@require()
|
||||
def index(self, **kwargs):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user