How to i use muc_size module?

Hello world.

this is really weired. I read so many issue in jitsi community. So i tried everything about use muc_size module.

is there some perfect document about using muc_size?

my spec/

  • Ubuntu 18.10.1
  • Using Domain service for jitsi testmeme.jp

what i did

  • add module 'etc/prosody/conf.a/domain.cfg.lua ~ module_enabled “muc_size”
  • set storage value “none” to “storage”
  • update prosody version to 0.11 (cause of version error log on prosody.err)
  • delete ‘localhost.cfg.lua’ file (cause of permission error log on prosody.err)
  • i followed this step Statiscs = "just enable muc_size" - #23 by Korobox

Please answer how do i get about session when i request ‘mydomain.com/sessions

Thank for reading my question. have a nice day.

You need to proxy that request in your nginx config:

    location = /sessions {
        proxy_pass      http://localhost:5280/rsessions?domain=$http_host&subdomain=$prefix&$args;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
    }

Mind that this will make you impossible to use a room name sessions, also make sure you put this before the rule for rooms: jitsi-meet/jitsi-meet.example at 5ef60c3a7d6175169dec7fbb1e1aff729b2e3019 · jitsi/jitsi-meet · GitHub

Still not work.

Here is nginx error log

2021/01/14 05:04:14 [error] 25029#25029: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 115.92.254.154, server: u-server.jsim.kr, request: "GET /sessions HTTP/1.1", upstream: "http://127.0.0.1:5280/sessions?domain=u-server.jsim.kr&subdomain=&", host: "u-server.jsim.kr"

This is my nginx config

server {
    listen 80;
    listen [::]:80;
    server_name u-server.jsim.kr;

    location ^~ /.well-known/acme-challenge/ {
        default_type "text/plain";
        root         /usr/share/jitsi-meet;
    }
    location = /.well-known/acme-challenge/ {
        return 404;
    }
    location / {
        return 301 https://$host$request_uri;
    }
}
server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name u-server.jsim.kr;

    # Mozilla Guideline v5.4, nginx 1.17.7, OpenSSL 1.1.1d, intermediate configuration
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
    ssl_prefer_server_ciphers off;

    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:10m;  # about 40000 sessions
    ssl_session_tickets off;

    add_header Strict-Transport-Security "max-age=63072000" always;

    ssl_certificate /etc/letsencrypt/live/u-server.jsim.kr/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/u-server.jsim.kr/privkey.pem;

    root /usr/share/jitsi-meet;

    # ssi on with javascript for multidomain variables in config.js
    ssi on;
    ssi_types application/x-javascript application/javascript;

    index index.html index.htm;
    error_page 404 /static/404.html;

    gzip on;
    gzip_types text/plain text/css application/javascript application/json image/x-icon application/octet-stream application/wasm;
    gzip_vary on;
    gzip_proxied no-cache no-store private expired auth;
    gzip_min_length 512;

    location = /config.js {
        alias /etc/jitsi/meet/u-server.jsim.kr-config.js;
    }

    location = /sessions {
        proxy_pass      http://127.0.0.1:5280/sessions?domain=$http_host&subdomain=$prefix&$args;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
    }

    location = /external_api.js {
        alias /usr/share/jitsi-meet/libs/external_api.min.js;
    }


    # ensure all static content can always be found first
    location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
    {
        add_header 'Access-Control-Allow-Origin' '*';
        alias /usr/share/jitsi-meet/$1/$2;

        # cache all versioned files
        if ($arg_v) {
            expires 1y;
        }
    }

    # BOSH
    location = /http-bind {
        proxy_pass       http://localhost:5280/http-bind;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
    }

    # xmpp websockets
    location = /xmpp-websocket {
        proxy_pass http://127.0.0.1:5280/xmpp-websocket?prefix=$prefix&$args;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        tcp_nodelay on;
    }

    # colibri (JVB) websockets for jvb1
    location ~ ^/colibri-ws/default-id/(.*) {
        proxy_pass http://127.0.0.1:9090/colibri-ws/default-id/$1$is_args$args;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        tcp_nodelay on;
    }

    location ~ ^/([^/?&:'"]+)$ {
        try_files $uri @root_path;
    }

    location @root_path {
        rewrite ^/(.*)$ / break;
    }

    location ~ ^/([^/?&:'"]+)/config.js$
    {
        set $subdomain "$1.";
        set $subdir "$1/";

        alias /etc/jitsi/meet/u-server.jsim.kr-config.js;
    }
 # Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
    location ~ ^/([^/?&:'"]+)/(.*)$ {
        set $subdomain "$1.";
        set $subdir "$1/";
        rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
    }

    # BOSH for subdomains
    location ~ ^/([^/?&:'"]+)/http-bind {
        set $subdomain "$1.";
        set $subdir "$1/";
        set $prefix "$1";

        rewrite ^/(.*)$ /http-bind;
    }

    # websockets for subdomains
    location ~ ^/([^/?&:'"]+)/xmpp-websocket {
        set $subdomain "$1.";
        set $subdir "$1/";
        set $prefix "$1";

        rewrite ^/(.*)$ /xmpp-websocket;
    }
}

Could you tell me problem?

Does bosh and xmpp-websocket work?

how can i check that?

Any errors in the js console?

There is no js error. i use that on my web service.

I tried delete jitsi and reinstall and follow the your comment.

I response 404 error.

and prosody log

Jan 15 05:57:47 portmanager	error	Error binding encrypted port for https: No certificate present in SSL/TLS configuration for https port 5281
Jan 15 05:57:47 portmanager	error	Error binding encrypted port for https: No certificate present in SSL/TLS configuration for https port 5281
Jan 15 05:57:47 modulemanager	error	Error initializing module 'muc_size' on 'u-server.jsim.kr': /usr/lib/prosody/util/startup.lua:201: module 'net.url' not found:
	no field package.preload['net.url']
	no file '/usr/lib/prosody/net/url.lua'
	no file '/usr/local/share/lua/5.2/net/url.lua'
	no file '/usr/local/share/lua/5.2/net/url/init.lua'
	no file '/usr/local/lib/lua/5.2/net/url.lua'
	no file '/usr/local/lib/lua/5.2/net/url/init.lua'
	no file '/usr/share/lua/5.2/net/url.lua'
	no file '/usr/share/lua/5.2/net/url/init.lua'
	no file '/usr/lib/prosody/net/url.so'
	no file '/usr/local/lib/lua/5.2/net/url.so'
	no file '/usr/lib/x86_64-linux-gnu/lua/5.2/net/url.so'
	no file '/usr/lib/lua/5.2/net/url.so'
	no file '/usr/local/lib/lua/5.2/loadall.so'
	no file '/usr/lib/prosody/net.so'
	no file '/usr/local/lib/lua/5.2/net.so'
	no file '/usr/lib/x86_64-linux-gnu/lua/5.2/net.so'
	no file '/usr/lib/lua/5.2/net.so'
	no file '/usr/local/lib/lua/5.2/loadall.so'
stack traceback:
	[C]: in function '_real_require'
	/usr/lib/prosody/util/startup.lua:201: in function 'require'
	/usr/share/jitsi-meet/prosody-plugins/mod_muc_size.lua:20: in main chunk
	[C]: in function 'xpcall'
	/usr/lib/prosody/core/modulemanager.lua:183: in function 'do_load_module'
	/usr/lib/prosody/core/modulemanager.lua:261: in function 'load'
	/usr/lib/prosody/core/modulemanager.lua:83: in function '?'
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/core/hostmanager.lua:108: in function 'activate'
	/usr/lib/prosody/core/hostmanager.lua:58: in function '?'
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/util/startup.lua:393: in function 'prepare_to_start'
	/usr/lib/prosody/util/startup.lua:629: in function 'f'
	/usr/lib/prosody/util/async.lua:139: in function 'func'
	/usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>

What i did,

  • prosody access cors enable (for dev)
  • add module ‘muc_size’ on prosody my domain config
  • add nginx option what you comment above room rule. ( /sessions)

Thanks for the update and quick reply.