Force Organisators to set Room-Passwords

Hey all,
We would like to add a prosody module to our self-hosted (Debian) jitsi-meet instance that forces the organizer of the room to set a password for the created room. I have found an approach in a similar topic (Persistent Passwords on Self Hosted Rooms) but I can’t get the approach to work. I’m creating a new post, because the discussion in the original thread has taken a different direction. This is my current status:

My module in /usr/share/jitsi-meet/prosody-plugins/mod_force_room_password.lua

module:hook("muc-room-pre-create", function(event)
        local pass = http.query.for.password for this event.room;
        event.room:set_password(pass);
end);

In /etc/prosody/conf.d/domain.cfg.lua i added:

-- we need bosh
        modules_enabled = {
            "force_room_password";
            "bosh";
            "pubsub";
            "ping"; -- Enable mod_ping
            "speakerstats";
            "turncredentials";
            "conference_duration";
        }

The /var/log/prosody/prosody.err log says:

modulemanager error Unable to load module ‘force_room_password’: …e/jitsi-meet/prosody-plugins/mod_force_room_password.lua:2: expected near ‘for’

Im running jitsi-meet on Debian 10 with secured domain.

I’d appreciate any thoughts you might have. Thanks!

1 Like

If you still have this in your code, then the module will not load.
You need to replace the http.query … part with your own logic to generate a password.

At least use a static value for the pwd.

local pass = „passw0rd“

Oh, the editor in this forum screws up the parentheses.

Thanks for your reply.

As you recommended I tried to set a static value for the room password and the error in the log disappeared.
My module in /usr/share/jitsi-meet/prosody-plugins/mod_force_room_password.lua is now:

module:hook("muc-room-pre-create", function(event)
        local pass = "secret";
        event.room:set_password(pass);
end);

When I create a room now the password is unfortunately not set. Do you have any idea what other things there might be to try?

1 Like

In etc/prosody/conf.d/domain.cfg.lua, you have to invoke the module in the Component conference. … instead of the virtual host.

2 Likes

Hi, @fellow12312

after hooking the module, jicofo is blocked.
net.java.sip.communicator.service.protocol.OperationFailedException: Failed to join the room

I don’t think this will work with a prosody module. If you set a password in the prosody backend automatically this will not even allow the organizer to change the password after joining the conference.

Instead, you will probably need GUI changes in the web-frontend such as an automatic pop-up prompting the organizer to set a password.

Hey, the module now loads.

Now I get another Error when creating the room.

In the web console the following error occurs:
2020-05-12T09:14:18.605Z [conference.js] <_onConferenceFailed>: CONFERENCE FAILED: conference.authenticationRequired

Could this be the same error @shooding noticed?

Hey. I’m new to jitsi and prosody so I tried an approach I noticed in Persistent Passwords on Self Hosted Rooms .
I also like to try out other approaches. Where can I implement such a GUI change. Do you have experience with changes in jitsi’s web-frontend?

Thanks for your reply!

I think we need to modify middleware.js
similar to the feature “requireDisplayName”

if (requireDisplayName
&& !getLocalParticipant(getState)?.name
&& !conference.isHidden()) {
dispatch(openDisplayNamePrompt(undefined));
}

and write another function like openSetPasswordPrompt() in action.js

i will install on your server with your logo icon and your branding at just 60$ .
If any one needed complete installation with customization and server at cheap price ping me.
ping me on skype my skype id is shashank.singh451. you can whatsapp me at +919953026723

You should post on websites like https://www.freelancer.com/jobs/?keyword=jitsi
not here

Hi.
My module now works. I changed the hook to “muc-room-created”.
Now I have a default password for all rooms that can be changed by the moderator.
Thanks for your input!
If anyone still has suggestions for improvement, let me know :slight_smile:

1 Like