From 4c33753198d4e39535ab34d7e9340485e4d51b27 Mon Sep 17 00:00:00 2001 From: Ahmad Farhat Date: Mon, 4 Mar 2024 10:27:47 -0500 Subject: [PATCH 1/8] Fix issue with bbb logo asset (#5728) --- app/services/setting_getter.rb | 6 +----- db/data/20220713143528_populate_site_settings.rb | 8 +++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/services/setting_getter.rb b/app/services/setting_getter.rb index fda7f838d17..eb9a61afa18 100644 --- a/app/services/setting_getter.rb +++ b/app/services/setting_getter.rb @@ -52,11 +52,7 @@ def call private def transform_value(site_setting) - if site_setting.setting.name == 'BrandingImage' - return rails_blob_path site_setting.image, only_path: true if site_setting.image.attached? - - return ActionController::Base.helpers.image_path('bbb_logo.png') - end + return rails_blob_path site_setting.image, only_path: true if site_setting.setting.name == 'BrandingImage' && site_setting.image.attached? case site_setting.value when 'true' diff --git a/db/data/20220713143528_populate_site_settings.rb b/db/data/20220713143528_populate_site_settings.rb index 48b8cb4f768..951a2aabeff 100644 --- a/db/data/20220713143528_populate_site_settings.rb +++ b/db/data/20220713143528_populate_site_settings.rb @@ -18,12 +18,18 @@ class PopulateSiteSettings < ActiveRecord::Migration[7.0] def up + image_path = begin + ActionController::Base.helpers.image_path('bbb_logo.png') + rescue StandardError + 'https://github.com/bigbluebutton/greenlight/blob/master/app/assets/images/bbb_logo.png' + end + SiteSetting.create! [ { setting: Setting.find_by(name: 'PrimaryColor'), value: '#467fcf', provider: 'greenlight' }, { setting: Setting.find_by(name: 'PrimaryColorLight'), value: '#e8eff9', provider: 'greenlight' }, { setting: Setting.find_by(name: 'PrimaryColorDark'), value: '#316cbe', provider: 'greenlight' }, { setting: Setting.find_by(name: 'BrandingImage'), - value: ActionController::Base.helpers.image_path('bbb_logo.png'), + value: image_path, provider: 'greenlight' }, { setting: Setting.find_by(name: 'Terms'), value: '', provider: 'greenlight' }, { setting: Setting.find_by(name: 'PrivacyPolicy'), value: '', provider: 'greenlight' }, From 0dfcce132a476308427ed4ad8eb82d37f70de7ac Mon Sep 17 00:00:00 2001 From: Ahmad Farhat Date: Mon, 4 Mar 2024 10:27:59 -0500 Subject: [PATCH 2/8] fixed bootstrap buttons on hover looking weird (#5727) --- .../stylesheets/application.bootstrap.scss | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.bootstrap.scss b/app/assets/stylesheets/application.bootstrap.scss index 57e48faba32..6c949d0ba6b 100644 --- a/app/assets/stylesheets/application.bootstrap.scss +++ b/app/assets/stylesheets/application.bootstrap.scss @@ -315,9 +315,17 @@ input.search-bar { border-color: var(--brand-color); color: white; + &:active { + background-color: var(--brand-color) !important; + border-color: var(--brand-color) !important; + color: white !important; + } + &:hover { - box-shadow: inset 0 0 200px 200px rgba(0, 0, 0, 0.1); + background-color: var(--brand-color); + border-color: var(--brand-color); color: white; + box-shadow: inset 0 0 200px 200px rgba(0, 0, 0, 0.1); } &:focus { @@ -331,8 +339,15 @@ input.search-bar { background-color: white; box-shadow: var(--brand-color-light); + &:active { + border-color: var(--brand-color) !important; + background-color: white !important; + color: var(--brand-color) !important; + } + &:hover { border-color: var(--brand-color); + background-color: white; color: var(--brand-color); } From c21f85dafeb608e828479b86a93bab2ed154d224 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Tue, 5 Mar 2024 16:41:00 +0100 Subject: [PATCH 3/8] feat(migrations): Import room presentation attachment (#5695) --- .../api/v1/migrations/external_controller.rb | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/controllers/api/v1/migrations/external_controller.rb b/app/controllers/api/v1/migrations/external_controller.rb index d15956d37ad..39ab29703d9 100644 --- a/app/controllers/api/v1/migrations/external_controller.rb +++ b/app/controllers/api/v1/migrations/external_controller.rb @@ -125,13 +125,15 @@ def create_room return render_error(status: :bad_request, errors: 'Provider does not exist') end - return render_data status: :created if Room.exists? friendly_id: room_hash[:friendly_id] - user = User.find_by(email: room_hash[:owner_email], provider: room_hash[:provider]) return render_error(status: :bad_request, errors: 'The room owner does not exist.') unless user - room = Room.new(room_hash.except(:owner_email, :provider, :room_settings, :shared_users_emails).merge({ user: })) + room = if Room.exists?(friendly_id: room_hash[:friendly_id]) + Room.find_by(friendly_id: room_hash[:friendly_id]) + else + Room.new(room_hash.except(:owner_email, :provider, :room_settings, :shared_users_emails, :presentation).merge({ user: })) + end # Redefines the validations method to do nothing # rubocop:disable Lint/EmptyBlock @@ -139,6 +141,12 @@ def create_room room.define_singleton_method(:set_meeting_id) {} # rubocop:enable Lint/EmptyBlock + if room_hash[:presentation] + attachment_blob_io = StringIO.new(Base64.decode64(room_hash[:presentation][:blob])) + attachment = ActiveStorage::Blob.create_and_upload!(io: attachment_blob_io, filename: room_hash[:presentation][:filename]) + room.presentation.attach(attachment) + end + return render_error(status: :bad_request, errors: room&.errors&.to_a) unless room.save if room_hash[:room_settings].any? @@ -146,13 +154,8 @@ def create_room room_meeting_options_joined = RoomMeetingOption.includes(:meeting_option) .where(room_id: room.id, 'meeting_options.name': room_hash[:room_settings].keys) - okay = true - room_meeting_options_joined.each do |room_meeting_option| - option_name = room_meeting_option.meeting_option.name - okay = false unless room_meeting_option.update(value: room_hash[:room_settings][option_name]) - end - - return render_error status: :bad_request, errors: 'Something went wrong when migrating the room settings.' unless okay + return render_error status: :bad_request, errors: 'Something went wrong when migrating the room settings.' unless + room_meeting_options_joined.collect { |o| o.update(value: room_hash[:room_settings][o.meeting_option.name]) }.all? end return render_data status: :created unless room_hash[:shared_users_emails].any? @@ -160,12 +163,8 @@ def create_room # Finds all the users that have a SharedAccess to the Room shared_with_users = User.where(email: room_hash[:shared_users_emails], provider: room_hash[:provider]) - okay = true - shared_with_users.each do |shared_with_user| - okay = false unless SharedAccess.new(room_id: room.id, user_id: shared_with_user.id).save - end - - return render_error status: :bad_request, errors: 'Something went wrong when sharing the room.' unless okay + return render_error status: :bad_request, errors: 'Something went wrong when sharing the room.' unless + shared_with_users.collect { |u| SharedAccess.new(room_id: room.id, user_id: u.id).save }.all? render_data status: :created end @@ -231,7 +230,8 @@ def room_params decrypted_params.require(:room).permit(:name, :friendly_id, :meeting_id, :last_session, :owner_email, :provider, shared_users_emails: [], room_settings: %w[record muteOnStart guestPolicy glAnyoneCanStart glAnyoneJoinAsModerator - glViewerAccessCode glModeratorAccessCode]) + glViewerAccessCode glModeratorAccessCode], + presentation: %w[blob filename]) end def settings_params From ba14c234660f1ed4871bdd41b4ef5fa9f8766478 Mon Sep 17 00:00:00 2001 From: Ahmad Farhat Date: Tue, 5 Mar 2024 10:53:26 -0500 Subject: [PATCH 4/8] Revert "feat: run as user greenlight (#5506)" (#5737) This reverts commit e58cea03123de4f1f203c5bf3ab77d2909c5e814. --- Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9857176fc09..f7687b5fed4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,8 +30,6 @@ RUN apk update \ FROM base as prod -RUN addgroup -S -g 1000 greenlight && adduser -S -G greenlight -u 999 greenlight - ARG PACKAGES='libpq-dev tzdata imagemagick yarn bash' COPY --from=build $RAILS_ROOT/vendor/bundle ./vendor/bundle COPY package.json yarn.lock ./ @@ -44,8 +42,5 @@ RUN apk update \ && apk upgrade \ && update-ca-certificates -RUN chown -R greenlight /usr/src/app/tmp - -USER 999 EXPOSE ${PORT} ENTRYPOINT [ "./bin/start" ] From c3b4b57b623f6c6476b139631885af77d1d450c7 Mon Sep 17 00:00:00 2001 From: Ahmad Farhat Date: Wed, 6 Mar 2024 10:13:01 -0500 Subject: [PATCH 5/8] Revert "added changes required for upcoming docker compose (#5715)" (#5738) This reverts commit 4a7d381af9f2f13be247249d509e1f598ec7666a. --- gl-install.sh | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/gl-install.sh b/gl-install.sh index cdf04942446..89e0a1f9972 100755 --- a/gl-install.sh +++ b/gl-install.sh @@ -96,14 +96,6 @@ main() { check_ubuntu_lts need_x64 - DOCKER_COMPOSE_CMD="docker-compose" - # Test if docker-compose command exists - if ! command -v $DOCKER_COMPOSE_CMD &> /dev/null - then - # Change the command to the build in docker compose command - DOCKER_COMPOSE_CMD="docker compose" - fi - while builtin getopts "s:e:b:hdk" opt "${@}"; do case $opt in @@ -466,9 +458,9 @@ install_greenlight_v3(){ # Adding Keycloak if [ -n "$INSTALL_KC" ]; then # When attepmting to install/update Keycloak let us attempt to create the database to resolve any issues caused by postgres false negatives. - $DOCKER_COMPOSE_CMD -f $GL3_DIR/docker-compose.yml up -d postgres && say "started postgres" - wait_postgres_start($DOCKER_COMPOSE_CMD) - $DOCKER_COMPOSE_CMD -f $GL3_DIR/docker-compose.yml exec -T postgres psql -U postgres -c 'CREATE DATABASE keycloakdb;' + docker-compose -f $GL3_DIR/docker-compose.yml up -d postgres && say "started postgres" + wait_postgres_start + docker-compose -f $GL3_DIR/docker-compose.yml exec -T postgres psql -U postgres -c 'CREATE DATABASE keycloakdb;' fi if ! grep -q 'keycloak:' $GL3_DIR/docker-compose.yml; then @@ -478,7 +470,7 @@ install_greenlight_v3(){ # Add Keycloak say "Adding Keycloak..." - $DOCKER_COMPOSE_CMD -f $GL3_DIR/docker-compose.yml down + docker-compose -f $GL3_DIR/docker-compose.yml down cp -v $GL3_DIR/docker-compose.yml $GL3_DIR/docker-compose.base.yml # Persist working base compose file for admins as a Backup. docker run --rm --entrypoint sh $GL_IMG_REPO -c 'cat docker-compose.kc.yml' >> $GL3_DIR/docker-compose.yml @@ -528,17 +520,17 @@ HERE # Eager pulling images. say "pulling latest greenlight-v3 services images..." - $DOCKER_COMPOSE_CMD -f $GL3_DIR/docker-compose.yml pull + docker-compose -f $GL3_DIR/docker-compose.yml pull if check_container_running greenlight-v3; then # Restarting Greenlight-v3 services after updates. say "greenlight-v3 is updating..." say "shutting down greenlight-v3..." - $DOCKER_COMPOSE_CMD -f $GL3_DIR/docker-compose.yml down + docker-compose -f $GL3_DIR/docker-compose.yml down fi say "starting greenlight-v3..." - $DOCKER_COMPOSE_CMD -f $GL3_DIR/docker-compose.yml up -d + docker-compose -f $GL3_DIR/docker-compose.yml up -d sleep 5 say "greenlight-v3 is now installed and accessible on: https://$HOST${GL_RELATIVE_URL_ROOT:-$GL_DEFAULT_PATH}" say "To create Greenlight administrator account, see: https://docs.bigbluebutton.org/greenlight/v3/install#creating-an-admin-account" @@ -560,10 +552,10 @@ HERE wait_postgres_start() { say "Waiting for the Postgres DB to start..." - $DOCKER_COMPOSE_CMD -f $GL3_DIR/docker-compose.yml up -d postgres || err "failed to start Postgres service - retry to resolve" + docker-compose -f $GL3_DIR/docker-compose.yml up -d postgres || err "failed to start Postgres service - retry to resolve" local tries=0 - while ! $DOCKER_COMPOSE_CMD -f $GL3_DIR/docker-compose.yml exec -T postgres pg_isready 2> /dev/null 1>&2; do + while ! docker-compose -f $GL3_DIR/docker-compose.yml exec -T postgres pg_isready 2> /dev/null 1>&2; do echo -n . sleep 3 if (( ++tries == 3 )); then From ac4e093f9714b11af1fa7f30613facd72f68d813 Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 10:28:08 -0500 Subject: [PATCH 6/8] Translate app/assets/locales/en.json in el (#5729) 100% translated source file: 'app/assets/locales/en.json' on 'el'. Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> --- app/assets/locales/el.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/assets/locales/el.json b/app/assets/locales/el.json index 089f347b427..4efe070c00b 100644 --- a/app/assets/locales/el.json +++ b/app/assets/locales/el.json @@ -278,7 +278,11 @@ "change_privacy_link": "Αλλαγή του συνδέσμου για το απόρρητο που εμφανίζεται στο κάτω μέρος της σελίδας", "helpcenter": "Κέντρο Βοήθειας", "change_helpcenter_link": "Αλλαγή του συνδέσμου για το Κέντρο βοήθειας που εμφανίζεται κάτω από το προφίλ. ", + "maintenance": "Μήνυμα κατάστασης συντήρησης", + "change_maintenance_text": "Αλλάξτε το κείμενο του μηνύματος κατάστασης συντήρησης που εμφανίζεται στην κεφαλίδα", "change_url": "Αλλαγή URL", + "set_text": "Ορισμός κειμένου", + "clear_banner": "Διαγραφή μηνύματος", "enter_link": "Εισαγάγετε εδώ το σύνδεσμο" }, "settings": { @@ -288,7 +292,11 @@ "allow_users_to_preupload_presentation": "Να επιτρέπεται στους χρήστες να μεταφορτώνουν παρουσιάσεις νωρίτερα", "allow_users_to_preupload_presentation_description": "Οι χρήστες μπορούν να μεταφορτώνουν νωρίτερα μια παρουσίαση για χρήση όπως την προεπιλεγμένη για συγκεκριμένη αίθουσα διασκέψεων", "default_visibility": "Προεπιλεγμένη ορατότητα καταγραφής", - "default_visibility_description": "Όλες οι καταγραφές που δημιουργήθηκαν πρόσφατα θα έχουν αυτήν την ορατότητα από προεπιλογή" + "default_visibility_description": "Όλες οι καταγραφές που δημιουργήθηκαν πρόσφατα θα έχουν αυτήν την ορατότητα από προεπιλογή", + "session_timeout": "Λήξη συνεδρίας", + "session_timeout_description": "Μπορείτε να ρυθμίσετε το χρονικό όριο της συνεδρίας με ένα προεπιλεγμένο cookie διάρκειας 1 ημέρας ή με ένα επεκτεινόμενης συνεδρίας 7 ημερών.", + "default_session_timeout": "Προεπιλογή (1 ημέρα)", + "extended_session_timeout": "Επέκταση (7 ημέρες)" }, "registration": { "registration": "Εγγραφή", @@ -676,7 +684,8 @@ "site_settings": { "fields": { "value": { - "placeholder": "Εισαγάγετε εδώ το σύνδεσμο..." + "placeholder": "Εισαγάγετε εδώ το σύνδεσμο...", + "text_placeholder": "Εισαγάγετε εδώ το κείμενο..." } } }, From 9d76dd5ad300cdbf1dde273928658bb7694807bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 10:28:22 -0500 Subject: [PATCH 7/8] Bump json-jwt from 1.16.3 to 1.16.6 (#5735) Bumps [json-jwt](https://github.com/nov/json-jwt) from 1.16.3 to 1.16.6. - [Release notes](https://github.com/nov/json-jwt/releases) - [Changelog](https://github.com/nov/json-jwt/blob/main/CHANGELOG.md) - [Commits](https://github.com/nov/json-jwt/compare/v1.16.3...v1.16.6) --- updated-dependencies: - dependency-name: json-jwt dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a72acb25826..bf0dff35461 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -117,7 +117,7 @@ GEM rubyzip (>= 1.3.0) xml-simple (~> 1.1) bigdecimal (3.1.6) - bindata (2.4.15) + bindata (2.5.0) bindex (0.8.1) bootsnap (1.16.0) msgpack (~> 1.2) @@ -157,8 +157,7 @@ GEM dotenv-rails (2.8.1) dotenv (= 2.8.1) railties (>= 3.2) - drb (2.2.0) - ruby2_keywords + drb (2.2.1) erubi (1.12.0) factory_bot (6.4.5) activesupport (>= 5.0.0) @@ -167,12 +166,12 @@ GEM railties (>= 5.0.0) faker (3.1.1) i18n (>= 1.8.11, < 2) - faraday (2.7.10) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) - faraday-net_http (3.0.2) + faraday-net_http (3.1.0) + net-http ffi (1.15.5) globalid (1.2.1) activesupport (>= 6.1) @@ -233,9 +232,10 @@ GEM jsbundling-rails (1.2.2) railties (>= 6.0.0) json (2.6.3) - json-jwt (1.16.3) + json-jwt (1.16.6) activesupport (>= 4.2) aes_key_wrap + base64 bindata faraday (~> 2.0) faraday-follow_redirects @@ -265,6 +265,8 @@ GEM msgpack (1.6.0) multi_json (1.15.0) mutex_m (0.2.0) + net-http (0.4.1) + uri net-imap (0.4.10) date net-protocol @@ -428,7 +430,6 @@ GEM ruby-progressbar (1.13.0) ruby-vips (2.1.4) ffi (~> 1.12) - ruby2_keywords (0.0.5) rubyzip (2.3.2) selenium-webdriver (4.8.0) rexml (~> 3.2, >= 3.2.5) @@ -462,6 +463,7 @@ GEM concurrent-ruby (~> 1.0) uber (0.1.0) unicode-display_width (2.4.2) + uri (0.13.0) validate_email (0.1.6) activemodel (>= 3.0) mail (>= 2.2.5) From c5a16e7165586c8604de9e71e96627d20a081e46 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Wed, 6 Mar 2024 10:39:04 -0500 Subject: [PATCH 8/8] [Snyk] Security upgrade data_migrate from 9.2.0 to 9.3.0 (#5732) * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 * Update Gemfile.lock --------- Co-authored-by: snyk-bot Co-authored-by: Ahmad Farhat --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 1feb7c27e26..c7e57429a66 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ gem 'bigbluebutton-api-ruby', '1.9.1' gem 'bootsnap', require: false gem 'clamby', '~> 1.6.10' gem 'cssbundling-rails', '>= 1.3.3' -gem 'data_migrate', '>= 9.2.0' +gem 'data_migrate', '>= 9.3.0' gem 'dotenv-rails' gem 'google-cloud-storage', '~> 1.44', require: false gem 'hcaptcha' diff --git a/Gemfile.lock b/Gemfile.lock index bf0dff35461..36791204bb0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -142,7 +142,7 @@ GEM crass (1.0.6) cssbundling-rails (1.3.3) railties (>= 6.0.0) - data_migrate (9.2.0) + data_migrate (9.3.0) activerecord (>= 6.1) railties (>= 6.1) date (3.3.4) @@ -512,7 +512,7 @@ DEPENDENCIES capybara clamby (~> 1.6.10) cssbundling-rails (>= 1.3.3) - data_migrate (>= 9.2.0) + data_migrate (>= 9.3.0) debug dotenv-rails factory_bot (>= 6.4.1)