From cae882b00619c65c975ef1ab5838f0998ebaad63 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 3 May 2021 21:00:17 +0200 Subject: [PATCH] Update to 2021-05-03 21:00 --- roles/jitsi/defaults/main.yml | 63 ++++++++++++----------- roles/jitsi/handlers/main.yml | 2 + roles/jitsi/tasks/install.yml | 10 ++++ roles/jitsi/templates/mod_jibri_bypass_pwd.lua.j2 | 14 +++++ roles/jitsi/templates/prosody.cfg.lua.j2 | 5 +- roles/jitsi_jibri/tasks/install.yml | 1 + roles/prosody/files/mod_participant_metadata.lua | 53 +++++++++++++++++++ roles/repo_google_chrome/tasks/main.yml | 2 + 8 files changed, 118 insertions(+), 32 deletions(-) create mode 100644 roles/jitsi/templates/mod_jibri_bypass_pwd.lua.j2 create mode 100644 roles/prosody/files/mod_participant_metadata.lua diff --git a/roles/jitsi/defaults/main.yml b/roles/jitsi/defaults/main.yml index 5d07fa4..83d8981 100644 --- a/roles/jitsi/defaults/main.yml +++ b/roles/jitsi/defaults/main.yml @@ -76,6 +76,8 @@ jitsi_meet_conf_base: p2pTestMode: False enableNoAudioDetection: True enableNoisyMicDetection: False + startAudioMuted: 10 + maxFullResolutionParticipants: 4 desktopSharingChromeExtId: null desktopSharingChromeSources: - screen @@ -84,9 +86,8 @@ jitsi_meet_conf_base: desktopSharingChromeMinExtVersion: 0.1 channelLastN: -1 requireDisplayName: False - resolution: 480 enableLayerSuspension: True - enableCalendarIntegration: False + prejoinPageEnabled: True disableThirdPartyRequests: True enableWelcomePage: True useStunTurn: True @@ -131,35 +132,35 @@ jitsi_meet_interface_conf_base: INVITATION_POWERED_BY: True LANG_DETECTION: True AUTHENTICATION_ENABLE: True - TOOLBAR_BUTTONS: - - microphone - - camera - - closedcaptions - - desktop - - embedmeeting - - fullscreen - - fodeviceselection - - hangup - - profile - - chat - - recording - #- livestreaming - - etherpad - - sharedvideo - - settings - - raisehand - - videoquality - - filmstrip - - invite - - feedback - - stats - - shortcuts - - tileview - - videobackgroundblur - - download - - help - - mute-everyone - - security +# TOOLBAR_BUTTONS: +# - microphone +# - camera +# - closedcaptions +# - desktop +# - embedmeeting +# - fullscreen +# - fodeviceselection +# - hangup +# - profile +# - chat +# - recording +# #- livestreaming +# - etherpad +# - sharedvideo +# - settings +# - raisehand +# - videoquality +# - filmstrip +# - invite +# - feedback +# - stats +# - shortcuts +# - tileview +# - videobackgroundblur +# - download +# - help +# - mute-everyone +# - security SETTINGS_SECTIONS: - devices - language diff --git a/roles/jitsi/handlers/main.yml b/roles/jitsi/handlers/main.yml index 973afd9..4df1cfc 100644 --- a/roles/jitsi/handlers/main.yml +++ b/roles/jitsi/handlers/main.yml @@ -1,5 +1,7 @@ --- +- include: ../prosody/handlers/main.yml + - name: restart jitsi-videobridge service: name=jitsi-videobridge state=restarted diff --git a/roles/jitsi/tasks/install.yml b/roles/jitsi/tasks/install.yml index f1ab3d0..2bb57d5 100644 --- a/roles/jitsi/tasks/install.yml +++ b/roles/jitsi/tasks/install.yml @@ -170,3 +170,13 @@ mode: 0755 notify: restart jitsi-confmapper tags: jitsi + +- name: Ensure prosody module dir exists + file: path=/opt/prosody/modules/ state=directory + tags: jitsi + +- name: Install byass_pwd module for prosody + template: src=mod_jibri_bypass_pwd.lua.j2 dest=/opt/prosody/modules/mod_jibri_bypass_pwd.lua + notify: reload prosody + tags: jitsi + diff --git a/roles/jitsi/templates/mod_jibri_bypass_pwd.lua.j2 b/roles/jitsi/templates/mod_jibri_bypass_pwd.lua.j2 new file mode 100644 index 0000000..e7de6a4 --- /dev/null +++ b/roles/jitsi/templates/mod_jibri_bypass_pwd.lua.j2 @@ -0,0 +1,14 @@ +local MUC_NS = "http://jabber.org/protocol/muc"; +local jid = require "util.jid"; + +module:hook("muc-occupant-pre-join", function (event) + local room, stanza = event.room, event.stanza; + + local user, domain, res = jid.split(event.stanza.attr.from); + log("info", "--------------> user %s domain %s res %s pass %s", tostring(user),tostring(domain),tostring(res),tostring(room:get_password())); + + if ( user == '{{ jitsi_jibri_recorder_xmpp_user }}' and domain == '{{ jitsi_jibri_xmpp_domain }}' ) then + local join = stanza:get_child("x", MUC_NS); + join:tag("password", { xmlns = MUC_NS }):text(room:get_password()); + end; +end); diff --git a/roles/jitsi/templates/prosody.cfg.lua.j2 b/roles/jitsi/templates/prosody.cfg.lua.j2 index 7477416..50ab5a3 100644 --- a/roles/jitsi/templates/prosody.cfg.lua.j2 +++ b/roles/jitsi/templates/prosody.cfg.lua.j2 @@ -90,7 +90,10 @@ VirtualHost "recorder.{{ jitsi_domain }}" Component "conference.{{ jitsi_domain }}" "muc" storage = "memory" - modules_enabled = { "ping"; } + modules_enabled = { + "ping"; + "jibri_bypass_pwd"; + } muc_room_locking = false muc_room_default_public_jids = true diff --git a/roles/jitsi_jibri/tasks/install.yml b/roles/jitsi_jibri/tasks/install.yml index db76772..4c34f15 100644 --- a/roles/jitsi_jibri/tasks/install.yml +++ b/roles/jitsi_jibri/tasks/install.yml @@ -91,3 +91,4 @@ - name: Install record cleaning script template: src=clean_records.sh.j2 dest={{ jitsi_root_dir }}/jibri/clean_records.sh mode=755 tags: jitsi + diff --git a/roles/prosody/files/mod_participant_metadata.lua b/roles/prosody/files/mod_participant_metadata.lua new file mode 100644 index 0000000..40fb6f4 --- /dev/null +++ b/roles/prosody/files/mod_participant_metadata.lua @@ -0,0 +1,53 @@ +local _jid = require "util.jid"; + +log('info', 'Loaded Custom Presence identity'); + +module:hook("pre-presence/full", function (event) + + local function get_room_from_jid(jid) + local node, host = _jid.split(jid); + local component = hosts[host]; + + if component then + local muc = component.modules.muc + if muc and rawget(muc,"rooms") then + -- We're running 0.9.x or 0.10 (old MUC API) + return muc.rooms[jid]; + elseif muc and rawget(muc,"get_room_from_jid") then + -- We're running >0.10 (new MUC API) + return muc.get_room_from_jid(jid); + else + return + end + end + end + + local origin, stanza = event.origin, event.stanza; + local to = _jid.bare(stanza.attr.to); + + if get_room_from_jid(to) then + local room = get_room_from_jid(to); + local occupant = room._occupants[tostring(stanza.attr.to)]; + + if occupant then + local email = stanza:get_child_text("email") or ""; + local role = tostring(occupant.role); + + if email ~= "" and role == "moderator" then + stanza:maptags( + function(tag) + for k, v in pairs(tag) do + if k == "name" and v == "identity" then + return nil + end + end + return tag + end) + + stanza:tag("identity"):tag("user"); + stanza:tag("id"):text(email):up(); + stanza:up(); + end + end + end +end); diff --git a/roles/repo_google_chrome/tasks/main.yml b/roles/repo_google_chrome/tasks/main.yml index afba0fb..a0332b1 100644 --- a/roles/repo_google_chrome/tasks/main.yml +++ b/roles/repo_google_chrome/tasks/main.yml @@ -5,5 +5,7 @@ name: google-chrome description: "Google Chrome Stable" baseurl: http://dl.google.com/linux/chrome/rpm/stable/x86_64 + gpgkey: https://dl.google.com/linux/linux_signing_key.pub gpgcheck: True + tags: repo