<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ejabberd on nagg.eu</title><link>https://nagg.eu/tags/ejabberd/</link><description>Recent content in Ejabberd on nagg.eu</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 03 May 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://nagg.eu/tags/ejabberd/index.xml" rel="self" type="application/rss+xml"/><item><title>XMPP audio and video calls</title><link>https://nagg.eu/xmpp-audio-and-video-calls/</link><pubDate>Sun, 03 May 2020 00:00:00 +0000</pubDate><guid>https://nagg.eu/xmpp-audio-and-video-calls/</guid><description>&lt;p&gt;Ejabberd has supported STUN/TURN for quite some time now, this in conjunction
with client support can be used to implement one on one audio and video calls.&lt;br&gt;
Since version 2.8.0 &lt;a href="https://github.com/iNPUTmice/Conversations"&gt;Conversations Android client&lt;/a&gt;
added audio and video call functionality by leveraging on STUN/TURN and &lt;a href="https://xmpp.org/extensions/xep-0215.html"&gt;XEP-0215&lt;/a&gt;.&lt;br&gt;
The rest of the XMPP world is following the route opened by them, so I expect
to see IOS and regular computer XMPP clients to finally implement these new
features too in the upcoming months.&lt;br&gt;
Enabling audio and video calls in Ejabberd is actually pretty simple.&lt;br&gt;
Provided you have installed the latest release (version &lt;code&gt;20.04&lt;/code&gt;), edit
&lt;code&gt;ejabberd.yml&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Nginx and XMPP over TLS</title><link>https://nagg.eu/nginx-and-xmpp-over-tls/</link><pubDate>Sun, 28 Oct 2018 00:00:00 +0000</pubDate><guid>https://nagg.eu/nginx-and-xmpp-over-tls/</guid><description>&lt;p&gt;XMPP over TLS (formerly XEP-0368) is a clever mechanism that allows users to
connect to a XMPP server from networks that restrict outgoing traffic only to
specific ports; this block is circumvent by routing XMPP traffic via port TCP
443.&lt;br&gt;
If the server hosts only a XMPP server setting up XMPP over TLS is pretty easy,
just instruct the server to listen on port 443.&lt;br&gt;
If the server also runs a webserver which is listening on port 443 things are a
bit more complicated; luckily Nginx provides a way to manage XMPP traffic and
redirect it to the XMPP server.&lt;/p&gt;</description></item><item><title>Ejabberd HTTP File Upload (XEP-0363)</title><link>https://nagg.eu/ejabberd-http-file-upload-xep-0363/</link><pubDate>Mon, 14 Nov 2016 18:36:53 +0000</pubDate><guid>https://nagg.eu/ejabberd-http-file-upload-xep-0363/</guid><description>&lt;p&gt;XMPP module HTTP File Upload (formerly XEP-0363) provides a way to share files
between XMPP clients, it works transparently and even in multi user chats.&lt;br&gt;
The sender uploads a file on an HTTP(S) server that will then generate an URI,
this is sent to each one of the recipients that can then download it.&lt;br&gt;
The interesting bits about this XEP are various:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;File sharing now works even in multi-user chats (MUC), in any case the file
is only uploaded a single time even if the recipients are more than one.&lt;/li&gt;
&lt;li&gt;Peer-to-peer file transfer, be it in-band (XEP-0234: Jingle File Transfer)
or out-of-band (XEP-0065: SOCKS5 Bytestreams), is slow, unreliable, does not
work in MUC and does not work if the recipient is offline.&lt;br&gt;
HTTP File Upload supports both client-server encryption (HTTPS) and end-to-end
encryption when used in conjunction with OMEMO encryption (as per today this is
supported by Conversations on Android and Gajim desktop client).&lt;br&gt;
3.1. When using OMEMO encryption the files are stored encrypted on the server,
this makes it impossibile for ejabberd to create a thumbnail if the file sent
is a picture.&lt;br&gt;
To enable HTTP File Upload module with HTTPS enabled in ejabberd edit
&lt;code&gt;ejabberd.yml&lt;/code&gt; configuration file: &amp;gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;listen:
 -
 port: 5443
 ip: &amp;#34;0.0.0.0&amp;#34;
 module: ejabberd_http
 request_handlers:
 &amp;#34;upload&amp;#34;: mod_http_upload
 tls: true
 protocol_options: &amp;#39;TLS_OPTIONS&amp;#39;
 dhfile: &amp;#39;DH_FILE&amp;#39;
 ciphers: &amp;#39;TLS_CIPHERS&amp;#39;

modules:
 mod_http_upload:
 docroot: &amp;#34;/home/ejabberd/upload&amp;#34; # this must be a valid path, user ownership and SELinux flags must be set accordingly
 put_url: &amp;#34;https://@HOST@:5443/upload&amp;#34;
 access: local
 max_size: 25000000 #25 MByte
 thumbnail: false
 file_mode: &amp;#34;0644&amp;#34;
 dir_mode: &amp;#34;0744&amp;#34;
 mod_http_upload_quota:
 max_days: 2

shaper:
 soft_upload_quota:
 - 250: all # MiB
 hard_upload_quota:
 - 10000: all # MiB

define_macro:
 &amp;#39;TLS_CIPHERS&amp;#39;: &amp;#34;ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256&amp;#34;
 &amp;#39;TLS_OPTIONS&amp;#39;:
 - &amp;#34;no_sslv2, no_sslv3, no_tlsv1&amp;#34;
 - &amp;#34;ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256&amp;#34;
 - &amp;#34;no_compression&amp;#34;
 &amp;#39;DH_FILE&amp;#39;: &amp;#34;/usr/local/etc/ejabberd/dhparams.pem&amp;#34; # generated with: openssl dhparam -out dhparams.pem 4096
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add an &lt;code&gt;iptables&lt;/code&gt; rule to allow traffic coming from port &lt;code&gt;TCP 5443&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Automating Ejabberd upgrade procedure with Ansible</title><link>https://nagg.eu/automating-ejabberd-upgrade-procedure-with-ansible/</link><pubDate>Mon, 08 Feb 2016 23:11:28 +0000</pubDate><guid>https://nagg.eu/automating-ejabberd-upgrade-procedure-with-ansible/</guid><description>&lt;p&gt;CentOS repos (both official and EPEL) does not provide an up to date version of Ejabberd, installing from source is the only way if one want or need a version from this century.&lt;br&gt;
Problem is that doing things manually is a never ever a good idea, luckily Ansible and a bit of Python love come to rescue.&lt;br&gt;
Supposing Ejabberd is already installed and configured (I wrote a post on the subject a couple of years ago: &lt;!-- raw HTML omitted --&gt;&lt;a href="https://nagg.eu/ejabberd-xmpp-server-configuration-guide//"&gt;https://nagg.eu/ejabberd-xmpp-server-configuration-guide//&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;) the following Ansible script will take care of all the steps needed to upgrade to a newer version of Ejabberd&lt;/p&gt;</description></item><item><title>ejabberd and fail2ban</title><link>https://nagg.eu/ejabberd-and-fail2ban/</link><pubDate>Wed, 16 Sep 2015 18:54:42 +0000</pubDate><guid>https://nagg.eu/ejabberd-and-fail2ban/</guid><description>&lt;p&gt;Fail2ban is a useful tool capable of mitigating brute force attacks performed
against a multitude of services (ejabberd in our case).&lt;br&gt;
Configuration is split between a multitude of files: &lt;code&gt;jail.conf&lt;/code&gt; defines which
filters are active while the filters scripts are placed in &lt;code&gt;./filter.d&lt;/code&gt; directory.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[root@CentOS ~]# vi /etc/fail2ban/jail.conf
---
bantime = 1200
findtime = 1200
maxretry = 10

backend = auto

[ejabberd-auth]
enabled = true
port = 5222,5280,7777
action = iptables-multiport[name=ejabberd, port=&amp;#34;5222,5269,5280,777&amp;#34;, protocol=tcp]
logpath = /var/log/ejabberd/ejabberd.log
---
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex="0"&gt;&lt;code&gt;[root@CentOS ~]# vi /etc/fail2ban/filter.d/ejabberd-auth.conf
---
[Definition]

failregex = ^=INFO REPORT====  ===\nI\(&amp;lt;0\.\d+\.0&amp;gt;:ejabberd_c2s:\d+\) : \([^)]+\) Failed authentication for .+ from IP &amp;lt;HOST&amp;gt; \({{(?:\d+,){3}\d+},\d+}\)$
                ^(?:\.\d+)? \[info\] &amp;lt;0\.\d+\.\d&amp;gt;@ejabberd_c2s:wait_for_feature_request:\d+ \([^\)]+\) Failed authentication for \S+ from IP &amp;lt;HOST&amp;gt;$
                ^.* Failed authentication for \S+ from &amp;lt;HOST&amp;gt;$
                ^.* from &amp;lt;&amp;lt;&amp;#34;&amp;lt;HOST&amp;gt;&amp;#34;&amp;gt;&amp;gt; failed with error: &amp;lt;&amp;lt;&amp;#34;inexistent-account&amp;#34;&amp;gt;&amp;gt;$
                ^.* from &amp;lt;&amp;lt;&amp;#34;&amp;lt;HOST&amp;gt;&amp;#34;&amp;gt;&amp;gt; failed with error: &amp;lt;&amp;lt;&amp;#34;bad-password&amp;#34;&amp;gt;&amp;gt;$
                ^.* from &amp;lt;&amp;lt;&amp;#34;&amp;lt;HOST&amp;gt;&amp;#34;&amp;gt;&amp;gt; failed with error: &amp;lt;&amp;lt;&amp;#34;badformed-jid&amp;#34;&amp;gt;&amp;gt;$

ignoreregex =

[Init]

journalmatch =
---
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first two regular expressions are for user authentication while the others
are for administration panel login.&lt;br&gt;
Other useful commands are:&lt;/p&gt;</description></item><item><title>ejabberd SOCKS5 proxy – file transfer</title><link>https://nagg.eu/ejabberd-socks5-proxy-file-transfer/</link><pubDate>Thu, 03 Sep 2015 14:08:00 +0000</pubDate><guid>https://nagg.eu/ejabberd-socks5-proxy-file-transfer/</guid><description>&lt;p&gt;Ejabberd XMPP server includes a SOCKS5 proxy, setting it up correctly is what
makes the difference between fast or very slow file transfer operations.&lt;br&gt;
As per XEP-0065 file transfer is either peer-to-peer or mediated by a proxy
server.&lt;br&gt;
In Conversation peer-to-peer transfer is done by converting the file in base64,
split it in 4 kb chunks sent one at the time always awaiting first for the ACK
of the precedent one; this makes the whole process painfully slow and bandwidth
consuming.&lt;br&gt;
The other file transfer method supported by Conversation is defined by XEP-0234
(or Jingle file transfer) which relies on a SOCKS5 proxy and also allow to
negotiate parameters like encryption.&lt;br&gt;
Ejabberd configuration:&lt;/p&gt;</description></item><item><title>ejabberd XMPP server configuration guide</title><link>https://nagg.eu/ejabberd-xmpp-server-configuration-guide/</link><pubDate>Mon, 11 Aug 2014 16:08:21 +0000</pubDate><guid>https://nagg.eu/ejabberd-xmpp-server-configuration-guide/</guid><description>&lt;p&gt;I will be keeping this post up to date to keep track on how to configure and
mantain an ejabberd server working efficiently and secure. I strongly advise
any reader to read carefully what is written here and not just copy-and-paste
the configuration file.&lt;br&gt;
My blog also contains a bunch of other posts regarding ejabberd that are worth
giving a look at, use the search form.&lt;/p&gt;
&lt;h3 id="server"&gt;Server&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
CentOS 7.5.1804 x86_64
Erlang/OTP 21.1.1-1 x86_64
ejabberd 18.09
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="client"&gt;Client&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
LineageOS 15.1 (Android Nougat)
Conversations 2.3.5+fcr
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="-installation-and-initial-configuration"&gt;.:. Installation and initial configuration&lt;/h3&gt;
&lt;p&gt;Download and install erlang (release numbers here may not be up to date):&lt;/p&gt;</description></item></channel></rss>