Statiscs = "just enable muc_size"

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.

You can use amplitude, google analytics or implement your own analytics.
Example Google analytics: https://github.com/jitsi/jitsi-meet/blob/master/analytics-ga.js
This is the adapter: https://github.com/jitsi/lib-jitsi-meet/blob/master/modules/statistics/AnalyticsAdapter.js
Here are the settings: https://github.com/jitsi/jitsi-meet/blob/master/config.js#L373

Total amount of participants at least is enough.
Rooms list, IPs, at best.

So now i managed get total sessions. It was a sick quest. Thanks for help everybody.
Here is something like instruction to compile different threads of this forum:

If Jitsi is installed by quick install then it is better to purge it as we need prosody 0.11.

sudo apt-get -y purge jitsi-*
sudo apt-get -y purge prosody*
sudo apt -y autoremove

To get it right we need to connect Prosody repository.

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 -

Then install Jitsi as quick install.
The new version of Prosody can use SSL certs in PEM format. So prepare them before installation.

wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add -
sudo sh -c "echo 'deb https://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-stable.list"
sudo apt-get -y update
sudo apt-get -y install jitsi-meet
chown prosody:prosody /etc/prosody/certs/* 

Jitsi has problems out of the box with port conflicts so:

nano /etc/jitsi/videobridge/sip-communicator.properties
org.jitsi.videobridge.TCP_HARVESTER_PORT=4443

I’d also recomend to get rid of “youtube sharing” and “blure” buttons in:
nano /usr/share/jitsi-meet/interface_config.js

systemctl restart prosody

If we want Jigasi to invite SIP participants to meeting:

apt-get -y install jigasi
nano /etc/jitsi/jigasi/config
set sip user@server and password 
nano /etc/jitsi/jigasi/sip-communicator.properties
net.java.sip.communicator.service.gui.ALWAYS_TRUST_MODE_ENABLED=true

Then to get mod_muc_size for statistics.

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

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

apt install jitsi-meet-tokens
nano /etc/prosody/prosody.cfg.lua
c2s_require_encryption = false

edit prosody virtual host config.

allow_empty_token = true
systemctl restart prosody

Get prosody-plugins from the source and place them to /usr/lib/prosody/modules

wget https://github.com/jitsi/jitsi-meet/archive/master.zip -O jitsi-meet.zip

Then we need to add “muc_size”; to modules_enabled in prosody virtual host config. And restart.

systemctl restart prosody

Now curl should return number of sessions

curl http://localhost:5280/sessions

The muc_size module has three functions but other two need arguments in unkown formats to be set in uri:
room-size
sessions
room

There are some threads on this forum where people struggle to get them work ending with editing the module’s code. For example they add nbConfPart function. If we want to try this path then it is better to copy the module’s file and enable it in the host config instead of original.

2 Likes

Hi, I can’t make it works yet, I’m getting 404.
I’ve some questions that is not clear.

1- If I want to execute “curl http: // localhost: 5280 / sessions”, the configuration should be in a virtual host called “localhost”, or it could be in the virtual host called “FQDN”?

2- If the error is due to authentication (example: missing JWT), the error that is shows is 404 too? or it returns another message?

Thnks!!

I got to:

apt install jitsi-meet-tokens

when it asked:

Application ID:
The application ID to be used by token authentication plugin:
Application secret:
The application secret to be used by token authentication plugin:

But reading the docs it look like this was supposed to auto configure?

I entered some values, but nothing changed anywhere. I gather from the postinst script that it was supposed to alter my /etc/prosody/conf.avail/host....cfg.lua file, but it did not. (Maybe it doesn’t need to, since it looked like it was taking care of anonymous authentication, and I’ve already followed the jitsi-meet instructions for securing…

You should query address from your prosody config. That with mod enabled.
If you use only FQDN without localhost then query FQND.
My prosody config for FQDN only now looks like this. It is used for JWT auth from Rocketchat.

plugin_paths = { "/usr/share/jitsi-meet/prosody-plugins/" }

-- domain mapper options, must at least have domain base set to use the mapper
muc_mapper_domain_base = "jitsi.domain.local";

turncredentials_secret = "MDQo1gWvaSGnasxS";

turncredentials = {
  { type = "stun", host = "jitsi.domain.local", port = "4446" },
  { type = "turn", host = "jitsi.domain.local", port = "4446", transport = "udp" },
  { type = "turns", host = "jitsi.domain.local", port = "443", transport = "tcp" }
};

cross_domain_bosh = false;
consider_bosh_secure = true;

VirtualHost "jitsi.domain.local"

        authentication = "token";
        app_id="jasdtsiasdfasdf";
        app_secret="asdfasdfasdfi";
        allow_empty_token = false;

        ssl = {
                key = "/etc/prosody/certs/jitsi.domain.local.key";
                certificate = "/etc/prosody/certs/jitsi.domain.local.crt";
        }
        speakerstats_component = "speakerstats.jitsi.domain.local"
        conference_duration_component = "conferenceduration.jitsi.domain.local"
        -- we need bosh
        modules_enabled = {
            "bosh";
            "pubsub";
            "ping"; -- Enable mod_ping
            "speakerstats";
            "turncredentials";
            "conference_duration";
            "muc_size";
        }
        c2s_require_encryption = false

Component "conference.jitsi.domain.local" "muc"
    storage = "memory"
    modules_enabled = {
        "muc_meeting_id";
        "muc_domain_mapper";
        "token_verification";
    }
    admins = { "focus@auth.jitsi.domain.local" }
    muc_room_locking = false
    muc_room_default_public_jids = true

-- internal muc component
Component "internal.auth.jitsi.domain.local" "muc"
    storage = "memory"
    modules_enabled = {
      "token_verification";
      "ping";
    }
    admins = { "focus@auth.jitsi.domain.local", "jvb@auth.jitsi.domain.local" }
    muc_room_locking = false
    muc_room_default_public_jids = true

VirtualHost "auth.jitsi.domain.local"
    ssl = {
        key = "/etc/prosody/certs/auth.jitsi.domain.local.key";
        certificate = "/etc/prosody/certs/auth.jitsi.domain.local.crt";
    }
    authentication = "internal_plain"

Component "focus.jitsi.domain.local"
    component_secret = "4NWAADasQ"

Component "speakerstats.jitsi.domain.local" "speakerstats_component"
    muc_component = "conference.jitsi.domain.local"

Component "conferenceduration.jitsi.domain.local" "conference_duration_component"
    muc_component = "conference.jitsi.domain.local"
Component "callcontrol.jitsi.domain.local" component_secret = "iSAHddWU"


VirtualHost "guest.jitsi.domain.local"
    authentication = "token"
    app_id="jasdtsiasdfasdf";
    app_secret="asdfasdfasdfi";
    allow_empty_token = true
    c2s_require_encryption = false