Jitsi monitoring mod, room list , occupant list

[EDIT] Be aware that its a great door for room-bombing . So YOU MUST at least change the route such as :

["GET statusMYSECRETROUTE"] = function .....

hi @ledahu
thank you for your tutorial

unfortunately, I can’t get it working
which version of prosody do you use?

in my prosody log, I get the following error:
muc_status error requires a version of Prosody with util.async

I tried to manually add the async.lua file from prosody in the /usr/lib/prosody/util/ folder but I still get the error

i use 0.11.5

Thank you. It works after many times testing.

Hello, I have just arrived in this space, I am super interested in enabling this magnificent functionality, but with none of the ways it works, it always comes out:

<h1>404 Not Found</h1>
<p>Whatever you were looking for is not here. Keep looking.</p>
<p>Unknown host: XXXXX</p>
</body>

Hello friend, how did you make it work, at the time I could not :frowning:

You can check your prosody logs and see what happened.

I’ve the same issue like @moswaldosf
When I take a look at the debug log of prosody I get the following errors:
Apr 27 22:56:34 socket debug server.lua: accepted new client connection from 127.0.0.1:52818 to 5222 Apr 27 22:56:34 conference.example.org:muc_domain_mapper warn Session filters applied Apr 27 22:56:34 c2s5637a7109770 info Client connected Apr 27 22:56:34 c2s5637a7109770 debug Client sent opening <stream:stream> to auth.example.org Apr 27 22:56:34 c2s5637a7109770 debug Sending[c2s_unauthed]: <?xml version='1.0'?> Apr 27 22:56:34 c2s5637a7109770 debug Sending[c2s_unauthed]: <stream:stream id='0552f805-b12c-4205-a100-062fe1aff9bd' from='auth.example.org' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xmlns='jabber:client' xml:lang='en'> Apr 27 22:56:34 c2s5637a7109770 debug Sent reply <stream:stream> to client Apr 27 22:56:34 c2s5637a7109770 debug Not offering authentication on insecure connection Apr 27 22:56:34 c2s5637a7109770 debug Sending[c2s_unauthed]: <stream:features> Apr 27 22:56:34 runnerrnLmsWgX debug creating new coroutine Apr 27 22:56:34 c2s5637a7109770 debug Received[c2s_unauthed]: <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'> Apr 27 22:56:34 c2s5637a7109770 debug Sending[c2s_unauthed]: <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'> Apr 27 22:56:34 socket debug server.lua: we need to do tls, but delaying until send buffer empty Apr 27 22:56:34 c2s5637a7109770 debug TLS negotiation started for c2s_unauthed... Apr 27 22:56:34 socket debug server.lua: attempting to start tls on tcp{client}: 0x5637a7afbd88 Apr 27 22:56:34 socket debug server.lua: ssl handshake error: closed Apr 27 22:56:34 c2s5637a7109770 info Client disconnected: ssl handshake error: closed Apr 27 22:56:34 c2s5637a7109770 debug Destroying session for (unknown) ((unknown)@auth.example.org): ssl handshake error: closed Apr 27 22:56:34 socket debug server.lua: closed client handler and removed socket from list Apr 27 22:56:34 socket debug server.lua: accepted new client connection from 127.0.0.1:46892 to 5280 Apr 27 22:56:34 http.server debug Firing event: GET /room-size Apr 27 22:56:34 socket debug server.lua: closed client handler and removed socket from list

Could you share your configuration @michaelchen001 please that would be a pleasure

I’ve also tried in every way with no success at all.

I just spend a bit of time getting this to work. One problem I encountered is that the plugin is using conference as a default muc mapper prefix. At least on my installation, which is fairly recent, I needed to use muc instead. Once I changed that default things started to work.

It does seem to 500 when the domain is incorrect, but the workaround suggested above by @j2l2 will probably fix that problem.

@geoffreychallen si you could detail how you did the configuration it would be very helpful! please

1 Like

@ledahu
I managed to get your solution working as a standalone plugin (muc_mod_status), but I have problems with the status command. It is just loading forever, no matter what I enter as a domain, do you have any ideas why this could happen?
(When I don’t enter a domain it responds as intended instantly with a 400)

sessions is working like a charm

Edit:
I managed to identify where it stops, in

if component then
        local muc = component.modules.muc
        if muc and rawget(muc,"all_rooms") then
                allrooms= muc.all_rooms();
        end
end

I don’t reach the second if statement, so allrooms never gets populated.

Any idea how to debug this?

Thanks for your contribution. i have tried your code. but stuck to call this https://mydomain.com:5280/status?domain=mydomain

could you please give some idea.

I’m in the same situation, but I’ve found that using Grafana you could achieve the same thing:

1 Like

@RubensRainelli Thanks for your answer; it shows to you. how many rooms and people per room?

not for each one, it’s a sum as far as I’ve noticed.

after enabling this plugin in localhost.cfg.lua, prosody.service is failing to start. What could be possible solutions please suggest.

May 17 17:35:03 vc.test systemd[1]: prosody.service: Failed with result ‘core-dump’.
May 17 17:35:03 vc.test systemd[1]: Failed to start Prosody XMPP Server.

Hi,
i’ve just updated to the last jitsi release and my mod seems to work fine . Here is some of my config file if it can help you . This is “cumulative” file , so there must be some lines that are useless … (such as muc_size lines)

/etc/prosody/conf.avail/localhost.cfg.lua (not sure that it is used)

-- Section for localhost

-- This allows clients to connect to localhost. No harm in it.
VirtualHost "localhost"

        app_id="xxx"
        app_secret="xxx"
        authentication = "anonymous"
        modules_enabled = {
            "muc_size";
        }
 muc_mapper_domain_prefix = "muc"
 muc_domain_prefix = "muc"

/etc/prosody/conf.avail/mysub.domain.cfg.lua

 -- Plugins path gets uncommented during jitsi-meet-tokens package install - that's where token plugin is located
  plugin_paths = { "/usr/share/jitsi-meet/prosody-plugins/" }

VirtualHost "mysub.domain"
    allow_registration = true
    authentication = "internal_plain"
    -- Properties below are modified by jitsi-meet-tokens package config
    -- and authentication above is switched to "token"

    app_id="xxx"
    app_secret="xxx"
    allow_empty_token = true
    -- Assign this host a certificate for TLS, otherwise it would use the one
    -- set in the global section (if any).
    -- Note that old-style SSL on port 5223 only supports one certificate, and will always
    -- use the global one.
    ssl = {
            key = "/etc/prosody/certs/mysub.domain.key";
            certificate = "/etc/prosody/certs/mysub.domain.crt";
    }
    -- we need bosh
    modules_enabled = {
        "bosh";
        "pubsub";
        "ping"; -- Enable mod_ping
        "muc_status";
        "smacks";
    }
    consider_bosh_secure = true;
    c2s_require_encryption = false

Component "conference.mysub.domain" "muc"
storage = "memory"
modules_enabled = {
    "token_verification";
    }

admins = { "focus@auth.mysub.domain" }
    component_secret = "xxxxx"

VirtualHost "auth.mysub.domain"
ssl = {
    key = "/etc/prosody/certs/auth.mysub.domain.key";
    certificate = "/etc/prosody/certs/auth.mysub.domain.crt";
}
app_id="xxx"
app_secret="xxx"



Component "focus.mysub.domain"
component_secret = "xxxxx"


VirtualHost "guest.mysub.domain"
     authentication = "anonymous"
     app_id="xxx"
     app_secret="xxx"

     modules_enabled = {
        "bosh";
        "pubsub";
        "ping"; -- Enable mod_ping
        "muc_size";
     }

     allow_empty_token = true
     c2s_require_encryption = false


Component "internal.auth.mysub.domain" "muc"
storage = "memory"
modules_enabled = {
    "ping";
    }
admins = { "focus@auth.mysub.domain", "jvb@auth.mysub.domain" }

My apache2 virtualhost conf :

<VirtualHost 123.123.123.123:80>
    ServerName mysub.domain
    Redirect permanent / https://mysub.domain/
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>

<VirtualHost 123.123.123.123:443>

  ServerName mysub.domain

  SSLProtocol TLSv1 TLSv1.1 TLSv1.2
  SSLEngine on
  SSLProxyEngine on
  SSLCertificateFile /etc/letsencrypt/live/mysub.domain/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/mysub.domain/privkey.pem
  SSLCipherSuite "EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRS
A:EECDH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED"
  SSLHonorCipherOrder on
  Header set Strict-Transport-Security "max-age=31536000"

  DocumentRoot "/usr/share/jitsi-meet"
  <Directory "/usr/share/jitsi-meet">
    Options Indexes MultiViews Includes FollowSymLinks
    AddOutputFilter Includes html
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

  ErrorDocument 404 /static/404.html

  Alias "/config.js" "/etc/jitsi/meet/mysub.domain-config.js"
  <Location /config.js>
    Require all granted
  </Location>

  Alias "/external_api.js" "/usr/share/jitsi-meet/libs/external_api.min.js"
  <Location /external_api.js>
    Require all granted
  </Location>

  ProxyPreserveHost on
  ProxyPass /http-bind http://localhost:5280/http-bind/
  ProxyPassReverse /http-bind http://localhost:5280/http-bind/



  RewriteEngine on
  RewriteRule ^/([a-zA-Z0-9]+)$ /index.html
</VirtualHost>

and 5280 is open in the firewall

and then, when i get http://mysub.domain:5280/statusMYSECRETURL?domain=mysub.domain
i get the json

That’s all i can do …
all errors are in /var/log/prosody/prosody.log and prosody.err
if something fail, it will be in the log

this works perfectly, thank you!

This don’t work for me. I follow the guide step by step and when I put https://mydomain.com:5280/status?domain=mydomain, the browser can’t open anything.

I opened the 5280 using sudo ufw allow 5280 and then I restart everything with sudo systemctl restart prosody.service, sudo systemctl restart jicofo.service, sudo systemctl restart jitsi-videobridge2.service

So, the tutorial it’s a bit complicated to understand. Why? For this points:

  • What files I have to modify?

  • I have to create “mod_muc_status.lua”?

  • I have to modify the “mod_muc_size”?

  • What module I have to enable in /etc/prosody/conf.avail/mydomain.cfg.lua? “muc_status”? “muc_size”? both? any?

  • I have to do anything in /etc/prosody/conf.avail/localhost.cfg.lua?

Thanks