Docker and custom prosody autorisation module (auth_wordpress)

Hi all,
I am trying to use a custom authorisation module in a docker setup. My goal is to use an (adapted) community plugin: mod_auth_wordpress.lua.
I have this module already running on an ubuntu setup. However, this is a very old version of Jitsi, and I am trying to replicate the setup using the latest docker images.
First, I tried to changes the docker prosody image to include the module. However, I am unable to find where I should put the changes that should end up in /etc/prosody/conf.d/domain.cfg.lua

My second attempt was to use the XMPP_MODULES to load the custom module. However, I do not know how to get prosody to use the new module for authentication.
I think i need something like AUTH_TYPE=wordpress ?
Can anyone point me in the right direction? How should I configure a custom authorisation module to validate users against a wordpress database? Anyone tried this before?

–Robert

I made a little progress. the wordpress module is being loaded, but I get the error: module ā€˜DBI’ not found.

What I did:

I added lua-dbi-common and lua-dbi-mysql to the Prosody dockerfile.
I changed prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua and added the option for ā€˜wordpress’:
{{ else if eq $AUTH_TYPE ā€œwordpressā€ }}
authentication = ā€œwordpressā€
…

and created a new prosody docker image with these changes,

Using this image I get an error during startup:

prosody_1 | 2023-01-22T20:30:25.130298498Z modulemanager error Error initializing module ā€˜auth_wordpress’ on ā€˜meet.jitsi’: /usr/share/lua/5.4/prosody/util/startup.lua:203: module ā€˜DBI’ not found:
prosody_1 | 2023-01-22T20:30:25.130324681Z No LuaRocks module found for DBI
prosody_1 | 2023-01-22T20:30:25.130328574Z no field package.preload[ā€˜DBI’]
…

If I open a shell in this container and do an ā€˜apt list’ I see that both lua dbi components are installed:
lua-cyrussasl/now 1.1.0-2 amd64 [installed,local]
lua-dbi-common/now 0.7.2-2 all [installed,local]
lua-dbi-mysql/now 0.7.2-2 amd64 [installed,local]
lua-expat/now 1.3.9-1lua54prosody~bullseye3 amd64 [installed,local]
lua-filesystem/now 1.8.0-1 amd64 [installed,local]
lua-inspect/now 3.1.1-2 all [installed,local]
lua-ldap/now 1.2.5-1+b1 amd64 [installed,local]
lua-luaossl/now 20161214-3prosody~bullseye2 amd64 [installed,local]
lua-sec/now 1.0.2-1prosody~bullseye1 amd64 [installed,local]
lua-socket/now 3.0~rc1+git+ac3201d-6prosody~bullseye1 amd64 [installed,local]
lua-unbound/now 0.5-2 amd64 [installed,local]
lua5.4/now 5.4.2-2 amd64 [installed,local]

What is missing? What should I do to get rid of the DBI not found error?

-Robert

Sorry I have never used that module. Maybe some other dependency is missing.

I made some progress: it appears that de luadbi package does not support lua5.4. (see 1)
I changed all references to lua5.4 in the prosody Dockerfile to lua5.3 and build a new image. With the previous version of Lua in the image the auth_wordpress modules seems to be working fine.

However, in the prosody log file is see errors I did not notice before:

prosody_1 | 2023-01-23T20:08:58.032159120Z startup error Failed to apply GC configuration: Unknown GC parameter: step_size

I have a few questions to figure out:

  • is this error caused by using the previous version of Lua?
  • is jitsi fully compatible with the previous version of Lua? Or am i going to find problems later on?
  • what is the best approach forward: should I wait for a version of luadbi that supports lua5.4, or will compiling luadbi myself help?
  1. See: GitHub - mwild1/luadbi: Multi-backend SQL database library for Lua
    or luadbi - LuaRocks

I use Lua-5.2 in my Jitsi servers and no compability issue…

The Prosody authors do not recommend running 5.2 with Prosody 0.12, so I updated.

1 Like

It’s prosody 0.11.9 from the official Debian repo in my case.

The latest Jitsi docker has prosody 0.12.2, which supports lua 5.3 (although 5.4 is recommended).
I did some testing and could indeed find no issues using lua 5.3 with the docker setup, other then the log error about the Garbage Collector complaining about the parameter ā€˜step_size’.

The documentation on the prosody advanced garbage collector states that parameter step_size is only supported on Lua 5.4. (see: Advanced GC configuration – Prosody IM )
I changed the configuration file prosody.cfg.lua and removed this parameter from the gc section. Now the errors are gone :slight_smile:

I think I am happy now: I have a working docker setup with my custom authentication module and branding. After some more testing and changing small cosmetic things (like missing translation on the new ā€˜leave meeting’ and ā€˜end meeting for all’ buttons) it should be ready for deployment.

Thanks!

1 Like