Greenlight: Batch room creation

Created on 18 Jul 2020  路  8Comments  路  Source: bigbluebutton/greenlight

Hello. For my school, I need to create many rooms for different classes. They need to be distinct so that each class has only one link that doesn't change. They can all be made under one user. I'm not so familiar with rails, but I looked at the database and I think I could run an SQl script to do what I'd like, recreating things like the UID strings would be a pain. There isn't a rake task for this, but as with #1800 I'm thinking that there might be a way to do so in the console. I've looked at the rooms controller code, but as I'm not familiar with ruby, I'm wondering I could be pointed in the right direction.

Also, if I work it out and want to create a rake task, would that be something you'd like to use?

Most helpful comment

There's also another way to do it.
docker exec -it greenlight-v2 bundle exec rails c
Find the room owners id:
User.find_by(email: "ROOM_OWNER_EMAIL").id
Create the room (change any fields you want):
Room.create(user_id: ID_FROM_ABOVE, name: "ROOM_NAME", room_settings: "{\"muteOnStart\":false,\"requireModeratorApproval\":false,\"anyoneCanStart\":false,\"joinModerator\":false}")

All 8 comments

There's also another way to do it.
docker exec -it greenlight-v2 bundle exec rails c
Find the room owners id:
User.find_by(email: "ROOM_OWNER_EMAIL").id
Create the room (change any fields you want):
Room.create(user_id: ID_FROM_ABOVE, name: "ROOM_NAME", room_settings: "{\"muteOnStart\":false,\"requireModeratorApproval\":false,\"anyoneCanStart\":false,\"joinModerator\":false}")

@farhatahmad 2 questions please:

  • Is it possible to add shared room parameters? I mean adding the users_ids which will have access to this room?

  • Would this workaround work to create users with Oauth credentials?

Is it possible to add shared room parameters? I mean adding the users_ids which will have access to this room?

Sure. After you create the Room and the User run this command
SharedAccess.create(room_id: ROOM_ID, user_id: USER_ID)

Is it possible to use this workaround to create users with Oauth credentials?

Nope. OAuth users require a unique ID that is passed from the OAuth provider to Greenlight, so unless you know them all (which you probably don't) then that won't be possible.

Sure. After you create the Room and the User run this command
SharedAccess.create(room_id: ROOM_ID, user_id: USER_ID)

Thank you SO MUCH for this information 馃檹

Nope. OAuth users require a unique ID that is passed from the OAuth provider to Greenlight, so unless you know them all (which you probably don't) then that won't be possible.

We do have all the OAuth - Google accounts passwords. Any chance to do it with these credentials?

We do have all the OAuth - Google accounts passwords. Any chance to do it with these credentials?

Nope. As I mentioned, it requires a unique internal ID from the OAuth provider that I don't believe you can get

There's also another way to do it.
docker exec -it greenlight-v2 bundle exec rails c
Find the room owners id:
User.find_by(email: "ROOM_OWNER_EMAIL").id
Create the room (change any fields you want):
Room.create(user_id: ID_FROM_ABOVE, name: "ROOM_NAME", room_settings: "{\"muteOnStart\":false,\"requireModeratorApproval\":false,\"anyoneCanStart\":false,\"joinModerator\":false}")

@farhatahmad Thanks so much! I think that's exactly what I need. I should be able to pull my list of rooms from a CSV and loop this command.

Check #1927
https://github.com/aau-zid/scheduLight

@ryprfpryr Thanks. I'll look into this more for the future, but I think for now, running another service is a little overkill for my needs.

@cbunn81 you can get the owners id's as a list with this ruby command:

ids = ['[email protected]','[email protected]','[email protected]'].map{ |u| User.where(email: u).ids }
puts ids

You will get the ID's output like this:

39
64
124

Was this page helpful?
0 / 5 - 0 ratings