<commit_before>: prosody (on Uberspace)

Host your own instance of XMPP / Jabber. Fast, easy and decently secure.

/This guide is security critical. See [20]/

I assume the installation to be on a shared host, so the guide uses paths inside $HOME. Keep that in mind for global installations.

::: updates

:::: 2016.12.12

Update version of Prosody (0.9.11) and OpenSSL (1.0.2j). Translation to english. 
Shortened here and there.

Former changes to this guide on the bottom of the page.

- - -

The goal of this guide is to get an own instance with the best available encryption.
IM Observatory [0] will rate it with an 'A'.

Parts of thus guide are inspired by [1].

:: newer OpenSSL

For newer methods of encryption we need a recent version of OpenSSL.
We'll use toast [2] for that. Check for your currently active version. We want 1.0.2 (as 1.1.x is not supported by luasec 0.5.1 [28]).

====
openssl version
====

If you get something different, go ahead:

====
toast arm https://www.openssl.org/source/openssl-1.0.2j.tar.gz && . ~/.bash_profile && openssl version
====

Now you should get 'OpenSSL 1.0.2j  26 Sep 2016'.

:: prepare Lua

Check for Lua 5.1.x:

====
lua -v
====

Prosody doesn't support 5.2.

Now let's get newer modules via luarocks to support PFS [3].
To make everything work nicely, we need to prepare our env.
Put this to your profile:

====
# added for Prosody and Luarocks
export LUA_PATH='/home/UUSER/.luarocks/share/lua/5.1/?.lua;/home/UUSER/.luarocks/share/lua/5.1/?/init.lua;./?.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;/home/UUSER/.luarocks/share/lua/5.1/?.lua;/home/UUSER/.luarocks/share/lua/5.1/?/init.lua;./?.lua;/usr/lib64/lua/5.1/?.lua;/usr/lib64/lua/5.1/?/init.lua;/home/UUSER/.luarocks/share/lua/5.1/?.lua;/home/UUSER/.luarocks/share/lua/5.1/?/init.lua;./?.lua'
export LUA_CPATH='/home/UUSER/.luarocks/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/home/UUSER/.luarocks/lib/lua/5.1/?.so;./?.so;/usr/lib64/lua/5.1/?.so;/usr/lib64/lua/5.1/loadall.so;/home/UUSER/.luarocks/lib/lua/5.1/?.so'
====

Replace 'UUSER', of course, and update env: 

====
sed "s/UUSER/$USER/g" -i ~/.bash_profile
. ~/.bash_profile
====

Now we can install the needed modules [5]. If OpenSSL was updated using toast we need to set 'OPENSSL_DIR' for luasec accordingly:

====
luarocks install luasocket --local
luarocks install luaexpat --local
luarocks install luafilesystem --local
luarocks install luasec 0.5.1 --local OPENSSL_DIR=~/.toast/armed/usr/local/
====

The modules should look like this now:

====
luarocks list
 
Installed rocks:
----------------
 <commit_msg>Use expanded path in `OPENSSL_DIR`<commit_after>: prosody (on Uberspace)

Host your own instance of XMPP / Jabber. Fast, easy and decently secure.

/This guide is security critical. See [20]/

I assume the installation to be on a shared host, so the guide uses paths inside $HOME. Keep that in mind for global installations.

::: updates

:::: 2016.12.12

Update version of Prosody (0.9.11) and OpenSSL (1.0.2j). Translation to english. 
Shortened here and there.

Former changes to this guide on the bottom of the page.

- - -

The goal of this guide is to get an own instance with the best available encryption.
IM Observatory [0] will rate it with an 'A'.

Parts of thus guide are inspired by [1].

:: newer OpenSSL

For newer methods of encryption we need a recent version of OpenSSL.
We'll use toast [2] for that. Check for your currently active version. We want 1.0.2 (as 1.1.x is not supported by luasec 0.5.1 [28]).

====
openssl version
====

If you get something different, go ahead:

====
toast arm https://www.openssl.org/source/openssl-1.0.2j.tar.gz && . ~/.bash_profile && openssl version
====

Now you should get 'OpenSSL 1.0.2j  26 Sep 2016'.

:: prepare Lua

Check for Lua 5.1.x:

====
lua -v
====

Prosody doesn't support 5.2.

Now let's get newer modules via luarocks to support PFS [3].
To make everything work nicely, we need to prepare our env.
Put this to your profile:

====
# added for Prosody and Luarocks
export LUA_PATH='/home/UUSER/.luarocks/share/lua/5.1/?.lua;/home/UUSER/.luarocks/share/lua/5.1/?/init.lua;./?.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;/home/UUSER/.luarocks/share/lua/5.1/?.lua;/home/UUSER/.luarocks/share/lua/5.1/?/init.lua;./?.lua;/usr/lib64/lua/5.1/?.lua;/usr/lib64/lua/5.1/?/init.lua;/home/UUSER/.luarocks/share/lua/5.1/?.lua;/home/UUSER/.luarocks/share/lua/5.1/?/init.lua;./?.lua'
export LUA_CPATH='/home/UUSER/.luarocks/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/home/UUSER/.luarocks/lib/lua/5.1/?.so;./?.so;/usr/lib64/lua/5.1/?.so;/usr/lib64/lua/5.1/loadall.so;/home/UUSER/.luarocks/lib/lua/5.1/?.so'
====

Replace 'UUSER', of course, and update env: 

====
sed "s/UUSER/$USER/g" -i ~/.bash_profile
. ~/.bash_profile
====

Now we can install the needed modules [5]. If OpenSSL was updated using toast we need to set 'OPENSSL_DIR' for luasec accordingly:

====
luarocks install luasocket --local
luarocks install luaexpat --local
luarocks install luafilesystem --local
luarocks install luasec 0.5.1 --local OPENSSL_DIR=$HOME/.toast/armed/usr/local/
====

The modules should look like this now:

====
luarocks list
 
Installed rocks:
----------------
 
{'fraction_non_alphanumeric': 0.16420487243429888, 'fraction_numerical': 0.034912718204488775, 'mean_word_length': 3.341382181515404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4208093', 'n_tokens_mistral': 1981, 'n_tokens_neox': 1873, 'n_words': 566}