From b2cc6814e83b21eeea7d5c406cd131263045a828 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 30 Sep 2020 22:49:38 +0900 Subject: [PATCH 01/59] Update en.yml --- config/locales/en.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index a7531e3320..ae21c5ba60 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -298,6 +298,7 @@ en: video: Watch our tutorial on using Greenlight upgrade: Show me how to upgrade to 2.0! version: We've released a new version of Greenlight, but your database isn't compatible. + enterid: Enter the room ID language_default: Default (browser language) ldap_error: Unable to connect to the LDAP server. Please check your LDAP configuration in the env file and ensure your server is running. login: Sign in From d7df94ad80956671aa3ef42155c447754a3b8939 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 30 Sep 2020 22:53:20 +0900 Subject: [PATCH 02/59] Update index.html.erb --- app/views/main/index.html.erb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index d33db5be95..0a7f52aec7 100755 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -18,6 +18,32 @@

<%= t("landing.welcome").html_safe %>

+
+
+

<%= t("landing.enterid") %>

+
+
+
+
+ + + + onclick="Jump();" class="btn btn-primary btn-sm px-7 form-control join-form"> + +
+
+
+
+
+ + +

<%= t("landing.about", href: link_to(t("greenlight"), "https://bigbluebutton.org/2018/07/09/greenlight-2-0/", target: "_blank", rel: "noopener")).html_safe %>

<%= link_to "https://youtu.be/Hso8yLzkqj8", target: "_blank" do %>

<%= t("landing.video") %>

From aa6df2be27d3cf169a744714685f4b58611054e6 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Thu, 1 Oct 2020 08:10:26 +0900 Subject: [PATCH 03/59] Update index.html.erb --- app/views/main/index.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 0a7f52aec7..b97c31408c 100755 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -39,7 +39,8 @@ From 8a8f295bf023b1d7d92e0e46aced2e37e197fced Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Tue, 6 Oct 2020 18:43:23 +0900 Subject: [PATCH 04/59] Update index.html.erb --- app/views/main/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index b97c31408c..7a7d1f9b88 100755 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -23,12 +23,12 @@

<%= t("landing.enterid") %>

-
+
- onclick="Jump();" class="btn btn-primary btn-sm px-7 form-control join-form"> + onclick="Jump()" class="btn btn-primary btn-sm px-7 form-control join-form">
From 305752bca908d3b4bb442694aba55a3c37eb4fe6 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Tue, 6 Oct 2020 19:22:55 +0900 Subject: [PATCH 05/59] Update index.html.erb --- app/views/main/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 7a7d1f9b88..b97c31408c 100755 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -23,12 +23,12 @@

<%= t("landing.enterid") %>

-
+
- onclick="Jump()" class="btn btn-primary btn-sm px-7 form-control join-form"> + onclick="Jump();" class="btn btn-primary btn-sm px-7 form-control join-form">
From efee520d2c976e128ceb80632d737ffcd37f9b23 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Tue, 6 Oct 2020 22:11:15 +0900 Subject: [PATCH 06/59] Update index.html.erb --- app/views/main/index.html.erb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index b97c31408c..8f3c5aefa7 100755 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -23,12 +23,11 @@

<%= t("landing.enterid") %>

-
+
- - onclick="Jump();" class="btn btn-primary btn-sm px-7 form-control join-form"> + class="btn btn-primary btn-sm px-7 form-control join-form">
From 2f1b7ef07a45242bc2802bd5d2593429f8de7ad5 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Tue, 6 Oct 2020 22:17:13 +0900 Subject: [PATCH 07/59] Update index.html.erb --- app/views/main/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 8f3c5aefa7..21d4560f52 100755 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -41,7 +41,7 @@ var rid = document.myForm.mID.value.replace(/-/g,'').replace(/(...)(?!$)/g, '$1-'); location.href = b + rid; return; - } + }

<%= t("landing.about", href: link_to(t("greenlight"), "https://bigbluebutton.org/2018/07/09/greenlight-2-0/", target: "_blank", rel: "noopener")).html_safe %>

From 23d48d3a87e22d81272912f790b5305d2480bb4b Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Tue, 24 Nov 2020 21:46:15 +0900 Subject: [PATCH 08/59] Update bbb_server.rb --- app/controllers/concerns/bbb_server.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index 81d70ab634..d2ff3ac238 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -54,6 +54,7 @@ def join_path(room, name, options = {}, uid = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true + join_opts[:avatarURL] = current_user.image bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) end From ca979aadae17fd4eadec93a7479ab19f0942b745 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 25 Nov 2020 21:10:05 +0900 Subject: [PATCH 09/59] Update bbb_server.rb --- app/controllers/concerns/bbb_server.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index d2ff3ac238..2dfffe9d0b 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -54,7 +54,9 @@ def join_path(room, name, options = {}, uid = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true - join_opts[:avatarURL] = current_user.image + if current_user + join_opts[:avatarURL] = current_user.image + end bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) end From 5bf0b6bdec626e6caddd56b8fffb2cb29ddac4fb Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Tue, 2 Feb 2021 07:59:45 +0900 Subject: [PATCH 10/59] Update en.yml --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index ae21c5ba60..2100befd97 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -298,7 +298,7 @@ en: video: Watch our tutorial on using Greenlight upgrade: Show me how to upgrade to 2.0! version: We've released a new version of Greenlight, but your database isn't compatible. - enterid: Enter the room ID + enterid: Enter a room ID language_default: Default (browser language) ldap_error: Unable to connect to the LDAP server. Please check your LDAP configuration in the env file and ensure your server is running. login: Sign in From c750114ab708c8f5d74aef24f191bcd3d0977185 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 7 Apr 2021 08:32:33 +0900 Subject: [PATCH 11/59] showing user avatar To make sure something unexpected happens --- app/controllers/concerns/bbb_server.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index 6d8204520e..7118879db4 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -54,9 +54,7 @@ def join_path(room, name, options = {}, uid = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true - if current_user - join_opts[:avatarURL] = current_user.image - end + join_opts[:avatarURL] = current_user.image if current_user && current_user.image.present? join_opts[:createTime] = room.last_session.to_datetime.strftime("%Q") bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) From 5d775f854935155bb8a69f8dd99c53c662c075b2 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 7 Apr 2021 08:42:35 +0900 Subject: [PATCH 12/59] revert if current_user due to the undefined error --- app/controllers/concerns/bbb_server.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index 7118879db4..ad605ce67b 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -54,7 +54,9 @@ def join_path(room, name, options = {}, uid = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true - join_opts[:avatarURL] = current_user.image if current_user && current_user.image.present? + if current_user + join_opts[:avatarURL] = current_user.image if current_user.image.present? + end join_opts[:createTime] = room.last_session.to_datetime.strftime("%Q") bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) From a42c8e4683af4df4f766ca3663beec80f9b6d630 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 7 Apr 2021 08:58:08 +0900 Subject: [PATCH 13/59] Update bbb_server.rb 'if current_user' should not have problem, but rubocop complains... --- app/controllers/concerns/bbb_server.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index ad605ce67b..a20199657a 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -54,9 +54,7 @@ def join_path(room, name, options = {}, uid = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true - if current_user - join_opts[:avatarURL] = current_user.image if current_user.image.present? - end + join_opts[:avatarURL] = current_user.image if (defined? current_user) && current_user.image.present? join_opts[:createTime] = room.last_session.to_datetime.strftime("%Q") bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) From 7b236d88fc23b1ad7ee07c7c51abf830fa0ea556 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 7 Apr 2021 09:34:56 +0900 Subject: [PATCH 14/59] Update bbb_server.rb --- app/controllers/concerns/bbb_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index a20199657a..7118879db4 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -54,7 +54,7 @@ def join_path(room, name, options = {}, uid = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true - join_opts[:avatarURL] = current_user.image if (defined? current_user) && current_user.image.present? + join_opts[:avatarURL] = current_user.image if current_user && current_user.image.present? join_opts[:createTime] = room.last_session.to_datetime.strftime("%Q") bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) From 26a112581d37b27e9e91fead91f7d852052d3f56 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 7 Apr 2021 10:56:51 +0900 Subject: [PATCH 15/59] Update _public_recording_row.html.erb --- .../components/_public_recording_row.html.erb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/views/shared/components/_public_recording_row.html.erb b/app/views/shared/components/_public_recording_row.html.erb index 1daa2f28bf..5a619f4a21 100644 --- a/app/views/shared/components/_public_recording_row.html.erb +++ b/app/views/shared/components/_public_recording_row.html.erb @@ -31,12 +31,18 @@ <% if recording_thumbnails? %> - <% p = recording[:playbacks].find do |p| p.key?(:preview) end %> - <% if p %> - <% safe_recording_images(p[:preview][:images][:image]).each do |img| %> - <%= image_tag(img[:content].strip, class: "thumbnail px-2") %> - <% end %> + <% if id_p = recording[:playbacks].find_index{|p| p[:type]=="presentation"} %> + <% end %> + <% p = recording[:playbacks].find do |p| p.key?(:preview) end %> + <% if p %> + <% safe_recording_images(p[:preview][:images][:image]).each do |img| %> + <%= image_tag(img[:content].strip, class: "thumbnail px-2") %> + <% end %> + <% end %> + <% if id_p %> + + <% end %> <% end %> From c753250bf193f9307c14504813564932736be29a Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 7 Apr 2021 11:01:23 +0900 Subject: [PATCH 16/59] selectable thumbnails --- .../shared/components/_recording_row.html.erb | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/app/views/shared/components/_recording_row.html.erb b/app/views/shared/components/_recording_row.html.erb index 9efe062a05..f519590b92 100644 --- a/app/views/shared/components/_recording_row.html.erb +++ b/app/views/shared/components/_recording_row.html.erb @@ -33,9 +33,29 @@ <% if recording_thumbnails? %> <% p = recording[:playbacks].find do |p| p.key?(:preview) end %> - <% if p %> - <% safe_recording_images(p[:preview][:images][:image]).each do |img| %> - <%= image_tag(img[:content].strip, class: "thumbnail px-2") %> + <% if p %> + <% imagesel = if recording[:metadata][:imagesel]; recording[:metadata][:imagesel].split(/-/).collect{|x| x.to_i} else [0,1,2] end %> + <% if p[:preview][:images][:image] %> + <% imagesel.collect{|i| safe_recording_images(p[:preview][:images][:image])[i]}.each_with_index do |img, imgidxdsp| %> + <% if img %> + + <% end %> + <% end %> <% end %> <% end %> From 49508bb277233df5edb6eb4ed3e7ac4b97269860 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 7 Apr 2021 11:08:01 +0900 Subject: [PATCH 17/59] selected thumbnails --- .../shared/components/_public_recording_row.html.erb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/shared/components/_public_recording_row.html.erb b/app/views/shared/components/_public_recording_row.html.erb index 5a619f4a21..e7ece9d714 100644 --- a/app/views/shared/components/_public_recording_row.html.erb +++ b/app/views/shared/components/_public_recording_row.html.erb @@ -36,8 +36,13 @@ <% end %> <% p = recording[:playbacks].find do |p| p.key?(:preview) end %> <% if p %> - <% safe_recording_images(p[:preview][:images][:image]).each do |img| %> - <%= image_tag(img[:content].strip, class: "thumbnail px-2") %> + <% imagesel = if recording[:metadata][:imagesel]; recording[:metadata][:imagesel].split("-").collect{|x| x.to_i} else [0,1,2] end %> + <% if p[:preview][:images][:image] %> + <% imagesel.collect{|i| safe_recording_images(p[:preview][:images][:image])[i]}.each do |img| %> + <% if img %> + <%= image_tag(img[:content].strip, class: "thumbnail px-2") %> + <% end %> + <% end %> <% end %> <% end %> <% if id_p %> From 9ddcfcf2699f1121f76e6fd5fae2a90f4633f7ae Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 7 Apr 2021 11:11:17 +0900 Subject: [PATCH 18/59] thumbnail update --- app/controllers/recordings_controller.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/recordings_controller.rb b/app/controllers/recordings_controller.rb index 93912b4679..3854c2e4df 100644 --- a/app/controllers/recordings_controller.rb +++ b/app/controllers/recordings_controller.rb @@ -24,9 +24,12 @@ class RecordingsController < ApplicationController # POST /:meetingID/:record_id def update - meta = { - "meta_#{META_LISTED}" => (params[:state] == "public"), - } + meta = {} + if params[:state] + meta["meta_#{META_LISTED}"] = (params[:state] == "public") + elsif params[:thumbnails] + meta["meta_imagesel"] = params[:thumbnails] + end res = update_recording(params[:record_id], meta) From ceeb25da0649c53734fccd408ef40c3b64dcd87f Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Wed, 7 Apr 2021 11:15:48 +0900 Subject: [PATCH 19/59] Update _recording_row.html.erb --- app/views/shared/components/_recording_row.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/components/_recording_row.html.erb b/app/views/shared/components/_recording_row.html.erb index f519590b92..db5b4d2a7d 100644 --- a/app/views/shared/components/_recording_row.html.erb +++ b/app/views/shared/components/_recording_row.html.erb @@ -52,8 +52,8 @@ <% end %> <% end %> +
- <% end %> <% end %> <% end %> From 3971a08656810e0eb9991bf0e08dc2551fbbe6b0 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Sun, 18 Apr 2021 10:26:24 +0900 Subject: [PATCH 20/59] add an option to avatar image --- app/controllers/rooms_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 2de6aac642..0882886811 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -182,7 +182,7 @@ def start opts[:record] = record_meeting begin - redirect_to join_path(@room, current_user.name, opts, current_user.uid) + redirect_to join_path(@room, current_user.name, opts, current_user.uid, current_user.image) rescue BigBlueButton::BigBlueButtonException => e logger.error("Support: #{@room.uid} start failed: #{e}") From 11079ed987a2ea57e69128da2d0410472afac37f Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Sun, 18 Apr 2021 10:27:33 +0900 Subject: [PATCH 21/59] Add an option to avatar image --- app/controllers/concerns/joiner.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 6c6b016e0b..7ca106f054 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -60,11 +60,11 @@ def join_room(opts) opts[:mute_on_start] = room_setting_with_config("muteOnStart") if current_user - redirect_to join_path(@room, current_user.name, opts, current_user.uid) + redirect_to join_path(@room, current_user.name, opts, current_user.uid, current_user.image) else join_name = params[:join_name] || params[@room.invite_path][:join_name] - redirect_to join_path(@room, join_name, opts, fetch_guest_id) + redirect_to join_path(@room, join_name, opts, fetch_guest_id, nil) end else search_params = params[@room.invite_path] || params From 5d24e8f403f2cdc93948daa1c021d6b5b4f02b4d Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Sun, 18 Apr 2021 10:29:18 +0900 Subject: [PATCH 22/59] add an option avatar_image --- app/controllers/concerns/bbb_server.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index 7118879db4..f25c84d020 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -43,7 +43,7 @@ def get_multiple_recordings(meeting_ids) end # Returns a URL to join a user into a meeting. - def join_path(room, name, options = {}, uid = nil) + def join_path(room, name, options = {}, uid = nil, avatar_image = nil) # Create the meeting, even if it's running start_session(room, options) @@ -54,7 +54,7 @@ def join_path(room, name, options = {}, uid = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true - join_opts[:avatarURL] = current_user.image if current_user && current_user.image.present? + join_opts[:avatarURL] = avatar_image if avatar_image.present? join_opts[:createTime] = room.last_session.to_datetime.strftime("%Q") bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) From 5b3f0602ef18f66e3afdf122bb17020f9a64d931 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 19 Apr 2021 10:41:27 +0900 Subject: [PATCH 23/59] Update rooms_controller.rb --- app/controllers/rooms_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 0882886811..6fb7aac56c 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -180,9 +180,10 @@ def start opts[:mute_on_start] = room_setting_with_config("muteOnStart") opts[:require_moderator_approval] = room_setting_with_config("requireModeratorApproval") opts[:record] = record_meeting + opts[:avatarURL] = current_user.image if current_user.image.present? begin - redirect_to join_path(@room, current_user.name, opts, current_user.uid, current_user.image) + redirect_to join_path(@room, current_user.name, opts, current_user.uid) rescue BigBlueButton::BigBlueButtonException => e logger.error("Support: #{@room.uid} start failed: #{e}") From 4f7fa4fe3417a92e3f6e638ea5f2ac8bda288498 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 19 Apr 2021 10:42:59 +0900 Subject: [PATCH 24/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 7ca106f054..61d777191f 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -60,7 +60,8 @@ def join_room(opts) opts[:mute_on_start] = room_setting_with_config("muteOnStart") if current_user - redirect_to join_path(@room, current_user.name, opts, current_user.uid, current_user.image) + opts[:avatarURL] = current_user.image if current_user.image.present? + redirect_to join_path(@room, current_user.name, opts, current_user.uid) else join_name = params[:join_name] || params[@room.invite_path][:join_name] From ee928b63aaba225f95ae9148e29107753ab77495 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 19 Apr 2021 10:46:33 +0900 Subject: [PATCH 25/59] Update bbb_server.rb --- app/controllers/concerns/bbb_server.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index f25c84d020..3fbcb3c17d 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -43,7 +43,7 @@ def get_multiple_recordings(meeting_ids) end # Returns a URL to join a user into a meeting. - def join_path(room, name, options = {}, uid = nil, avatar_image = nil) + def join_path(room, name, options = {}, uid = nil) # Create the meeting, even if it's running start_session(room, options) @@ -54,7 +54,7 @@ def join_path(room, name, options = {}, uid = nil, avatar_image = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true - join_opts[:avatarURL] = avatar_image if avatar_image.present? + join_opts[:avatarURL] = options[:avatarURL] if options[:avatarURL].present? join_opts[:createTime] = room.last_session.to_datetime.strftime("%Q") bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) From d5bd9ffa4efef696926a3b01b10eb72709e92486 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 19 Apr 2021 10:48:47 +0900 Subject: [PATCH 26/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 61d777191f..4aaa78b906 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -64,8 +64,7 @@ def join_room(opts) redirect_to join_path(@room, current_user.name, opts, current_user.uid) else join_name = params[:join_name] || params[@room.invite_path][:join_name] - - redirect_to join_path(@room, join_name, opts, fetch_guest_id, nil) + redirect_to join_path(@room, join_name, opts, fetch_guest_id) end else search_params = params[@room.invite_path] || params From 701950d8253f1c2a7315eb97a6f4d7b5d5cb40f9 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 19 Apr 2021 10:54:08 +0900 Subject: [PATCH 27/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 4aaa78b906..610cf67145 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -60,7 +60,7 @@ def join_room(opts) opts[:mute_on_start] = room_setting_with_config("muteOnStart") if current_user - opts[:avatarURL] = current_user.image if current_user.image.present? + opts[:avatarURL] = current_user.image redirect_to join_path(@room, current_user.name, opts, current_user.uid) else join_name = params[:join_name] || params[@room.invite_path][:join_name] From 06f95f91a80cb8173779d68a0c6107158865c4d7 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 19 Apr 2021 10:54:58 +0900 Subject: [PATCH 28/59] Update rooms_controller.rb --- app/controllers/rooms_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 6fb7aac56c..f72a7571ae 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -180,7 +180,7 @@ def start opts[:mute_on_start] = room_setting_with_config("muteOnStart") opts[:require_moderator_approval] = room_setting_with_config("requireModeratorApproval") opts[:record] = record_meeting - opts[:avatarURL] = current_user.image if current_user.image.present? + opts[:avatarURL] = current_user.image begin redirect_to join_path(@room, current_user.name, opts, current_user.uid) From 1835a6da960a5a9bc2a20ca4f5f0a549fb7e2cb9 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 19 Apr 2021 11:08:18 +0900 Subject: [PATCH 29/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 610cf67145..6de09a474a 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -64,6 +64,7 @@ def join_room(opts) redirect_to join_path(@room, current_user.name, opts, current_user.uid) else join_name = params[:join_name] || params[@room.invite_path][:join_name] + redirect_to join_path(@room, join_name, opts, fetch_guest_id) end else From 31d4104039d2ef06b2de9ad3ff24141ebf492c9b Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:51:29 +0900 Subject: [PATCH 30/59] Update sample.env --- sample.env | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sample.env b/sample.env index 0bb3396636..ada2638e03 100644 --- a/sample.env +++ b/sample.env @@ -356,3 +356,6 @@ DEFAULT_REGISTRATION=open # For details, see: https://github.com/puma/puma#clustered-mode # Default: 1 #WEB_CONCURRENCY=1 + +# Avatar image size limit (bytes) +AVATAR_SIZE_LIMIT=50000 From 43a9a57e6ef76da8071b325961afddd254a422c7 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:53:36 +0900 Subject: [PATCH 31/59] Update application_helper.rb --- app/helpers/application_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6e752d0bd0..bda10748bd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -114,6 +114,14 @@ def valid_url?(input) false end + def url_size(url) + uri = URI(url) + http = Net::HTTP.new(uri.host, uri.port) + http.use_ssl = true if uri.scheme == 'https' + response = http.request_head(uri) + return response['content-length'].to_i + end + # Specifies which title should be the tab title and returns original string def title(page_title) # Only set the content_for if not already set on the page so that only the first title appears as the tab title From d961127df6aba29abd25ec166bace36da48e4b13 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:55:45 +0900 Subject: [PATCH 32/59] Update rooms_controller.rb --- app/controllers/rooms_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 3f5a7328ec..73ab5cd907 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -21,6 +21,7 @@ class RoomsController < ApplicationController include Recorder include Joiner include Populator + include ApplicationHelper before_action :validate_accepted_terms, unless: -> { !Rails.configuration.terms } before_action :validate_verified_email, except: [:show, :join], @@ -180,6 +181,7 @@ def start opts[:mute_on_start] = room_setting_with_config("muteOnStart") opts[:require_moderator_approval] = room_setting_with_config("requireModeratorApproval") opts[:record] = record_meeting + opts[:avatarURL_size] = url_size(current_user.image) opts[:avatarURL] = current_user.image begin From 481830326b25dfbc70f187032c75011707ce136c Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:57:18 +0900 Subject: [PATCH 33/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 4157e37996..f1073fac46 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -18,6 +18,7 @@ module Joiner extend ActiveSupport::Concern + include ApplicationHelper # Displays the join room page to the user def show_user_join @@ -60,6 +61,7 @@ def join_room(opts) opts[:mute_on_start] = room_setting_with_config("muteOnStart") if current_user + opts[:avatarURL_size] = url_size(current_user.image); opts[:avatarURL] = current_user.image redirect_to join_path(@room, current_user.name, opts, current_user.uid) else From 19f5d727ed45cf3027d9de1289f1205a758624a8 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:59:46 +0900 Subject: [PATCH 34/59] Update bbb_server.rb --- app/controllers/concerns/bbb_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index 1346f187ff..604d6046e8 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -54,7 +54,7 @@ def join_path(room, name, options = {}, uid = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true - join_opts[:avatarURL] = options[:avatarURL] if options[:avatarURL].present? + join_opts[:avatarURL] = options[:avatarURL] if options[:avatarURL].present? && options[:avatarURL_size] < ENV['AVATAR_SIZE_LIMIT'].to_i join_opts[:createTime] = room.last_session.to_datetime.strftime("%Q") if room.last_session bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) From 6430f626b5f9bbbf10fc3f812d5b57f77f38c481 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 2 Aug 2021 14:42:46 +0900 Subject: [PATCH 35/59] Update application_helper.rb Add a check if the URL is valid. --- app/helpers/application_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bda10748bd..1d0a4b8165 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -115,6 +115,7 @@ def valid_url?(input) end def url_size(url) + return 0 if URI.regexp.match(url).nil? uri = URI(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if uri.scheme == 'https' From 703575c02960dcf96d59f97a686eccdaac478606 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 14:36:07 +0900 Subject: [PATCH 36/59] double the limit --- sample.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample.env b/sample.env index ada2638e03..f61f6025f6 100644 --- a/sample.env +++ b/sample.env @@ -358,4 +358,4 @@ DEFAULT_REGISTRATION=open #WEB_CONCURRENCY=1 # Avatar image size limit (bytes) -AVATAR_SIZE_LIMIT=50000 +AVATAR_SIZE_LIMIT=100000 From 1fd0a8ef31e895214652c7d6264afca1b86aa3ac Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:11:03 +0900 Subject: [PATCH 37/59] move the judgement to controller --- app/controllers/concerns/bbb_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/bbb_server.rb b/app/controllers/concerns/bbb_server.rb index 604d6046e8..1346f187ff 100644 --- a/app/controllers/concerns/bbb_server.rb +++ b/app/controllers/concerns/bbb_server.rb @@ -54,7 +54,7 @@ def join_path(room, name, options = {}, uid = nil) join_opts = {} join_opts[:userID] = uid if uid join_opts[:join_via_html5] = true - join_opts[:avatarURL] = options[:avatarURL] if options[:avatarURL].present? && options[:avatarURL_size] < ENV['AVATAR_SIZE_LIMIT'].to_i + join_opts[:avatarURL] = options[:avatarURL] if options[:avatarURL].present? join_opts[:createTime] = room.last_session.to_datetime.strftime("%Q") if room.last_session bbb_server.join_meeting_url(room.bbb_id, name, password, join_opts) From d50ff03f9b4e7a168777b8dac96c7ee44d8e00f9 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:11:35 +0900 Subject: [PATCH 38/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index f1073fac46..46b0c78ef8 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -18,7 +18,6 @@ module Joiner extend ActiveSupport::Concern - include ApplicationHelper # Displays the join room page to the user def show_user_join From cb08dc6eb3f8797c8d7149cd9442bccc5d309f01 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:12:15 +0900 Subject: [PATCH 39/59] Update rooms_controller.rb --- app/controllers/rooms_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 9b1b4f4166..538e94bc1c 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -21,7 +21,6 @@ class RoomsController < ApplicationController include Recorder include Joiner include Populator - include ApplicationHelper before_action :validate_accepted_terms, unless: -> { !Rails.configuration.terms } before_action :validate_verified_email, except: [:show, :join], From beaee5f637f95a6c42ec365376cfb322db40f599 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:13:09 +0900 Subject: [PATCH 40/59] Update application_helper.rb --- app/helpers/application_helper.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1d0a4b8165..7971acfb77 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -113,15 +113,6 @@ def valid_url?(input) rescue false end - - def url_size(url) - return 0 if URI.regexp.match(url).nil? - uri = URI(url) - http = Net::HTTP.new(uri.host, uri.port) - http.use_ssl = true if uri.scheme == 'https' - response = http.request_head(uri) - return response['content-length'].to_i - end # Specifies which title should be the tab title and returns original string def title(page_title) From db76207b3c61021c33e7eb5e54c43328752907e7 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:15:28 +0900 Subject: [PATCH 41/59] Update rooms_controller.rb --- app/controllers/rooms_controller.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 538e94bc1c..83c9c86141 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -167,6 +167,15 @@ def join_specific_room redirect_to room_path(@room) end + def valid_avatar?(url) + return false if URI.regexp.match(url).nil? + uri = URI(url) + http = Net::HTTP.new(uri.host, uri.port) + http.use_ssl = true if uri.scheme == 'https' + response = http.request_head(uri) + return response['content-length'].to_i < Rails.configuration.max_avatar_size + end + # POST /:room_uid/start def start logger.info "Support: #{current_user.email} is starting room #{@room.uid}" @@ -180,8 +189,7 @@ def start opts[:mute_on_start] = room_setting_with_config("muteOnStart") opts[:require_moderator_approval] = room_setting_with_config("requireModeratorApproval") opts[:record] = record_meeting - opts[:avatarURL_size] = url_size(current_user.image) - opts[:avatarURL] = current_user.image + opts[:avatarURL] = current_user.image if current_user.image.present? && valid_avatar?(current_user.image) begin redirect_to join_path(@room, current_user.name, opts, current_user.uid) From c6b662ed130cea8fe55c614bb9c226e5b32d1e8c Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:16:40 +0900 Subject: [PATCH 42/59] Update application.rb --- config/application.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/application.rb b/config/application.rb index 1870427426..635ee0934a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -183,5 +183,8 @@ def parse_bool(val, default = false) # Default admin password config.admin_password_default = ENV['ADMIN_PASSWORD'] || 'administrator' + + # Max avatar size + config.max_avatar_size = ENV['AVATAR_SIZE_LIMIT'].to_i end end From 9a614fc0443d3ddaa663804df449c992e6c89454 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:23:07 +0900 Subject: [PATCH 43/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 46b0c78ef8..4157e37996 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -60,7 +60,6 @@ def join_room(opts) opts[:mute_on_start] = room_setting_with_config("muteOnStart") if current_user - opts[:avatarURL_size] = url_size(current_user.image); opts[:avatarURL] = current_user.image redirect_to join_path(@room, current_user.name, opts, current_user.uid) else From 998a7dc576ad884f51661bc3ab2d6bbacc9a3f05 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:50:19 +0900 Subject: [PATCH 44/59] Update rooms_controller.rb --- app/controllers/rooms_controller.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 83c9c86141..be64c58c8d 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -166,15 +166,6 @@ def join_specific_room redirect_to room_path(@room) end - - def valid_avatar?(url) - return false if URI.regexp.match(url).nil? - uri = URI(url) - http = Net::HTTP.new(uri.host, uri.port) - http.use_ssl = true if uri.scheme == 'https' - response = http.request_head(uri) - return response['content-length'].to_i < Rails.configuration.max_avatar_size - end # POST /:room_uid/start def start From d9ae24c6d88077ab3c54a51d3c1726d7d3c3e5a0 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:52:07 +0900 Subject: [PATCH 45/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 4157e37996..e5d621d7a6 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -47,6 +47,15 @@ def save_recent_rooms end end + def valid_avatar?(url) + return false if URI.regexp.match(url).nil? + uri = URI(url) + http = Net::HTTP.new(uri.host, uri.port) + http.use_ssl = true if uri.scheme == 'https' + response = http.request_head(uri) + return response['content-length'].to_i < Rails.configuration.max_avatar_size + end + def join_room(opts) @room_settings = JSON.parse(@room[:room_settings]) @@ -60,7 +69,7 @@ def join_room(opts) opts[:mute_on_start] = room_setting_with_config("muteOnStart") if current_user - opts[:avatarURL] = current_user.image + opts[:avatarURL] = current_user.image if current_user.image.present? && valid_avatar?(current_user.image) redirect_to join_path(@room, current_user.name, opts, current_user.uid) else join_name = params[:join_name] || params[@room.invite_path][:join_name] From 7cfdb9d5933159128d6b71ec24f730fe9f9a0b2a Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 17:49:34 +0900 Subject: [PATCH 46/59] Update rooms_controller.rb --- app/controllers/rooms_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index be64c58c8d..debf251150 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -166,7 +166,7 @@ def join_specific_room redirect_to room_path(@room) end - + # POST /:room_uid/start def start logger.info "Support: #{current_user.email} is starting room #{@room.uid}" From 86fc670cd34a743b9ef5df3801adbea11b304aad Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 17:50:22 +0900 Subject: [PATCH 47/59] Update application_helper.rb --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7971acfb77..6e752d0bd0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -113,7 +113,7 @@ def valid_url?(input) rescue false end - + # Specifies which title should be the tab title and returns original string def title(page_title) # Only set the content_for if not already set on the page so that only the first title appears as the tab title From a3d6fb74d08fa9c407ff3a668597737abf67cc00 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 13 Sep 2021 17:50:59 +0900 Subject: [PATCH 48/59] Update application.rb --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 635ee0934a..33f25f94e4 100644 --- a/config/application.rb +++ b/config/application.rb @@ -184,7 +184,7 @@ def parse_bool(val, default = false) # Default admin password config.admin_password_default = ENV['ADMIN_PASSWORD'] || 'administrator' - # Max avatar size + # Max avatar image size config.max_avatar_size = ENV['AVATAR_SIZE_LIMIT'].to_i end end From aa2f277cacedb1dc523408d8e3ef245c40e4a8f3 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Tue, 14 Sep 2021 09:25:47 +0900 Subject: [PATCH 49/59] in case parameter not set --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 33f25f94e4..a4937383e7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -185,6 +185,6 @@ def parse_bool(val, default = false) config.admin_password_default = ENV['ADMIN_PASSWORD'] || 'administrator' # Max avatar image size - config.max_avatar_size = ENV['AVATAR_SIZE_LIMIT'].to_i + config.max_avatar_size = ENV['MAX_AVATAR_SIZE'].to_i.zero? ? 100000 : ENV['MAX_AVATAR_SIZE'].to_i end end From 0b68642007838c9cca4615120e5a80c90167a825 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Tue, 14 Sep 2021 09:28:05 +0900 Subject: [PATCH 50/59] change to MAX_AVATAR_SIZE --- sample.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample.env b/sample.env index f61f6025f6..9f91e68500 100644 --- a/sample.env +++ b/sample.env @@ -357,5 +357,5 @@ DEFAULT_REGISTRATION=open # Default: 1 #WEB_CONCURRENCY=1 -# Avatar image size limit (bytes) -AVATAR_SIZE_LIMIT=100000 +# Max avatar image size (bytes) +MAX_AVATAR_SIZE=100000 From ad84d1b69668a1561afd14c01d93c37653fada69 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 27 Sep 2021 13:11:51 +0900 Subject: [PATCH 51/59] URL check only for http or https --- app/controllers/concerns/joiner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index e5d621d7a6..85dc92c931 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -48,7 +48,7 @@ def save_recent_rooms end def valid_avatar?(url) - return false if URI.regexp.match(url).nil? + return false if URI.regexp(['http', 'https']).match(url).nil? uri = URI(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if uri.scheme == 'https' From eaad4dd02373248cc58786a724751a5b2c156a5b Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 27 Sep 2021 13:12:50 +0900 Subject: [PATCH 52/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index 85dc92c931..e5d621d7a6 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -48,7 +48,7 @@ def save_recent_rooms end def valid_avatar?(url) - return false if URI.regexp(['http', 'https']).match(url).nil? + return false if URI.regexp.match(url).nil? uri = URI(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if uri.scheme == 'https' From b75be9f0b56784f85f204f67cf0b30b7f19b2853 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 26 Jun 2023 21:07:51 +0900 Subject: [PATCH 53/59] Update room.js --- app/assets/javascripts/room.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/room.js b/app/assets/javascripts/room.js index 213410901b..70c638388f 100644 --- a/app/assets/javascripts/room.js +++ b/app/assets/javascripts/room.js @@ -344,7 +344,7 @@ function displaySharedUsers(path) { users.forEach(function(user) { listName = document.createElement("li"), - spanAvatar = document.createElement("span"), + spanAvatar = undefined, spanName = document.createElement("span"), spanUid = document.createElement("span"), spanRemove = document.createElement("span"), @@ -352,8 +352,16 @@ function displaySharedUsers(path) { listName.setAttribute('class', 'list-group-item text-left') listName.setAttribute('data-uid', user.uid) - spanAvatar.innerText = user.name.charAt(0) - spanAvatar.setAttribute('class', 'avatar float-left mr-2') + if (user.image) { + spanAvatar = document.createElement("img") + spanAvatar.setAttribute('id', 'user-image') + spanAvatar.setAttribute('class', 'avatar float-left mr-2') + spanAvatar.setAttribute('src', user.image) + } else { + spanAvatar = document.createElement("span") + spanAvatar.innerText = user.name.charAt(0) + spanAvatar.setAttribute('class', 'avatar float-left mr-2') + } spanName.setAttribute('class', 'shared-user') spanName.innerText = user.name spanUid.setAttribute('class', 'text-muted ml-1') From 9fa5cd4a3a61dc7cb83dfb47cfab28f37e40aa49 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 26 Jun 2023 21:08:46 +0900 Subject: [PATCH 54/59] Update joiner.rb --- app/controllers/concerns/joiner.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/concerns/joiner.rb b/app/controllers/concerns/joiner.rb index f887ed43ec..3132eb0cc0 100644 --- a/app/controllers/concerns/joiner.rb +++ b/app/controllers/concerns/joiner.rb @@ -70,6 +70,7 @@ def join_room(opts) opts[:mute_on_start] = room_setting_with_config("muteOnStart") if current_user + opts[:avatarURL] = current_user.image if current_user.image.present? && valid_avatar?(current_user.image) redirect_to join_path(@room, current_user.name, opts, current_user.uid) else join_name = params[:join_name] || params[@room.invite_path][:join_name] From 6fd72dedff4d85ab9dd0e3c0fec104aeeecc3f9a Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 26 Jun 2023 21:09:10 +0900 Subject: [PATCH 55/59] Update rooms_controller.rb --- app/controllers/rooms_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 934eab058d..ed21bcdcb6 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -181,6 +181,7 @@ def start opts[:mute_on_start] = room_setting_with_config("muteOnStart") opts[:require_moderator_approval] = room_setting_with_config("requireModeratorApproval") opts[:record] = record_meeting + opts[:avatarURL] = current_user.image if current_user.image.present? && valid_avatar?(current_user.image) begin redirect_to join_path(@room, current_user.name, opts, current_user.uid) From 4582021672846ef2385b09199d8cd0510c9403a9 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 26 Jun 2023 21:10:17 +0900 Subject: [PATCH 56/59] Update cant_create_rooms.html.erb --- app/views/rooms/cant_create_rooms.html.erb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/rooms/cant_create_rooms.html.erb b/app/views/rooms/cant_create_rooms.html.erb index 2d9f356ff8..cb661fa60f 100644 --- a/app/views/rooms/cant_create_rooms.html.erb +++ b/app/views/rooms/cant_create_rooms.html.erb @@ -20,11 +20,15 @@
- <%= current_user.name.first %> -

<%= current_user.name %>

- <%= link_to edit_user_path(current_user), class: "btn btn-outline-primary mt-2" do %> - <%= t("room.no_room.edit_profile") %> - <% end %> + <% if current_user.image.blank? || !valid_url?(current_user.image) %> + <%= current_user.name.first %> + <% else %> + <%= image_tag(current_user.image, class: "avatar avatar-xxxl card-profile-img") %> + <% end %> +

<%= current_user.name %>

+ <%= link_to edit_user_path(current_user), class: "btn btn-outline-primary mt-2" do %> + <%= t("room.no_room.edit_profile") %> + <% end %>
From 4ada010a8bdad7604ee2ddef6ebdf9b7fd3e24ec Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 26 Jun 2023 21:11:08 +0900 Subject: [PATCH 57/59] Update _room_event.html.erb --- app/views/rooms/components/_room_event.html.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/rooms/components/_room_event.html.erb b/app/views/rooms/components/_room_event.html.erb index 2482c4657a..a218e37a82 100644 --- a/app/views/rooms/components/_room_event.html.erb +++ b/app/views/rooms/components/_room_event.html.erb @@ -25,7 +25,11 @@
- <%= @room.owner.name.first %> + <% if @room.owner.image.blank? %> + <%= @room.owner.name.first %> + <% else %> + + <% end %>
<%= @room.owner.name %> (<%= t("room.owner") %>)
From 9ee79839952d2af7cd632078659b1ff8789c70b9 Mon Sep 17 00:00:00 2001 From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com> Date: Mon, 26 Jun 2023 21:11:49 +0900 Subject: [PATCH 58/59] Update _header.html.erb --- app/views/shared/_header.html.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_header.html.erb b/app/views/shared/_header.html.erb index 73d9de9c42..2ada39c2cf 100755 --- a/app/views/shared/_header.html.erb +++ b/app/views/shared/_header.html.erb @@ -40,7 +40,12 @@