Logo Khaganat
This translation is older than the original page and might be outdated. See what has changed.
Translations of this page?:

This is an old revision of the document!


XMPP

This article is an draft, simply some notes made of what i have found.

Basic installation of the Prosody server

We install an XMPP server, it will serve in game, also in term. Then we install Prosody, because it was Link Mauve who recommended it : D (and it seems to do the job, and that is what counts).

The packages under “Debian Jessie” are a bit old. It is therefore necessary to use the source packages.

Prosody's doc is fine. I translated the main one for Debian. All in root:

Then let's set up Prosody. As the doc says on https://wiki.jabberfr.org/Configuration_of_the_base_of_server_prosody_Jabber_fr, it is necessary to quietly read /etc/prosody/prosody.cfg.lua.

Once the server is launched(and a user created), add the user name to the value admins = {} .

I un-commented the module blocklist because it seems(to me) being essential. We will see if it takes up resources…

The rest will show itself when it all runs!

I edit the server name to VirtualHost and comment the line below -enabled=false

Then … (and this is the fun part): the certificates! we use the let's encrypt, so we will have to point to the right certificates… except that prosody can not read the files in /etc/letsencrypt/live/*(even with a symbolic link). So the easiest way is to copy the certificate into the prosody folder and give it reading rights.

cp /etc/letsencrypt/live/khaganat.net/privkey.pem /etc/prosody/certs/khaganat.net.key
cp /etc/letsencrypt/live/khaganat.net/fullchaim.pem /etc/prosody/certs/khaganat.net.crt
chown -R prosody:prosody /etc/prosody/certs/
chmod -R 700 /etc/prosody/certs/

Should we do this every time we renew our encryptions? Incidentally(even though “it works”) pidgin told me that the certificate “was not known”…

And that's what it looks like in /etc/prosody/prosody.cfg.lua(without comments):

VirtualHost "khaganat.net"
        ssl = {
                key = "/etc/prosody/certs/khaganat.net.key";
                certificate = "/etc/prosody/certs/khaganat.net.crt";
        }

Then we restart prosody to take the changes into account and we verify that it works:

 
 Service prosody restart
 Service prosody status

We also look in /var/log/prosody/prosody.* if all did go well.

We then create a user “directly” on the command line(since we have not yet opened the registrations!):

 Prosodyctl adduser me@example.com

Then we have to open the right ports. This needs to be checked, it probably depends on some configuration…

iptables -t filter -A INPUT -p tcp --dport 5222 -j ACCEPT
iptables -t filter -A INPUT -p tcp --dport 5269 -j ACCEPT

Is this not supposed to jump to restart if we do this?

Edit: Yes, you need to backup the iptables rules with iptables-save in /etc/sysconfig/iptables

To verify that the ports are open:

nmap serveur.com

Add modules

See also https://prosody.im/doc/components.

The basic server is fine, but a great strength of XMPP is that you can add functionality to it via modules, or “components”. The components are full flegded services, which will be launched on a server(not necessarily the one where prosody is installed). Prosody will then query the requested services by connecting to an ip address(and port) and then exchange a secret(or password) with the component. In the case of internal components, an password is not required.

If the component is already integrated in Prosody, simply activate it in it's configuration, for ex: by adding this in the configuration file which then will add the possibility to create Chat rooms:

Component "conference.example.org" "muc"

If the component does not already exist in Prosody, it must use the XEP-0114 protocol(standard for XMPP extensions). To add an external component, Prosody must know the correct address and port(by default 5347, used by most applications) and also the password(or “secret”) that the component uses.

If the component needs a subdomain to work, like “conference.example.org”, you must set this subdomain on the DNS side… and ensure that it is covered by an “ssl certificate”.

Useful modules

Here is a non-exhaustive list of the interesting modules, recommended by Link Mauve on this Linuxfr dispatch:

Server

CC Attribution-Share Alike 4.0 International Driven by DokuWiki
en/xmpp.1482948210.txt.gz · Last modified: (external edit)

Licences Mentions légales Accueil du site Contact Inclusion