From 70e783628b1bf863da45cc8879b06288a498840b Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Fri, 5 May 2023 03:16:06 -0600 Subject: update css, make articles more uniform, add toc and add functionality to scroll to the top --- live/blog/a/xmpp_server_with_prosody.html | 62 +++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 19 deletions(-) (limited to 'live/blog/a/xmpp_server_with_prosody.html') diff --git a/live/blog/a/xmpp_server_with_prosody.html b/live/blog/a/xmpp_server_with_prosody.html index 20418ca..9a83ac4 100644 --- a/live/blog/a/xmpp_server_with_prosody.html +++ b/live/blog/a/xmpp_server_with_prosody.html @@ -16,14 +16,21 @@ + + - + + + + + + @@ -73,12 +80,29 @@
+
+ +

Create an XMPP server with Prosody compatible with Conversations and Movim

-

Recently I set up an XMPP server (and a Matrix one, too) for my personal use and for friends if they want one; made one for EL ELE EME for example. So, here are the notes on how I set up the server that is compatible with the Conversations app and the Movim social network. You can see my addresses in contact and the XMPP compliance/score of the server.

-

One of the best resources I found that helped me a lot was Installing and Configuring Prosody XMPP Server on Debian 9, and of course the Arch Wiki and the oficial documentation.

-

As with my other entries, this is under a server running Arch Linux, with the Nginx web server and Certbot certificates. And all commands here are executed as root (unless specified otherwise)

-

Prerequisites

+

Update: I no longer host this XMPP server as it consumed a lot of resources and I wasn’t using it that much. I’ll probably re-create it in the future, though.

+

Recently I set up an XMPP server (and a Matrix one, too) for my personal use and for friends if they want one; made one for EL ELE EME for example. So, here are the notes on how I set up the server that is compatible with the Conversations app and the Movim social network. You can see my addresses at contact and the XMPP compliance/score of the server.

+

One of the best resources I found that helped me a lot was Installing and Configuring Prosody XMPP Server on Debian 9, the Arch Wiki and the oficial documentation.

+

As with my other entries, this is under a server running Arch Linux, with the Nginx web server and Certbot certificates. And all commands here are executed as root, unless specified otherwise.

+

Table of contents

+ +

Prerequisites

Same as with my other entries (website, mail and git) plus:

-

Prosody

+

Prosody

Prosody is an implementation of the XMPP protocol that is flexible and extensible.

Install the prosody package (with optional dependencies) and the mercurial package:

pacman -S prosody, mercurial, lua52-sec, lua52-dbi, lua52-zlib
@@ -111,11 +135,11 @@ mkdir modules-enabled
 

You can see that I follow a similar approach that I used with Nginx and the server configuration, where I have all the modules available in a directory, and make a symlink to another to keep track of what is being used. You can update the repository by running hg pull --update while inside the modules-available directory (similar to Git).

Make symbolic links to the following modules:

-
ln -s /var/lib/prosody/modules-available/MODULE_NAME /var/lib/prosody/modules-enabled/
+
ln -s /var/lib/prosody/modules-available/{module_name} /var/lib/prosody/modules-enabled/
 ...
 
    -
  • Modules:
      +
    • Modules ({module_name}):
      • mod_bookmarks
      • mod_cache_c2s_caps
      • mod_checkcerts
      • @@ -443,8 +467,8 @@ ln -s your.domain.key SUBDOMAIN.your.domain.key ...

That’s basically all the configuration that needs Prosody itself, but we still have to configure Nginx and Coturn before starting/enabling the prosody service.

-

Nginx configuration file

-

Since this is not an ordinary configuration file I’m going to describe this too. Your prosody.conf file should have the following location blocks under the main server block (the one that listens to HTTPS):

+

Nginx configuration file

+

Since this is not an ordinary configuration file I’m going to describe this, too. Your prosody.conf file should have the following location blocks under the main server block (the one that listens to HTTPS):

# HTTPS server block
 server {
     root /var/www/prosody/;
@@ -537,11 +561,11 @@ server {
     ]
 }
 
-

Remember to have your prosody.conf file symlinked (or discoverable by Nginx) to the sites-enabled directory. You can now restart your nginx service (and test the configuration, optionally):

+

Remember to have your prosody.conf file symlinked (or discoverable by Nginx) to the sites-enabled directory. You can now test and restart your nginx service (and test the configuration, optionally):

nginx -t
 systemctl restart nginx.service
 
-

Coturn

+

Coturn

Coturn is the implementation of TURN and STUN server, which in general is for (at least in the XMPP world) voice support and external service discovery.

Install the coturn package:

pacman -S coturn
@@ -557,7 +581,7 @@ static-auth-secret=YOUR SUPER SECRET TURN PASSWORD
 systemctl enable turnserver.service
 

You can test if your TURN server works at Trickle ICE. You may need to add a user in the turnserver.conf to test this.

-

Wrapping up

+

Wrapping up

At this point you should have a working XMPP server, start/enable the prosody service now:

systemctl start prosody.service
 systemctl enable prosody.service
@@ -570,7 +594,7 @@ systemctl enable prosody.service
 

Additionally, you can test the security of your server in IM Observatory, here you only need to specify your domain.name (not xmpp.domain.name, if you set up the SRV DNS records correctly). Again, it should have a similar score to mine:

xmpp.net score

You can now log in into your XMPP client of choice, if it asks for the server it should be xmpp.your.domain (or your.domain for some clients) and your login credentials you@your.domain and the password you chose (which you can change in most clients).

-

That’s it, send me a message david@luevano.xyz if you were able to set up the server successfully.

+

That’s it, send me a message at david@luevano.xyz if you were able to set up the server successfully.