Statiscs = "just enable muc_size"

Hi. I’ve installed Jitsi-meet on Ubuntu 18 using quick install and I’d like to get some statistics about how many users/rooms are used.
As I googled - I need something like “muc_size”.
I’ve enabled it in config. And of course there were no any module with such name.
When I copied something from the sources, I’ve found that I have prosody 0.10 and I need 0.11
Ok. I’ve reinstalled everything and got 0.11 working.
Copied sources. And again there are no some modules.
And I need something like luarocks. And and then install modules one after another that appears in errors.
It was very strange.
And now “luarocks install luajwtjitsi” says:
Installing https://luarocks.org/luajwtjitsi-1.3-7.rockspec
Missing dependencies for luajwtjitsi 1.3-7:
luacrypto >= 0.3.2-1 (not installed)
lua-cjson >= 2.1.0 (not installed)
lbase64 >= 20120807-3 (not installed)
And as I read luacrypto is something very old depricated and unsupported.

Is there some working instruction to make statistics work?

You can use this one: https://github.com/jitsi/jitsi-meet/blob/master/resources/prosody-plugins/mod_muc_size.lua which sshould work with Prosody 10 no problem.

Thx for reply. I’ve downloaded it but this rabbit hole has no end :slight_smile:
module ‘cjson’ not found

root@jitsi:/var/log/prosody# luarocks install lua-cjson
Installing https://luarocks.org/lua-cjson-2.1.0.6-1.src.rock
gcc -O2 -fPIC -I/usr/include/lua5.2 -c lua_cjson.c -o lua_cjson.o
lua_cjson.c:43:10: fatal error: lua.h: No such file or directory
#include <lua.h>
^~~~~~~
compilation terminated.

Error: Build error: Failed compiling object lua_cjson.o

You should revert to Prosody 10, which uses lua 5.1.

Has anyone made it? There should be some complete instruction. It looks like reinventing the wheel made of absolete packages.

Made what, run? Sure, we run it in production. The problem yiou are facing is due to lua versions mismatch. Prosody 10 requires lua 5.1 and 11 requires 5.2 and you need to compile the extension for the exact verssion. The problem has nothing to do with obsolete packages.

I started with 10th version and it said that muc_size will not run with it. That’s why I went to 11.

I almost did it:
apt install luarocks
apt install liblua5.2-dev
apt install libssl1.0-dev

luarocks install net-url
luarocks install lua-cjson 2.1.0-1
luarocks install lbase64
luarocks install luajwtjitsi

But the last hangs with “clonning”
When I try to use the downloaded version prosody says:
muc_size error ‘app_id’ must not be empty

Are you using JWT based authentication?

No I will think about ldap later. Now there is no any auth

@damencho any idea?

The muc size is protected by token as this is sensible information, you need to add the app_id and the token shared secret and use a token to access the information.

I’ve got luajwtjitsi installed!

git config --global url.https://github.com/.insteadOf git://github.com/
luarocks install luajwtjitsi 

And added id and secret.

VirtualHost "localhost"
        app_id=""
        app_secret=""
        authentication = "anonymous"
        modules_enabled = {
            "muc_size";
        }

Prosody started with only errors about ipv6.

Mar 04 20:58:35 portmanager     error   Failed to open server port 5347 on ::1, Cannot assign requested address
Mar 04 20:58:35 portmanager     error   Error binding encrypted port for https: No certificate present in SSL/TLS configuration for https port 5281
Mar 04 20:58:35 portmanager     error   Error binding encrypted port for https: No certificate present in SSL/TLS configuration for https port 5281

Something is listening 5280 port but http://localhost:5280/nbConfPart gives 404

0.0.0.0:5280            0.0.0.0:*               LISTEN      4744/lua5.2

What about http://localhost:5280/room-size?room=123&token=… grab a valid HS256 token from jwt entering your id(as “aud”) and secret.

Is it ?
When I try to activate mod_muc_size.lua, I get an error “muc_size error requires a version of Prosody with util.async”. I can’t find any util.async in my version 10 of Prosody (from ubuntu 18.04)

Is it really possible to use muc_size with jitsi-meet on Ubuntu18 ?

Purge Jitsi and add prosody repo before installing again. To get 11 version.

echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list
wget https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add -
sudo apt-get update
sudo apt upgrade

Then look upper at my commands. I had to install dev packages and lua-cjson of particular version to get prosody started without errors about muc_size.

I’m not sure I understand :slight_smile:
What is jwt? Is it about some authentication that I did not configured?

Yes, it’s token based authentication. Since this API is sensitive it needs to be configured as damencho pointed out.

Is there any statistics without muc_size? Or some working instruction?
I can’t get it working and there are a lot of threads where people can’t do it too.

What stats are you looking for? Sorry I have no up to date instrucctions, I need to check it myself, but it’s been a quite busy period, apologies.