OpenWrt Forum Archive

Topic: Prosody, server for Jabber/XMPP

The content of this topic has been archived between 30 Mar 2018 and 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Prosody 0.8.2 is newest version.

I have been running Prosody 0.8.2 on a Fedora 14 system for some time now and would like to get this running on OpenWRT.

Would it be possible for the person who packaged the earlier versions of Prosody for OpenWRT (0.6.2) to package this update for me (and others)?

Thanks,

Perazim

There is no prosody package for ar71xx, neither for orion @r29330. Something bad happen @r28901?
Is not in menuconfig. How can I get it back?
Edit:
Someone open ticket [s]#10513[/s] solved in r29356
Thanks!

(Last edited by Nilfred on 30 Nov 2011, 05:43)

Hi there,

I managed to install and run prosody on my OpenWrt Backfire 10.03.1.
Clients connect and most things work, but ...

Whenever a external XMPP-server is involved I get the following error:

Feb 17 18:30:11 socket    debug    server.lua: accepted new client connection from 74.125.64.95:52243 to 5269
Feb 17 18:30:11 s2sin4a41c0    info    Incoming s2s connection
Feb 17 18:30:11 s2sin4a41c0    debug    incoming s2s received <stream:stream>
Feb 17 18:30:11 s2sin4a41c0    debug    sending: <?xml version='1.0'?>
Feb 17 18:30:11 s2sin4a41c0    debug    sending: <stream:stream xmlns:stream='http://etherx.jabber.org/streams' id='7d3cae57-5bcd-4965-b17e-095633c3d18f' xmlns:db='jabber:server:dialback' xmlns='jabber:server'>
Feb 17 18:30:11 s2sin4a41c0    debug    Received[s2sin_unauthed]: <result xmlns='jabber:server:dialback' to='example.com' from='gmail.com'>
Feb 17 18:30:11 modulemanager    debug    Passing stanza to mod_dialback
Feb 17 18:30:11 s2sin4a41c0    debug    asking gmail.com if key CAESBxCJxvbi2CYaEI22ne5uTrMvKiMwV0VS6Tk= belongs to them
Feb 17 18:30:11 s2smanager    debug    opening a new outgoing connection for this stanza
Feb 17 18:30:11 s2smanager    debug    First attempt to connect to gmail.com, starting with SRV lookup...
Feb 17 18:30:11 adns    debug    Records for _xmpp-server._tcp.gmail.com. not in cache, sending query (thread: 0x72b360)...
Feb 17 18:30:11 xmppserver_listener    error    Traceback[s2s]: /usr/lib/prosody/net/adns.lua:34: /usr/lib/prosody/net/dns.lua:186: bad argument #1 to 'randomseed' (integer expected, got number): stack traceback:
    /usr/lib/prosody/net/xmppserver_listener.lua:33: in function </usr/lib/prosody/net/xmppserver_listener.lua:33>
    [C]: ?
    /usr/lib/prosody/net/adns.lua:34: in function 'lookup'
    /usr/lib/prosody/core/s2smanager.lua:204: in function 'attempt_connection'
    /usr/lib/prosody/core/s2smanager.lua:169: in function 'new_outgoing'
    /usr/lib/prosody/core/s2smanager.lua:117: in function 'send_s2s'
    mod_dialback.lua:70: in function '?'
    /usr/lib/prosody/core/modulemanager.lua:270: in function 'modules_handle_stanza'
    /usr/lib/prosody/core/stanza_router.lua:117: in function 'core_process_stanza'
    /usr/lib/prosody/net/xmppserver_listener.lua:38: in function </usr/lib/prosody/net/xmppserver_listener.lua:38>
    [C]: in function 'xpcall'
    /usr/lib/prosody/net/xmppserver_listener.lua:38: in function 'cb_handlestanza'
    /usr/lib/prosody/core/xmlhandlers.lua:131: in function </usr/lib/prosody/core/xmlhandlers.lua:106>
    [C]: in function 'parse'
    /usr/lib/prosody/net/xmppserver_listener.lua:65: in function 'data'
    /usr/lib/prosody/net/xmppserver_listener.lua:139: in function </usr/lib/prosody/net/xmppserver_listener.lua:117>
    (tail call): ?
    /usr/lib/prosody/net/server.lua:817: in function </usr/lib/prosody/net/server.lua:802>
    [C]: in function 'xpcall'
    /usr/bin/prosody:351: in function 'loop'
    /usr/bin/prosody:411: in main chunk
    [C]: ?
Feb 17 18:30:28 c2s5ade88    debug    Received[c2s]: <iq id='821375837909' type='get' to='test@conference.example.com'>
Feb 17 18:30:28 componentmanager    debug    iq stanza being handled by component: conference.example.com
Feb 17 18:30:30 socket    debug    server.lua: client 74.125.64.95:52243 read error: closed
Feb 17 18:30:30 s2sin4a41c0    info    s2s disconnected: gmail.com->example.com (closed)
Feb 17 18:30:30 s2sin4a41c0    info    Destroying incoming session gmail.com->example.com
Feb 17 18:30:30 socket    debug    server.lua: closed client handler and removed socket from list

I checked, deinstalled, reinstalled. I searched for these errors at the project sites, but found nothing.
Anyone has a clue?

(Last edited by spoofy on 17 Feb 2012, 21:57)

I get similar stuff when trying S2S (server to server) connections.
I noted that OpenWrt ships 0.6.2-1 while 0.8.2 seems to be the latest release on prosody.im.
So before put too much work in this, I'd rather like to see the package updated. However, I have like no experience at all in compiling/building packages. Maybe the original author of the OpenWrt package can update it?

No need to compile, most are .lua code and remaining few binaries are of the same version of current.
Is straight forward overwrite and run. See #25

I solved some permissions issues, as prosody runs as prosody:prosody and /etc/ is read-only in newer trunks. I don't use S2S, but maybe is the same thing: Trying to write on a read only path.
Older prosody used to write in /var/lib

spoofy wrote:

Hi there,

I managed to install and run prosody on my OpenWrt Backfire 10.03.1.
Clients connect and most things work, but ...

Whenever a external XMPP-server is involved I get the following error:

Feb 17 18:30:11 xmppserver_listener    error    Traceback[s2s]: /usr/lib/prosody/net/adns.lua:34: /usr/lib/prosody/net/dns.lua:186: bad argument #1 to 'randomseed' (integer expected, got number)

I checked, deinstalled, reinstalled. I searched for these errors at the project sites, but found nothing.
Anyone has a clue?

Got it:
bad argument #1 to 'randomseed' (integer expected, got number)
And https://dev.openwrt.org/ticket/12178#comment:6
If you feel uncomfortable with sed You can edit it with:

vi /usr/lib/prosody/net/dns.lua

Only once after install and problem gone.

sed -i -e '186 s/)))/)) % 0x80000000)/' /usr/lib/prosody/net/dns.lua

Lua 5.1 does not have bitwise operator if you ask why not mask 0x7FFFFFFF (maximum 32 bit positive integer) instead.

Nilfred wrote:

No need to compile, most are .lua code and remaining few binaries are of the same version of current.
Is straight forward overwrite and run. See #25

I must have taken this too literally; I downloaded Prosody 0.8.2 and replaced the /net/, /core/, /modules/, and /util/ luas with the 0.8.2 versions one at a time, checking to see if Prosody would start every time.  Afterwards, I ended up with a half-page list of luas that threw errors anyways.  I cleared out the Prosody installation and started over.

I corrected permissions and ownership:

chmod +r /etc/prosody/prosody.cfg.lua

chown -R prosody:prosody /etc/prosody/data

Manually patched dns.lua:

math.randomseed(math.floor(10000*socket.gettime()) % 0x80000000);

Added users:

prosodyctl adduser n00b@n00bserver.nub

After that, my server seems to work fine.  My users added each other normally, which failed to happen my first time through these instructions (which is why I tried ghetto-updating to 0.8.2), so perhaps manually deleting the Prosody leftovers after uninstalling and then cleanly reinstalling 0.6.2-2 from the repository helped.

Thanks, Nilfred, for getting this to work.  I now have secure comms again without having Google, MS, or IT social engineering me.

You're welcome!

It's still not clear if you are running 0.6.2 or 0.8.2 hmm

Latest updates are in Wiki and Ticket 12178 (solved upstream)

A problem still remain without a clue of witch cause 100% CPU usage.

Nilfred wrote:

It's still not clear if you are running 0.6.2 or 0.8.2 hmm

0.6.2-2.

I don't have the skill to build a 0.8.2 package.  I read your updates to the wiki, though.

A problem still remain without a clue of witch cause 100% CPU usage.

https://dev.openwrt.org/ticket/12178#comment:18

Anon said to change the default 5222 port to something else to avoid bot spam.

What about updated version 0.9.1?

0.9.1 depends on a custom IPV6 library. Doesn't worth the effort and [put your excuse for not doing it yourself here]

Hi Nilfred,

Thank you for your work.
I have applied your patch to build prosidy 0.8.2
The compilation works fine.
I have installed all the required packages:

libidn_1.18-1
liblua_5.1.5-1
luaexpat_1.2.0-1
luafilesystem_1.6.2-1
luasec_0.4-1
luasocket_3.0-rc1-20130909-2
lua_5.1.5-1
prosody_0.8.2-1

When i try to start it i receive this error:

**************************
Prosody was unable to find LuaSec
This package can be obtained in the following ways:

        Source:           http://www.inf.puc-rio.br/~brunoos/luasec/
        Debian/Ubuntu:    http://prosody.im/download/start#debian_and_ubuntu
        luarocks:         luarocks install luasec

SSL/TLS support will not be available
More help can be found on our website, at http://prosody.im/doc/depends
**************************


lua: symbol 'strverscmp': can't resolve symbol in lib '/usr/lib/libidn.so.11'.
***********************************
util/encodings couldn't be loaded. Check that you have a recent version of libidn

The full error was:
error loading module 'util.encodings' from file '/usr/lib/prosody/util/encodings.so':
        (null)
***********************************

**************************
Prosody was unable to find util.hashes
This package can be obtained in the following ways:

        Windows:      Make sure you have hashes.dll from the Prosody distribution in util/
        GNU/Linux:    Run './configure' and 'make' in the Prosody source directory to build util/hashes.so

util.hashes is required for Prosody to run, so we will now exit.
More help can be found on our website, at http://prosody.im/doc/depends
**************************

Can you give me an help?

Thank you

I didn't test it in other platforms other than mine.
Maybe I didn't patch properly the makefile that make those binaries, or the patch doesn't go well at all.
Do You have room for OpenSSL?
Try to satisfy those binaries, they should have been compiled but not packaged properly, so copy & paste.
I think those are required when OpenSSL is not installed.

Can you tell me the version of uclib that you use to compile the packages?

Thank you

I have compiled it in AA and it works.
In backfire doesn't work.
So it is related to the uclib version.

Hello.

I use Prosody 0.9.7
Offline messages enable.  When you send offline messages prosody crashed.

ls -la /etc/prosody/data/domain/offline
drwsrwsrwt    2 prosody  prosody       4096 Mar  6 16:40 .
drwsrwsrwt    7 prosody  prosody       4096 Mar  6 14:50 ..
-rw-r-----    1 prosody  prosody          0 Mar  6 16:40 user.list

user.list = 0 byte!!!!!!

When I offline messages desabled, prosody ok.

How to make it work  offline messages???

Disk full? Please post the output of

df

Hi,

same problem here.

# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    2.9M    616.0K      2.3M  20% /
/dev/root                 3.8M      3.8M         0 100% /rom
tmpfs                    61.6M    288.0K     61.3M   0% /tmp
/dev/mtdblock3            2.9M    616.0K      2.3M  20% /overlay
overlayfs:/overlay        2.9M    616.0K      2.3M  20% /
tmpfs                   512.0K         0    512.0K   0% /dev

Permissions? Please post the output of

ls -dl /etc /etc/prosody /etc/prosody/data/ /etc/prosody/data /your\%2edomain\%2ename/ /etc/prosody/data/your\%2edomain\%2ename/offline/ wrote:

drwxr-xr-x    1 root     root             0 Nov 17  2012 /etc
drwxr-xr-x    4 root     root             0 Dec  5  2012 /etc/prosody
drwxr-xr-x    4 prosody  prosody          0 Dec  5  2012 /etc/prosody/data/
drwxr-x---    6 prosody  prosody          0 Dec 14  2012 /etc/prosody/data/your\%2edomain\%2ename/
drwxr-x---    2 prosody  prosody          0 Mar 16 19:39 /etc/prosody/data/your\%2edomain\%2ename/offline/

I checked the permissions, even created the user.list files in offline dir. I tested it now again with your permission set, just to be sure.

# ls -ld /etc/prosody/ /etc/prosody/data/ /etc/prosody/data/the2masters\%2ede/ /etc/prosody/data/the2masters\%2ede/offline/
drwxr-xr-x    1 root     root             0 Jan  1  1970 /etc/prosody/
drwxr-xr-x    1 prosody  prosody          0 Jan  1  1970 /etc/prosody/data/
drwxr-x---    5 prosody  prosody          0 Jan  1  1970 /etc/prosody/data/the2masters%2ede/
drwxr-x---    2 prosody  prosody          0 Mar 17 07:48 /etc/prosody/data/the2masters%2ede/offline/

There are no files, unless there are unread offline messages for those users:

ls -l /etc/prosody/data/whatever/offline/ wrote:

-rw-r-----    1 prosody  prosody       3066 Sep 18  2013 andrea.list
-rw-r-----    1 prosody  prosody        710 Sep 10  2013 claudia.list
-rw-r-----    1 prosody  prosody        639 Sep  2  2013 irene.list

What is the permission set for /etc/? Older versions used to be in /tmp/, flash friendly.

# ls -ld /etc/
drwxr-xr-x    1 root     root             0 Mar  2 22:29 /etc/

this empty file got created on last test:

# ls -l /etc/prosody/data/the2masters\%2ede/offline/
-rw-r-----    1 prosody  prosody          0 Jan 11 10:41 zabbix.list

file size is 0 byte, looks like creating the file works, but not writing to it.

I have a problem with latest trunk (musl):

mips-openwrt-linux-musl-ld -L~/build/openwrt/trunk/staging_dir/target-mips_34kc_musl-1.1.10/usr/lib -L~/build/openwrt/trunk/staging_dir/target-mips_34kc_musl-1.1.10/lib -L~/build/openwrt/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/lib -L~/build/openwrt/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/lib -fstack-protector -Wl,-z,now -Wl,-z,relro   -O -fPIC -shared -L~/build/openwrt/trunk/staging_dir/target-mips_34kc_musl-1.1.10/usr/lib -L~/build/openwrt/trunk/staging_dir/target-mips_34kc_musl-1.1.10/lib -L~/build/openwrt/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/lib -L~/build/openwrt/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/lib -fstack-protector -Wl,-z,now -Wl,-z,relro -L./luasocket -o ssl.so x509.o context.o ssl.o -lssl -lcrypto -lluasocket
mips-openwrt-linux-musl-ld: unrecognized option '-Wl,-z,now'
mips-openwrt-linux-musl-ld: use the --help option for usage information
make[6]: *** [ssl.so] Error 1
make[6]: Leaving directory `~/build/openwrt/trunk/build_dir/target-mips_34kc_musl-1.1.10/luasec-luasec-0.5/src'
make[5]: *** [linux] Error 2
make[5]: Leaving directory `~/build/openwrt/trunk/build_dir/target-mips_34kc_musl-1.1.10/luasec-luasec-0.5/src'
make[4]: *** [linux] Error 2
make[4]: Leaving directory `~/build/openwrt/trunk/build_dir/target-mips_34kc_musl-1.1.10/luasec-luasec-0.5'
make[3]: *** [~/build/openwrt/trunk/build_dir/target-mips_34kc_musl-1.1.10/luasec-luasec-0.5/.built] Error 2
make[3]: Leaving directory `~/build/openwrt/trunk/feeds/packages/lang/luasec'
make[2]: *** [package/feeds/packages/luasec/compile] Error 2
make[2]: Leaving directory `~/build/openwrt/trunk'
make[1]: *** [~/build/openwrt/trunk/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.package_compile] Error 2
make[1]: Leaving directory `~/build/openwrt/trunk'
make: *** [world] Error 2

How to workaround that?

EDIT: Automagically fixed in r46090 smile

(Last edited by Nilfred on 23 Jun 2015, 20:24)

polsta wrote:

Hello.

I use Prosody 0.9.7
Offline messages enable.  When you send offline messages prosody crashed.

ls -la /etc/prosody/data/domain/offline
drwsrwsrwt    2 prosody  prosody       4096 Mar  6 16:40 .
drwsrwsrwt    7 prosody  prosody       4096 Mar  6 14:50 ..
-rw-r-----    1 prosody  prosody          0 Mar  6 16:40 user.list

user.list = 0 byte!!!!!!

When I offline messages desabled, prosody ok.

How to make it work  offline messages???

Prosody was unable to append data to files with 'offline' module, but not on perms level, but on Lua/kernel/ext3 innards level. I get from Prosody community that this error along with using ext3 filesystem "likely means it [Prosody] can't reserve space for appending to a file, which is only used for offline messages". The reason I get was "fallocate() not supported in ext3".

The solution is to change in /usr/lib/prosody/util/datamanager.lua the line 43 from

fallocate = pposix.fallocate or fallocate;

to

fallocate = fallocate;

After this change restart with prosodyctl restart.

Source: http://www.snbforums.com/threads/prosod … ted.32245/

kukulo wrote:

The solution is to change in /usr/lib/prosody/util/datamanager.lua the line 43 from

fallocate = pposix.fallocate or fallocate;

to

fallocate = fallocate;

sed -i -e 's/pposix.fallocate or //' /usr/lib/prosody/util/datamanager.lua

Also /usr/lib/prosody/util/uuid.lua has to be edited in order to let prosody 0.9.9-2 start:

local urandom, urandom_err = io.open("/dev/urandom", "r+");

To:

local urandom, urandom_err = io.open("/dev/urandom", "r");

And

function seed(x)
    urandom:write(x);
    urandom:flush();
end

To noop:

function seed(x)
end

The discussion might have continued from here.