All users are moderators on my server

Hello!

Please, help me configure my server. How can i configure to all user are moderators (like in meet.jit.si)? By default, only one user is moderator

Thank You

I think that the prosody module mod_muc_allowners is supposed to do that. I have no idea if it works with secure domain, though. I think not but I’m unsure. But if you have no authentication at all (as with meet.jit.si) it’s worth a try (that is add it to the modules in /etc/prosody/conf.avail/your.url.cfg.lua)

Thank You!

Yes, I have no authentication at all(as with meet.jit.si).

I tried add “mod_muc_allowners” in modules_enabled in file .cfg.lua
After that I restarted services jicofo, jitsi-videobridge2, prosody and nginx
But it has no effect. Only first user can moderate

Hi,

Seems like they have changed the mod_muc_allowners.lua implementation.

Here is the original code:

-- Copyright (c) 2015 &yet <https://andyet.com>
-- https://github.com/otalk/mod_muc_allowners/blob/9a86266a25ed32ade150742cc79f5a1669765a8f/mod_muc_allowners.lua
--
-- Used under the terms of the MIT License
--     https://github.com/otalk/mod_muc_allowners/blob/9a86266a25ed32ade150742cc79f5a1669765a8f/LICENSE

local muc_service = module:depends("muc");
local room_mt = muc_service.room_mt;


room_mt.get_affiliation = function (room, jid)
    return "owner";
end

Replace the code in /usr/share/jitsi-meet/prosody-plugins/mod_muc_allowners.lua

Regards,
Anthony

But that file has different code at /usr/share/jitsi-meet/prosody-plugins/mod_muc_allowners.lua :

local jid = require "util.jid";
local um_is_admin = require "core.usermanager".is_admin;
local is_healthcheck_room = module:require "util".is_healthcheck_room;

local moderated_subdomains;
local moderated_rooms;

local function load_config()
    moderated_subdomains = module:get_option_set("allowners_moderated_subdomains", {})
    moderated_rooms = module:get_option_set("allowners_moderated_rooms", {})
end
load_config();

local function is_admin(jid)
    return um_is_admin(jid, module.host);
end

-- Checks whether the jid is moderated, the room name is in moderated_rooms
-- or if the subdomain is in the moderated_subdomains
-- @return returns on of the:
--      -> false
--      -> true, room_name, subdomain
--      -> true, room_name, nil (if no subdomain is used for the room)
local function is_moderated(room_jid)
    local room_node = jid.node(room_jid);
    -- parses bare room address, for multidomain expected format is:
    -- [subdomain]roomName@conference.domain
    local target_subdomain, target_room_name = room_node:match("^%[([^%]]+)%](.+)$");

    if target_subdomain then
        if moderated_subdomains:contains(target_subdomain) then
            return true, target_room_name, target_subdomain;
        end
    elseif moderated_rooms:contains(room_node) then
        return true, room_node, nil;
    end

    return false;
end

module:hook("muc-occupant-joined", function (event)
    local room, occupant = event.room, event.occupant;

    if is_healthcheck_room(room.jid) or is_admin(occupant.jid) then
        return;
    end

    local moderated, room_name, subdomain = is_moderated(room.jid);
    if moderated then
        local session = event.origin;
        local token = session.auth_token;

        if not token then
            module:log('debug', 'skip allowners for non-auth user subdomain:%s room_name:%s', subdomain, room_name);
            return;
        end

        if not (room_name == session.jitsi_meet_room) then
            module:log('debug', 'skip allowners for auth user and non matching room name: %s, jwt room name: %s', room_name, session.jitsi_meet_room);
            return;
        end

        if not (subdomain == session.jitsi_meet_context_group) then
            module:log('debug', 'skip allowners for auth user and non matching room subdomain: %s, jwt subdomain: %s', subdomain, session.jitsi_meet_context_group);
            return;
        end
    end

    room:set_affiliation(true, occupant.bare_jid, "owner");
end, 2);

module:hook("muc-occupant-left", function (event)
    local room, occupant = event.room, event.occupant;

    if is_healthcheck_room(room.jid) then
        return;
    end

    room:set_affiliation(true, occupant.bare_jid, nil);
end, 2);

module:hook_global('config-reloaded', load_config);