Complete refactor of Gemfile and upgraded gems (#2553)

This commit is contained in:
Ahmad Farhat 2021-02-26 17:34:07 -05:00 committed by GitHub
parent c5b00e89aa
commit 09ab074aaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 327 additions and 376 deletions

View File

@ -5,9 +5,7 @@ AllCops:
DisabledByDefault: false DisabledByDefault: false
TargetRubyVersion: 2.5 TargetRubyVersion: 2.5
# Gems within groups in the Gemfile should be alphabetically sorted. NewCops: enable
Bundler/OrderedGems:
Enabled: false
Style/BlockDelimiters: Style/BlockDelimiters:
Enabled: false Enabled: false
@ -138,7 +136,7 @@ Metrics/AbcSize:
# A complexity metric that is strongly correlated to the number # A complexity metric that is strongly correlated to the number
# of test cases needed to validate a method. # of test cases needed to validate a method.
Metrics/CyclomaticComplexity: Metrics/CyclomaticComplexity:
Max: 17 Max: 20
# Checks for method parameter names that contain capital letters, end in numbers, or do not meet a minimal length. # Checks for method parameter names that contain capital letters, end in numbers, or do not meet a minimal length.
Naming/MethodParameterName: Naming/MethodParameterName:
@ -176,4 +174,18 @@ Style/HashTransformValues:
Style/SlicingWithRange: Style/SlicingWithRange:
Enabled: true Enabled: true
Style/OptionalBooleanParameter:
Enabled: false
Lint/DuplicateBranch:
Enabled: false
Lint/ConstantDefinitionInBlock:
Enabled: false
Lint/EmptyBlock:
Enabled: false
Style/HashLikeCase:
Enabled: false

163
Gemfile
View File

@ -8,139 +8,72 @@ git_source(:github) do |repo_name|
end end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.4.4' gem 'aws-sdk-s3', '~> 1.88.1'
# Use Puma as the app server
gem 'puma', '~> 3.12'
# Use SCSS for stylesheets
gem 'sassc-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '~> 4.4'
gem 'jquery-ui-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7' gem 'bcrypt', '~> 3.1.7'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
gem 'sprockets', '< 4.0.0'
# Authentication.
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-google-oauth2'
gem 'omniauth_openid_connect'
gem 'omniauth-bn-launcher', '~> 0.1.3'
gem 'net-ldap'
gem 'bn-ldap-authentication', '~> 0.1.4'
gem 'omniauth-bn-office365', '~> 0.1.1'
# BigBlueButton API wrapper.
gem 'bigbluebutton-api-ruby', git: 'https://github.com/mconf/bigbluebutton-api-ruby.git', branch: 'master' gem 'bigbluebutton-api-ruby', git: 'https://github.com/mconf/bigbluebutton-api-ruby.git', branch: 'master'
gem 'bn-ldap-authentication', '~> 0.1.4'
# Front-end. gem 'bootsnap', '~> 1.7.2', require: false
gem 'bootstrap', '~> 4.3.1' gem 'bootstrap', '~> 4.3.1'
gem 'tabler-rubygem', git: 'https://github.com/blindsidenetworks/tabler-rubygem.git', tag: '0.1.4.1' gem 'cancancan', '~> 2.3.0'
gem 'pagy' gem 'coveralls', '~> 0.8.23', require: false
gem 'font-awesome-sass', '~> 5.9.0' gem 'font-awesome-sass', '~> 5.9.0'
gem 'google-cloud-storage', '~> 1.30.0'
# For detecting the users preferred language. gem 'http_accept_language', '~> 2.1.1'
gem 'http_accept_language' gem 'i18n-language-mapping', '~> 0.1.1'
gem 'jbuilder', '~> 2.11.2'
# Use Capistrano for deployment gem 'jquery-rails', '~> 4.4.0'
# gem 'capistrano-rails', group: :development gem 'jquery-ui-rails', '~> 6.0.1'
# Markdown parsing.
gem 'redcarpet'
# For limiting access based on user roles
gem 'cancancan', '~> 2.0'
# Active Storage gems
gem 'aws-sdk-s3', '~> 1.75'
gem 'google-cloud-storage', '~> 1.26'
gem 'pluck_to_hash', '~> 1.0.2'
gem 'local_time', '~> 2.1.0' gem 'local_time', '~> 2.1.0'
gem 'net-ldap', '~> 0.17.0'
# Use a sqlite database in test and development. gem 'omniauth', '~> 1.9.1'
gem 'omniauth-bn-launcher', '~> 0.1.3'
gem 'omniauth-bn-office365', '~> 0.1.1'
gem 'omniauth-google-oauth2', '~> 0.7.0'
gem 'omniauth_openid_connect', '~> 0.3.5'
gem 'omniauth-twitter', '~> 1.4.0'
gem 'pagy', '~> 3.11.0'
gem 'pluck_to_hash', '~> 1.0.2'
gem 'puma', '~> 3.12.6'
gem 'rails', '~> 5.2.4.4'
gem 'random_password', '~> 0.1.1'
gem "recaptcha", '~> 5.7.0'
gem 'redcarpet', '~> 3.5.1'
gem 'remote_syslog_logger', '~> 1.0.4'
gem 'rubocop', '~> 1.10.0'
gem 'sassc-rails', '~> 2.1.2'
gem 'sprockets', '~> 3.7.2'
gem 'sqlite3', '~> 1.3.6' gem 'sqlite3', '~> 1.3.6'
gem 'tabler-rubygem', git: 'https://github.com/blindsidenetworks/tabler-rubygem.git', tag: '0.1.4.1'
gem 'turbolinks', '~> 5.2.1'
gem 'tzinfo-data', '~> 1.2021.1'
gem 'uglifier', '~> 4.2.0'
group :production do group :production do
# Use a postgres database in production. gem 'hiredis', '~> 0.6.3'
gem "lograge", '~> 0.11.2'
gem 'pg', '~> 0.18' gem 'pg', '~> 0.18'
gem 'sequel' gem 'redis', '~> 4.2.5'
gem 'sequel', '~> 5.41.0'
# For a better logging library in production
gem "lograge"
# Use for the cache store in production
gem 'redis'
gem 'hiredis'
end end
# Ruby linting.
gem 'rubocop'
group :development, :test do group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', '~> 11.1', platform: :mri
gem 'byebug', platform: :mri gem 'dotenv-rails', '~> 2.7'
# Environment configuration.
gem 'dotenv-rails'
end end
group :test do group :test do
# Include Rspec and other testing utilities. gem 'action-cable-testing', '~> 0.6'
gem "factory_bot_rails", '~> 6.1'
gem 'faker', '~> 2.16'
gem 'rails-controller-testing', '~> 1.0'
gem 'rspec-rails', '~> 3.7' gem 'rspec-rails', '~> 3.7'
gem 'action-cable-testing'
gem 'rails-controller-testing'
gem 'shoulda-matchers', '~> 3.1' gem 'shoulda-matchers', '~> 3.1'
gem 'faker' gem 'webmock', '~> 3.11'
gem "factory_bot_rails"
gem 'webmock'
end end
group :development do group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code. gem 'listen', '~> 3.0'
gem 'web-console', '>= 3.3.0' gem 'spring', '~> 2.1'
gem 'listen', '~> 3.0.5' gem 'spring-watcher-listen', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'web-console', '~> 3.7'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end end
gem 'remote_syslog_logger'
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data'
gem 'coveralls', require: false
gem 'random_password'
# Adds helpers for the Google reCAPTCHA API
gem "recaptcha"
gem 'i18n-language-mapping', '~> 0.1.1'

View File

@ -25,43 +25,43 @@ GEM
specs: specs:
action-cable-testing (0.6.1) action-cable-testing (0.6.1)
actioncable (>= 5.0) actioncable (>= 5.0)
actioncable (5.2.4.4) actioncable (5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
actionmailer (5.2.4.4) actionmailer (5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
actionview (= 5.2.4.4) actionview (= 5.2.4.5)
activejob (= 5.2.4.4) activejob (= 5.2.4.5)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (5.2.4.4) actionpack (5.2.4.5)
actionview (= 5.2.4.4) actionview (= 5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
rack (~> 2.0, >= 2.0.8) rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.4.4) actionview (5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3) rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.4.4) activejob (5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.2.4.4) activemodel (5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
activerecord (5.2.4.4) activerecord (5.2.4.5)
activemodel (= 5.2.4.4) activemodel (= 5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
arel (>= 9.0) arel (>= 9.0)
activestorage (5.2.4.4) activestorage (5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
activerecord (= 5.2.4.4) activerecord (= 5.2.4.5)
marcel (~> 0.3.1) marcel (~> 0.3.1)
activesupport (5.2.4.4) activesupport (5.2.4.5)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
@ -70,32 +70,32 @@ GEM
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
aes_key_wrap (1.1.0) aes_key_wrap (1.1.0)
arel (9.0.0) arel (9.0.0)
ast (2.4.0) ast (2.4.2)
attr_required (1.0.1) attr_required (1.0.1)
autoprefixer-rails (9.7.6) autoprefixer-rails (10.2.4.0)
execjs execjs
aws-eventstream (1.1.0) aws-eventstream (1.1.0)
aws-partitions (1.343.0) aws-partitions (1.429.0)
aws-sdk-core (3.104.1) aws-sdk-core (3.112.0)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0) aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
jmespath (~> 1.0) jmespath (~> 1.0)
aws-sdk-kms (1.36.0) aws-sdk-kms (1.42.0)
aws-sdk-core (~> 3, >= 3.99.0) aws-sdk-core (~> 3, >= 3.112.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.75.0) aws-sdk-s3 (1.88.1)
aws-sdk-core (~> 3, >= 3.104.1) aws-sdk-core (~> 3, >= 3.112.0)
aws-sdk-kms (~> 1) aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.1) aws-sigv4 (1.2.2)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.13) bcrypt (3.1.16)
bindata (2.4.8) bindata (2.4.8)
bindex (0.8.1) bindex (0.8.1)
bn-ldap-authentication (0.1.4) bn-ldap-authentication (0.1.4)
net-ldap (~> 0) net-ldap (~> 0)
bootsnap (1.4.6) bootsnap (1.7.2)
msgpack (~> 1.0) msgpack (~> 1.0)
bootstrap (4.3.1) bootstrap (4.3.1)
autoprefixer-rails (>= 9.1.0) autoprefixer-rails (>= 9.1.0)
@ -105,71 +105,74 @@ GEM
byebug (11.1.3) byebug (11.1.3)
cancancan (2.3.0) cancancan (2.3.0)
childprocess (4.0.0) childprocess (4.0.0)
coffee-rails (4.2.2) concurrent-ruby (1.1.8)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.7)
coveralls (0.8.23) coveralls (0.8.23)
json (>= 1.8, < 3) json (>= 1.8, < 3)
simplecov (~> 0.16.1) simplecov (~> 0.16.1)
term-ansicolor (~> 1.3) term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0) thor (>= 0.19.4, < 2.0)
tins (~> 1.6) tins (~> 1.6)
crack (0.4.3) crack (0.4.5)
safe_yaml (~> 1.0.0) rexml
crass (1.0.6) crass (1.0.6)
declarative (0.0.20) declarative (0.0.20)
declarative-option (0.1.0) declarative-option (0.1.0)
diff-lcs (1.3) diff-lcs (1.4.4)
digest-crc (0.6.1) digest-crc (0.6.3)
rake (~> 13.0) rake (>= 12.0.0, < 14.0.0)
docile (1.3.2) docile (1.3.5)
dotenv (2.7.5) dotenv (2.7.6)
dotenv-rails (2.7.5) dotenv-rails (2.7.6)
dotenv (= 2.7.5) dotenv (= 2.7.6)
railties (>= 3.2, < 6.1) railties (>= 3.2)
erubi (1.9.0) erubi (1.10.0)
execjs (2.7.0) execjs (2.7.0)
factory_bot (5.2.0) factory_bot (6.1.0)
activesupport (>= 4.2.0) activesupport (>= 5.0.0)
factory_bot_rails (5.2.0) factory_bot_rails (6.1.0)
factory_bot (~> 5.2.0) factory_bot (~> 6.1.0)
railties (>= 4.2.0) railties (>= 5.0.0)
faker (2.11.0) faker (2.16.0)
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
faraday (1.0.1) faraday (1.3.0)
faraday-net_http (~> 1.0)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
ffi (1.12.2) ruby2_keywords
faraday-net_http (1.0.1)
ffi (1.14.2)
font-awesome-sass (5.9.0) font-awesome-sass (5.9.0)
sassc (>= 1.11) sassc (>= 1.11)
globalid (0.4.2) globalid (0.4.2)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
google-api-client (0.42.1) google-apis-core (0.2.1)
addressable (~> 2.5, >= 2.5.1) addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9) googleauth (~> 0.14)
httpclient (>= 2.8.1, < 3.0) httpclient (>= 2.8.1, < 3.0)
mini_mime (~> 1.0) mini_mime (~> 1.0)
representable (~> 3.0) representable (~> 3.0)
retriable (>= 2.0, < 4.0) retriable (>= 2.0, < 4.0)
signet (~> 0.12) rexml
signet (~> 0.14)
webrick
google-apis-iamcredentials_v1 (0.1.0)
google-apis-core (~> 0.1)
google-apis-storage_v1 (0.2.0)
google-apis-core (~> 0.1)
google-cloud-core (1.5.0) google-cloud-core (1.5.0)
google-cloud-env (~> 1.0) google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0) google-cloud-errors (~> 1.0)
google-cloud-env (1.3.3) google-cloud-env (1.4.0)
faraday (>= 0.17.3, < 2.0) faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.1) google-cloud-errors (1.0.1)
google-cloud-storage (1.26.2) google-cloud-storage (1.30.0)
addressable (~> 2.5) addressable (~> 2.5)
digest-crc (~> 0.4) digest-crc (~> 0.4)
google-api-client (~> 0.33) google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.1)
google-cloud-core (~> 1.2) google-cloud-core (~> 1.2)
googleauth (~> 0.9) googleauth (~> 0.9)
mini_mime (~> 1.0) mini_mime (~> 1.0)
googleauth (0.13.0) googleauth (0.15.1)
faraday (>= 0.17.3, < 2.0) faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0) jwt (>= 1.4, < 3.0)
memoist (~> 0.16) memoist (~> 0.16)
@ -181,10 +184,10 @@ GEM
hiredis (0.6.3) hiredis (0.6.3)
http_accept_language (2.1.1) http_accept_language (2.1.1)
httpclient (2.8.3) httpclient (2.8.3)
i18n (1.8.5) i18n (1.8.9)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n-language-mapping (0.1.2) i18n-language-mapping (0.1.2)
jbuilder (2.10.0) jbuilder (2.11.2)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
jmespath (1.4.0) jmespath (1.4.0)
jquery-rails (4.4.0) jquery-rails (4.4.0)
@ -193,22 +196,22 @@ GEM
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1) jquery-ui-rails (6.0.1)
railties (>= 3.2.16) railties (>= 3.2.16)
json (2.3.0) json (2.5.1)
json-jwt (1.13.0) json-jwt (1.13.0)
activesupport (>= 4.2) activesupport (>= 4.2)
aes_key_wrap aes_key_wrap
bindata bindata
jwt (2.2.1) jwt (2.2.2)
listen (3.0.8) listen (3.4.1)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.10)
local_time (2.1.0) local_time (2.1.0)
lograge (0.11.2) lograge (0.11.2)
actionpack (>= 4) actionpack (>= 4)
activesupport (>= 4) activesupport (>= 4)
railties (>= 4) railties (>= 4)
request_store (~> 1.0) request_store (~> 1.0)
loofah (2.7.0) loofah (2.9.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
mail (2.7.1) mail (2.7.1)
@ -220,17 +223,17 @@ GEM
mimemagic (0.3.5) mimemagic (0.3.5)
mini_mime (1.0.2) mini_mime (1.0.2)
mini_portile2 (2.5.0) mini_portile2 (2.5.0)
minitest (5.14.2) minitest (5.14.4)
msgpack (1.3.3) msgpack (1.4.2)
multi_json (1.14.1) multi_json (1.15.0)
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.1.1) multipart-post (2.1.1)
net-ldap (0.16.2) net-ldap (0.17.0)
nio4r (2.5.4) nio4r (2.5.5)
nokogiri (1.11.1) nokogiri (1.11.1)
mini_portile2 (~> 2.5.0) mini_portile2 (~> 2.5.0)
racc (~> 1.4) racc (~> 1.4)
oauth (0.5.4) oauth (0.5.5)
oauth2 (1.4.4) oauth2 (1.4.4)
faraday (>= 0.8, < 2.0) faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0) jwt (>= 1.0, < 3.0)
@ -250,9 +253,9 @@ GEM
jwt (>= 2.0) jwt (>= 2.0)
omniauth (>= 1.1.1) omniauth (>= 1.1.1)
omniauth-oauth2 (>= 1.5) omniauth-oauth2 (>= 1.5)
omniauth-oauth (1.1.0) omniauth-oauth (1.2.0)
oauth oauth
omniauth (~> 1.0) omniauth (>= 1.0, < 3)
omniauth-oauth2 (1.5.0) omniauth-oauth2 (1.5.0)
oauth2 (~> 1.1) oauth2 (~> 1.1)
omniauth (~> 1.2) omniauth (~> 1.2)
@ -273,17 +276,17 @@ GEM
validate_email validate_email
validate_url validate_url
webfinger (>= 1.0.1) webfinger (>= 1.0.1)
os (1.1.0) os (1.1.1)
pagy (3.8.1) pagy (3.11.0)
parallel (1.19.1) parallel (1.20.1)
parser (2.7.1.3) parser (3.0.0.0)
ast (~> 2.4.0) ast (~> 2.4.1)
pg (0.21.0) pg (0.21.0)
pluck_to_hash (1.0.2) pluck_to_hash (1.0.2)
activerecord (>= 4.0.2) activerecord (>= 4.0.2)
activesupport (>= 4.0.2) activesupport (>= 4.0.2)
popper_js (1.16.0) popper_js (1.16.0)
public_suffix (4.0.5) public_suffix (4.0.6)
puma (3.12.6) puma (3.12.6)
racc (1.5.2) racc (1.5.2)
rack (2.2.3) rack (2.2.3)
@ -295,44 +298,45 @@ GEM
rack (>= 2.1.0) rack (>= 2.1.0)
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails (5.2.4.4) rails (5.2.4.5)
actioncable (= 5.2.4.4) actioncable (= 5.2.4.5)
actionmailer (= 5.2.4.4) actionmailer (= 5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
actionview (= 5.2.4.4) actionview (= 5.2.4.5)
activejob (= 5.2.4.4) activejob (= 5.2.4.5)
activemodel (= 5.2.4.4) activemodel (= 5.2.4.5)
activerecord (= 5.2.4.4) activerecord (= 5.2.4.5)
activestorage (= 5.2.4.4) activestorage (= 5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
bundler (>= 1.3.0) bundler (>= 1.3.0)
railties (= 5.2.4.4) railties (= 5.2.4.5)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4) rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.x) actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.x) actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.x) activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.0.3) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0) rails-html-sanitizer (1.3.0)
loofah (~> 2.3) loofah (~> 2.3)
railties (5.2.4.4) railties (5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0) thor (>= 0.19.0, < 2.0)
rainbow (3.0.0) rainbow (3.0.0)
rake (13.0.1) rake (13.0.3)
random_password (0.1.1) random_password (0.1.1)
rb-fsevent (0.10.4) rb-fsevent (0.10.4)
rb-inotify (0.10.1) rb-inotify (0.10.1)
ffi (~> 1.0) ffi (~> 1.0)
recaptcha (5.5.0) recaptcha (5.7.0)
json json
redcarpet (3.5.1) redcarpet (3.5.1)
redis (4.1.4) redis (4.2.5)
regexp_parser (2.1.1)
remote_syslog_logger (1.0.4) remote_syslog_logger (1.0.4)
syslog_protocol syslog_protocol
representable (3.0.4) representable (3.0.4)
@ -343,9 +347,9 @@ GEM
rack (>= 1.4) rack (>= 1.4)
retriable (3.1.2) retriable (3.1.2)
rexml (3.2.4) rexml (3.2.4)
rspec-core (3.9.2) rspec-core (3.9.3)
rspec-support (~> 3.9.3) rspec-support (~> 3.9.3)
rspec-expectations (3.9.2) rspec-expectations (3.9.4)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0) rspec-support (~> 3.9.0)
rspec-mocks (3.9.1) rspec-mocks (3.9.1)
@ -359,21 +363,22 @@ GEM
rspec-expectations (~> 3.9.0) rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0) rspec-mocks (~> 3.9.0)
rspec-support (~> 3.9.0) rspec-support (~> 3.9.0)
rspec-support (3.9.3) rspec-support (3.9.4)
rubocop (0.84.0) rubocop (1.10.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.7.0.1) parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml rexml
rubocop-ast (>= 0.0.3) rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0) unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (0.0.3) rubocop-ast (1.4.1)
parser (>= 2.7.0.1) parser (>= 2.7.1.5)
ruby-progressbar (1.10.1) ruby-progressbar (1.11.0)
ruby2_keywords (0.0.4)
rubyzip (2.3.0) rubyzip (2.3.0)
safe_yaml (1.0.5) sassc (2.4.0)
sassc (2.3.0)
ffi (~> 1.9) ffi (~> 1.9)
sassc-rails (2.1.2) sassc-rails (2.1.2)
railties (>= 4.0.0) railties (>= 4.0.0)
@ -381,10 +386,10 @@ GEM
sprockets (> 3.0) sprockets (> 3.0)
sprockets-rails sprockets-rails
tilt tilt
sequel (5.32.0) sequel (5.41.0)
shoulda-matchers (3.1.3) shoulda-matchers (3.1.3)
activesupport (>= 4.0.0) activesupport (>= 4.0.0)
signet (0.14.0) signet (0.14.1)
addressable (~> 2.3) addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0) faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0) jwt (>= 1.5, < 3.0)
@ -394,7 +399,7 @@ GEM
json (>= 1.8, < 3) json (>= 1.8, < 3)
simplecov-html (~> 0.10.0) simplecov-html (~> 0.10.0)
simplecov-html (0.10.2) simplecov-html (0.10.2)
spring (2.1.0) spring (2.1.1)
spring-watcher-listen (2.0.1) spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0) listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0) spring (>= 1.2, < 3.0)
@ -414,22 +419,22 @@ GEM
syslog_protocol (0.9.2) syslog_protocol (0.9.2)
term-ansicolor (1.7.1) term-ansicolor (1.7.1)
tins (~> 1.0) tins (~> 1.0)
thor (1.0.1) thor (1.1.0)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (2.0.10) tilt (2.0.10)
tins (1.25.0) tins (1.28.0)
sync sync
turbolinks (5.2.1) turbolinks (5.2.1)
turbolinks-source (~> 5.2) turbolinks-source (~> 5.2)
turbolinks-source (5.2.0) turbolinks-source (5.2.0)
tzinfo (1.2.7) tzinfo (1.2.9)
thread_safe (~> 0.1) thread_safe (~> 0.1)
tzinfo-data (1.2020.1) tzinfo-data (1.2021.1)
tzinfo (>= 1.0.0) tzinfo (>= 1.0.0)
uber (0.1.0) uber (0.1.0)
uglifier (4.2.0) uglifier (4.2.0)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unicode-display_width (1.7.0) unicode-display_width (2.0.0)
validate_email (0.1.6) validate_email (0.1.6)
activemodel (>= 3.0) activemodel (>= 3.0)
mail (>= 2.2.5) mail (>= 2.2.5)
@ -444,74 +449,74 @@ GEM
webfinger (1.1.0) webfinger (1.1.0)
activesupport activesupport
httpclient (>= 2.4) httpclient (>= 2.4)
webmock (3.8.3) webmock (3.11.2)
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0) hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.7.0)
websocket-driver (0.7.3) websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5) websocket-extensions (0.1.5)
xml-simple (1.1.5) xml-simple (1.1.8)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
action-cable-testing action-cable-testing (~> 0.6)
aws-sdk-s3 (~> 1.75) aws-sdk-s3 (~> 1.88.1)
bcrypt (~> 3.1.7) bcrypt (~> 3.1.7)
bigbluebutton-api-ruby! bigbluebutton-api-ruby!
bn-ldap-authentication (~> 0.1.4) bn-ldap-authentication (~> 0.1.4)
bootsnap (>= 1.1.0) bootsnap (~> 1.7.2)
bootstrap (~> 4.3.1) bootstrap (~> 4.3.1)
byebug byebug (~> 11.1)
cancancan (~> 2.0) cancancan (~> 2.3.0)
coffee-rails (~> 4.2) coveralls (~> 0.8.23)
coveralls dotenv-rails (~> 2.7)
dotenv-rails factory_bot_rails (~> 6.1)
factory_bot_rails faker (~> 2.16)
faker
font-awesome-sass (~> 5.9.0) font-awesome-sass (~> 5.9.0)
google-cloud-storage (~> 1.26) google-cloud-storage (~> 1.30.0)
hiredis hiredis (~> 0.6.3)
http_accept_language http_accept_language (~> 2.1.1)
i18n-language-mapping (~> 0.1.1) i18n-language-mapping (~> 0.1.1)
jbuilder (~> 2.5) jbuilder (~> 2.11.2)
jquery-rails (~> 4.4) jquery-rails (~> 4.4.0)
jquery-ui-rails jquery-ui-rails (~> 6.0.1)
listen (~> 3.0.5) listen (~> 3.0)
local_time (~> 2.1.0) local_time (~> 2.1.0)
lograge lograge (~> 0.11.2)
net-ldap net-ldap (~> 0.17.0)
omniauth omniauth (~> 1.9.1)
omniauth-bn-launcher (~> 0.1.3) omniauth-bn-launcher (~> 0.1.3)
omniauth-bn-office365 (~> 0.1.1) omniauth-bn-office365 (~> 0.1.1)
omniauth-google-oauth2 omniauth-google-oauth2 (~> 0.7.0)
omniauth-twitter omniauth-twitter (~> 1.4.0)
omniauth_openid_connect omniauth_openid_connect (~> 0.3.5)
pagy pagy (~> 3.11.0)
pg (~> 0.18) pg (~> 0.18)
pluck_to_hash (~> 1.0.2) pluck_to_hash (~> 1.0.2)
puma (~> 3.12) puma (~> 3.12.6)
rails (~> 5.2.4.4) rails (~> 5.2.4.4)
rails-controller-testing rails-controller-testing (~> 1.0)
random_password random_password (~> 0.1.1)
recaptcha recaptcha (~> 5.7.0)
redcarpet redcarpet (~> 3.5.1)
redis redis (~> 4.2.5)
remote_syslog_logger remote_syslog_logger (~> 1.0.4)
rspec-rails (~> 3.7) rspec-rails (~> 3.7)
rubocop rubocop (~> 1.10.0)
sassc-rails sassc-rails (~> 2.1.2)
sequel sequel (~> 5.41.0)
shoulda-matchers (~> 3.1) shoulda-matchers (~> 3.1)
spring spring (~> 2.1)
spring-watcher-listen (~> 2.0.0) spring-watcher-listen (~> 2.0)
sprockets (< 4.0.0) sprockets (~> 3.7.2)
sqlite3 (~> 1.3.6) sqlite3 (~> 1.3.6)
tabler-rubygem! tabler-rubygem!
turbolinks (~> 5) turbolinks (~> 5.2.1)
tzinfo-data tzinfo-data (~> 1.2021.1)
uglifier (>= 1.3.0) uglifier (~> 4.2.0)
web-console (>= 3.3.0) web-console (~> 3.7)
webmock webmock (~> 3.11)

View File

@ -41,7 +41,7 @@ class AccountActivationsController < ApplicationController
flash: { success: I18n.t("registration.approval.signup") } if @user.has_role?(:pending) flash: { success: I18n.t("registration.approval.signup") } if @user.has_role?(:pending)
# Redirect user to sign in path with success flash # Redirect user to sign in path with success flash
redirect_to signin_path, flash: { success: I18n.t("verify.activated") + " " + I18n.t("verify.signin") } redirect_to signin_path, flash: { success: "#{I18n.t('verify.activated')} #{I18n.t('verify.signin')}" }
else else
redirect_to root_path, flash: { alert: I18n.t("verify.invalid") } redirect_to root_path, flash: { alert: I18n.t("verify.invalid") }
end end

View File

@ -228,7 +228,7 @@ class AdminsController < ApplicationController
flash_message = I18n.t("administrator.flash.settings") flash_message = I18n.t("administrator.flash.settings")
if params[:value] == "Default Recording Visibility" if params[:value] == "Default Recording Visibility"
flash_message += ". " + I18n.t("administrator.site_settings.recording_visibility.warning") flash_message += ". #{I18n.t('administrator.site_settings.recording_visibility.warning')}"
end end
redirect_to admin_site_settings_path(tab: tab), flash: { success: flash_message } redirect_to admin_site_settings_path(tab: tab), flash: { success: flash_message }

View File

@ -29,13 +29,11 @@ class ApplicationController < ActionController::Base
def current_user def current_user
@current_user ||= User.includes(:role, :main_room).find_by(id: session[:user_id]) @current_user ||= User.includes(:role, :main_room).find_by(id: session[:user_id])
if Rails.configuration.loadbalanced_configuration if Rails.configuration.loadbalanced_configuration && (@current_user && !@current_user.has_role?(:super_admin) &&
if @current_user && !@current_user.has_role?(:super_admin) && @current_user.provider != @user_domain)
@current_user.provider != @user_domain
@current_user = nil @current_user = nil
session.clear session.clear
end end
end
@current_user @current_user
end end
@ -86,8 +84,8 @@ class ApplicationController < ActionController::Base
end end
maintenance_string = @settings.get_value("Maintenance Banner").presence || Rails.configuration.maintenance_window maintenance_string = @settings.get_value("Maintenance Banner").presence || Rails.configuration.maintenance_window
if maintenance_string.present? if maintenance_string.present? && cookies[:maintenance_window] != maintenance_string
flash.now[:maintenance] = maintenance_string unless cookies[:maintenance_window] == maintenance_string flash.now[:maintenance] = maintenance_string
end end
end end
@ -268,17 +266,18 @@ class ApplicationController < ActionController::Base
rescue => e rescue => e
logger.error "Error in retrieve provider info: #{e}" logger.error "Error in retrieve provider info: #{e}"
@hide_signin = true @hide_signin = true
if e.message.eql? "No user with that id exists" case e.message
when "No user with that id exists"
set_default_settings set_default_settings
render "errors/greenlight_error", locals: { message: I18n.t("errors.not_found.user_not_found.message"), render "errors/greenlight_error", locals: { message: I18n.t("errors.not_found.user_not_found.message"),
help: I18n.t("errors.not_found.user_not_found.help") } help: I18n.t("errors.not_found.user_not_found.help") }
elsif e.message.eql? "Provider not included." when "Provider not included."
set_default_settings set_default_settings
render "errors/greenlight_error", locals: { message: I18n.t("errors.not_found.user_missing.message"), render "errors/greenlight_error", locals: { message: I18n.t("errors.not_found.user_missing.message"),
help: I18n.t("errors.not_found.user_missing.help") } help: I18n.t("errors.not_found.user_missing.help") }
elsif e.message.eql? "That user has no configured provider." when "That user has no configured provider."
if Setting.exists?(provider: @user_domain) if Setting.exists?(provider: @user_domain)
# Keep the branding # Keep the branding
@settings = Setting.find_by(provider: @user_domain) @settings = Setting.find_by(provider: @user_domain)

View File

@ -113,7 +113,7 @@ module Authenticator
old_user.rooms.each do |room| old_user.rooms.each do |room|
room.owner = user room.owner = user
room.name = "Old " + room.name if room.id == old_user.main_room.id room.name = "Old #{room.name}" if room.id == old_user.main_room.id
room.save! room.save!
end end

View File

@ -123,9 +123,10 @@ module Rolify
:can_manage_rooms_recordings, :can_appear_in_share_list, :colour) :can_manage_rooms_recordings, :can_appear_in_share_list, :colour)
permission_params.transform_values! do |v| permission_params.transform_values! do |v|
if v == "0" case v
when "0"
"false" "false"
elsif v == "1" when "1"
"true" "true"
else else
v v

View File

@ -47,9 +47,7 @@ class HealthCheckController < ApplicationController
end end
def database_check def database_check
if defined?(ActiveRecord) raise "Database not responding" if defined?(ActiveRecord) && !ActiveRecord::Migrator.current_version
raise "Database not responding" unless ActiveRecord::Migrator.current_version
end
raise "Pending migrations" unless ActiveRecord::Migration.check_pending!.nil? raise "Pending migrations" unless ActiveRecord::Migration.check_pending!.nil?
end end
@ -61,9 +59,7 @@ class HealthCheckController < ApplicationController
settings = ActionMailer::Base.smtp_settings settings = ActionMailer::Base.smtp_settings
smtp = Net::SMTP.new(settings[:address], settings[:port]) smtp = Net::SMTP.new(settings[:address], settings[:port])
if settings[:enable_starttls_auto] == "true" smtp.enable_starttls_auto if settings[:enable_starttls_auto] == ("true") && smtp.respond_to?(:enable_starttls_auto)
smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto)
end
if settings[:authentication].present? && settings[:authentication] != "none" if settings[:authentication].present? && settings[:authentication] != "none"
smtp.start(settings[:domain]) do |s| smtp.start(settings[:domain]) do |s|

View File

@ -332,11 +332,11 @@ class RoomsController < ApplicationController
def create_room_settings_string(options) def create_room_settings_string(options)
room_settings = { room_settings = {
"muteOnStart": options[:mute_on_join] == "1", muteOnStart: options[:mute_on_join] == "1",
"requireModeratorApproval": options[:require_moderator_approval] == "1", requireModeratorApproval: options[:require_moderator_approval] == "1",
"anyoneCanStart": options[:anyone_can_start] == "1", anyoneCanStart: options[:anyone_can_start] == "1",
"joinModerator": options[:all_join_moderator] == "1", joinModerator: options[:all_join_moderator] == "1",
"recording": options[:recording] == "1", recording: options[:recording] == "1",
} }
room_settings.to_json room_settings.to_json

View File

@ -125,13 +125,14 @@ class SessionsController < ApplicationController
def ldap def ldap
ldap_config = {} ldap_config = {}
ldap_config[:host] = ENV['LDAP_SERVER'] ldap_config[:host] = ENV['LDAP_SERVER']
ldap_config[:port] = ENV['LDAP_PORT'].to_i != 0 ? ENV['LDAP_PORT'].to_i : 389 ldap_config[:port] = ENV['LDAP_PORT'].to_i.zero? ? 389 : ENV['LDAP_PORT'].to_i
ldap_config[:bind_dn] = ENV['LDAP_BIND_DN'] ldap_config[:bind_dn] = ENV['LDAP_BIND_DN']
ldap_config[:password] = ENV['LDAP_PASSWORD'] ldap_config[:password] = ENV['LDAP_PASSWORD']
ldap_config[:auth_method] = ENV['LDAP_AUTH'] ldap_config[:auth_method] = ENV['LDAP_AUTH']
ldap_config[:encryption] = if ENV['LDAP_METHOD'] == 'ssl' ldap_config[:encryption] = case ENV['LDAP_METHOD']
when 'ssl'
'simple_tls' 'simple_tls'
elsif ENV['LDAP_METHOD'] == 'tls' when 'tls'
'start_tls' 'start_tls'
end end
ldap_config[:base] = ENV['LDAP_BASE'] ldap_config[:base] = ENV['LDAP_BASE']

View File

@ -75,13 +75,14 @@ module ApplicationHelper
end end
def translated_role_name(role) def translated_role_name(role)
if role.name == "denied" case role.name
when "denied"
I18n.t("roles.banned") I18n.t("roles.banned")
elsif role.name == "pending" when "pending"
I18n.t("roles.pending") I18n.t("roles.pending")
elsif role.name == "admin" when "admin"
I18n.t("roles.admin") I18n.t("roles.admin")
elsif role.name == "user" when "user"
I18n.t("roles.user") I18n.t("roles.user")
else else
role.name role.name

View File

@ -44,7 +44,7 @@ module UsersHelper
# Returns language selection options for user edit # Returns language selection options for user edit
def language_options def language_options
locales = I18n.available_locales locales = I18n.available_locales
language_opts = [['<<<< ' + t("language_default") + ' >>>>', "default"]] language_opts = [["<<<< #{t('language_default')} >>>>", "default"]]
locales.each do |locale| locales.each do |locale|
language_mapping = I18n::Language::Mapping.language_mapping_list[locale.to_s.gsub("_", "-")] language_mapping = I18n::Language::Mapping.language_mapping_list[locale.to_s.gsub("_", "-")]
language_opts.push([language_mapping["nativeName"], locale.to_s]) language_opts.push([language_mapping["nativeName"], locale.to_s])

View File

@ -43,7 +43,7 @@ class UserMailer < ApplicationMailer
def user_promoted(user, role, url, settings) def user_promoted(user, role, url, settings)
@settings = settings @settings = settings
@url = url @url = url
@admin_url = url + "admins" @admin_url = "#{url}admins"
@image = logo_image @image = logo_image
@color = user_color @color = user_color
@role = translated_role_name(role) @role = translated_role_name(role)

View File

@ -41,7 +41,7 @@ class User < ApplicationRecord
validate :check_if_email_can_be_blank validate :check_if_email_can_be_blank
validates :email, length: { maximum: 256 }, allow_blank: true, validates :email, length: { maximum: 256 }, allow_blank: true,
uniqueness: { case_sensitive: false, scope: :provider }, uniqueness: { case_sensitive: false, scope: :provider },
format: { with: /\A[\w+\-\'.]+@[a-z\d\-.]+\.[a-z]+\z/i } format: { with: /\A[\w+\-'.]+@[a-z\d\-.]+\.[a-z]+\z/i }
validates :password, length: { minimum: 6 }, confirmation: true, if: :greenlight_account?, on: :create validates :password, length: { minimum: 6 }, confirmation: true, if: :greenlight_account?, on: :create

View File

@ -149,9 +149,10 @@ module Greenlight
config.primary_color_darken_default = "#316cbe" config.primary_color_darken_default = "#316cbe"
# Default registration method if the user does not specify one # Default registration method if the user does not specify one
config.registration_method_default = if ENV["DEFAULT_REGISTRATION"] == "invite" config.registration_method_default = case ENV["DEFAULT_REGISTRATION"]
when "invite"
config.registration_methods[:invite] config.registration_methods[:invite]
elsif ENV["DEFAULT_REGISTRATION"] == "approval" when "approval"
config.registration_methods[:approval] config.registration_methods[:approval]
else else
config.registration_methods[:open] config.registration_methods[:open]

View File

@ -148,7 +148,7 @@ Rails.application.configure do
config.log_tags = [:request_id] config.log_tags = [:request_id]
if ENV["RAILS_LOG_TO_STDOUT"] == "true" if ENV["RAILS_LOG_TO_STDOUT"] == "true"
logger = ActiveSupport::Logger.new(STDOUT) logger = ActiveSupport::Logger.new($stdout)
logger.formatter = config.log_formatter logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger) config.logger = ActiveSupport::TaggedLogging.new(logger)
elsif ENV["RAILS_LOG_REMOTE_NAME"] && ENV["RAILS_LOG_REMOTE_PORT"] elsif ENV["RAILS_LOG_REMOTE_NAME"] && ENV["RAILS_LOG_REMOTE_PORT"]

View File

@ -6,16 +6,16 @@
# the maximum value specified for Puma. Default is set to 5 threads for minimum # the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record. # and maximum; this matches the default thread size of Active Record.
# #
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
threads threads_count, threads_count threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests; default is 3000. # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
# #
port ENV.fetch("PORT") { 80 } port ENV.fetch("PORT", 80)
# Specifies the `environment` that Puma will run in. # Specifies the `environment` that Puma will run in.
# #
environment ENV.fetch("RAILS_ENV") { "development" } environment ENV.fetch("RAILS_ENV", "development")
# Specifies the number of `workers` to boot in clustered mode. # Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together # Workers are forked webserver processes. If using threads and workers together
@ -23,7 +23,7 @@ environment ENV.fetch("RAILS_ENV") { "development" }
# Workers do not work on JRuby or Windows (both of which do not support # Workers do not work on JRuby or Windows (both of which do not support
# processes). # processes).
# #
workers ENV.fetch("WEB_CONCURRENCY") { 1 } workers ENV.fetch("WEB_CONCURRENCY", 1)
# Use the `preload_app!` method when specifying a `workers` number. # Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code # This directive tells Puma to first boot the application and load code

View File

@ -12,15 +12,16 @@ class AddCustomRoles < ActiveRecord::Migration[5.2]
# Determine what ids corresponded to what roles in the old table # Determine what ids corresponded to what roles in the old table
old_roles.each do |role| old_roles.each do |role|
if role["name"] == "super_admin" case role["name"]
when "super_admin"
super_admin_id = role["id"] super_admin_id = role["id"]
elsif role["name"] == "user" when "user"
user_id = role["id"] user_id = role["id"]
elsif role["name"] == "admin" when "admin"
admin_id = role["id"] admin_id = role["id"]
elsif role["name"] == "denied" when "denied"
denied_id = role["id"] denied_id = role["id"]
elsif role["name"] == "pending" when "pending"
pending_id = role["id"] pending_id = role["id"]
end end
end end

View File

@ -33,7 +33,7 @@ module BbbApi
# Build the URI. # Build the URI.
uri = encode_bbb_url( uri = encode_bbb_url(
Rails.configuration.loadbalancer_endpoint + api + '/', "#{Rails.configuration.loadbalancer_endpoint}#{api}/",
Rails.configuration.loadbalancer_secret, Rails.configuration.loadbalancer_secret,
{ name: provider }, { name: provider },
route route

View File

@ -20,11 +20,11 @@ module OmniauthOptions
module_function module_function
def omniauth_options(env) def omniauth_options(env)
if env['omniauth.strategy'].options[:name] == "bn_launcher" case env['omniauth.strategy'].options[:name]
when "bn_launcher"
protocol = Rails.env.production? ? "https" : env["rack.url_scheme"] protocol = Rails.env.production? ? "https" : env["rack.url_scheme"]
customer_redirect_url = protocol + "://" + env["SERVER_NAME"] + ":" + customer_redirect_url = "#{protocol}://#{env['SERVER_NAME']}:#{env['SERVER_PORT']}"
env["SERVER_PORT"]
user_domain = parse_user_domain(env["SERVER_NAME"]) user_domain = parse_user_domain(env["SERVER_NAME"])
env['omniauth.strategy'].options[:customer] = user_domain env['omniauth.strategy'].options[:customer] = user_domain
env['omniauth.strategy'].options[:customer_redirect_url] = customer_redirect_url env['omniauth.strategy'].options[:customer_redirect_url] = customer_redirect_url
@ -33,11 +33,11 @@ module OmniauthOptions
# This is only used in the old launcher and should eventually be removed # This is only used in the old launcher and should eventually be removed
env['omniauth.strategy'].options[:checksum] = generate_checksum(user_domain, customer_redirect_url, env['omniauth.strategy'].options[:checksum] = generate_checksum(user_domain, customer_redirect_url,
Rails.configuration.launcher_secret) Rails.configuration.launcher_secret)
elsif env['omniauth.strategy'].options[:name] == "google" when "google"
set_hd(env, ENV['GOOGLE_OAUTH2_HD']) set_hd(env, ENV['GOOGLE_OAUTH2_HD'])
elsif env['omniauth.strategy'].options[:name] == "office365" when "office365"
set_hd(env, ENV['OFFICE365_HD']) set_hd(env, ENV['OFFICE365_HD'])
elsif env['omniauth.strategy'].options[:name] == "openid_connect" when "openid_connect"
set_hd(env, ENV['OPENID_CONNECT_HD']) set_hd(env, ENV['OPENID_CONNECT_HD'])
end end
end end

View File

@ -20,7 +20,7 @@ namespace :office365 do
old_user.save! old_user.save!
else else
old_main_room = old_user.main_room old_main_room = old_user.main_room
old_main_room.name = "Old " + old_main_room.name old_main_room.name = "Old #{old_main_room.name}"
old_main_room.save! old_main_room.save!
new_user.rooms << old_user.rooms new_user.rooms << old_user.rooms

View File

@ -39,7 +39,7 @@ namespace :room do
next if room.uid.split("-").length > 3 next if room.uid.split("-").length > 3
begin begin
new_uid = room.uid + "-" + SecureRandom.alphanumeric(3).downcase new_uid = "#{room.uid}-#{SecureRandom.alphanumeric(3).downcase}"
puts "Updating #{room.uid} to #{new_uid}" puts "Updating #{room.uid} to #{new_uid}"
room.update_attributes(uid: new_uid) room.update_attributes(uid: new_uid)
rescue => e rescue => e

View File

@ -35,7 +35,10 @@ namespace :user do
u[:email].prepend "superadmin-" if args[:role] == "super_admin" u[:email].prepend "superadmin-" if args[:role] == "super_admin"
# Create account if it doesn't exist # Create account if it doesn't exist
if !User.exists?(email: u[:email], provider: u[:provider]) if User.exists?(email: u[:email], provider: u[:provider])
puts "Account with that email already exists"
puts "Email: #{u[:email]}"
else
user = User.create(name: u[:name], email: u[:email], password: u[:password], user = User.create(name: u[:name], email: u[:email], password: u[:password],
provider: u[:provider], email_verified: true, accepted_terms: true) provider: u[:provider], email_verified: true, accepted_terms: true)
@ -52,9 +55,6 @@ namespace :user do
puts "Password: #{u[:password]}" puts "Password: #{u[:password]}"
puts "Role: #{u[:role]}" puts "Role: #{u[:role]}"
puts "PLEASE CHANGE YOUR PASSWORD IMMEDIATELY" if u[:password] == Rails.configuration.admin_password_default puts "PLEASE CHANGE YOUR PASSWORD IMMEDIATELY" if u[:password] == Rails.configuration.admin_password_default
else
puts "Account with that email already exists"
puts "Email: #{u[:email]}"
end end
end end
end end

View File

@ -182,8 +182,8 @@ describe RoomsController, type: :controller do
@request.session[:user_id] = @owner.id @request.session[:user_id] = @owner.id
name = Faker::Games::Pokemon.name name = Faker::Games::Pokemon.name
room_params = { name: name, "mute_on_join": "1", room_params = { name: name, mute_on_join: "1",
"require_moderator_approval": "1", "anyone_can_start": "1", "all_join_moderator": "1" } require_moderator_approval: "1", anyone_can_start: "1", all_join_moderator: "1" }
json_room_settings = "{\"muteOnStart\":true,\"requireModeratorApproval\":true," \ json_room_settings = "{\"muteOnStart\":true,\"requireModeratorApproval\":true," \
"\"anyoneCanStart\":true,\"joinModerator\":true,\"recording\":false}" "\"anyoneCanStart\":true,\"joinModerator\":true,\"recording\":false}"
@ -199,8 +199,8 @@ describe RoomsController, type: :controller do
it "should respond with JSON object of the room_settings" do it "should respond with JSON object of the room_settings" do
@request.session[:user_id] = @owner.id @request.session[:user_id] = @owner.id
@owner.main_room.update_attribute(:room_settings, { "muteOnStart": true, "requireModeratorApproval": true, @owner.main_room.update_attribute(:room_settings, { muteOnStart: true, requireModeratorApproval: true,
"anyoneCanStart": true, "joinModerator": true }.to_json) anyoneCanStart: true, joinModerator: true }.to_json)
json_room_settings = { "anyoneCanStart" => true, json_room_settings = { "anyoneCanStart" => true,
"joinModerator" => true, "joinModerator" => true,
@ -224,7 +224,7 @@ describe RoomsController, type: :controller do
it "should redirect back to main room with error if it fails" do it "should redirect back to main room with error if it fails" do
@request.session[:user_id] = @owner.id @request.session[:user_id] = @owner.id
room_params = { name: "", "mute_on_join": "1" } room_params = { name: "", mute_on_join: "1" }
post :create, params: { room: room_params } post :create, params: { room: room_params }
@ -237,7 +237,7 @@ describe RoomsController, type: :controller do
@request.session[:user_id] = @owner.id @request.session[:user_id] = @owner.id
room_params = { name: Faker::Games::Pokemon.name, "mute_on_join": "1" } room_params = { name: Faker::Games::Pokemon.name, mute_on_join: "1" }
post :create, params: { room: room_params } post :create, params: { room: room_params }
@ -583,7 +583,7 @@ describe RoomsController, type: :controller do
@request.session[:user_id] = @user.id @request.session[:user_id] = @user.id
name = Faker::Name.first_name name = Faker::Name.first_name
room_params = { room_uid: @secondary_room.uid, room: { "name": name } } room_params = { room_uid: @secondary_room.uid, room: { name: name } }
expect { post :update_settings, params: room_params }.to change { @secondary_room.reload.name } expect { post :update_settings, params: room_params }.to change { @secondary_room.reload.name }
.from(@secondary_room.name).to(name) .from(@secondary_room.name).to(name)
@ -593,7 +593,7 @@ describe RoomsController, type: :controller do
it "properly updates room settings through the room settings modal and redirects to current page" do it "properly updates room settings through the room settings modal and redirects to current page" do
@request.session[:user_id] = @user.id @request.session[:user_id] = @user.id
room_params = { "mute_on_join": "1", "name": @secondary_room.name, "recording": "1" } room_params = { mute_on_join: "1", name: @secondary_room.name, recording: "1" }
formatted_room_params = "{\"muteOnStart\":true,\"requireModeratorApproval\":false," \ formatted_room_params = "{\"muteOnStart\":true,\"requireModeratorApproval\":false," \
"\"anyoneCanStart\":false,\"joinModerator\":false,\"recording\":true}" # JSON string format "\"anyoneCanStart\":false,\"joinModerator\":false,\"recording\":true}" # JSON string format
@ -616,7 +616,7 @@ describe RoomsController, type: :controller do
@admin.set_role :admin @admin.set_role :admin
@request.session[:user_id] = @admin.id @request.session[:user_id] = @admin.id
room_params = { "mute_on_join": "1", "name": @secondary_room.name } room_params = { mute_on_join: "1", name: @secondary_room.name }
formatted_room_params = "{\"muteOnStart\":true,\"requireModeratorApproval\":false," \ formatted_room_params = "{\"muteOnStart\":true,\"requireModeratorApproval\":false," \
"\"anyoneCanStart\":false,\"joinModerator\":false,\"recording\":false}" # JSON string format "\"anyoneCanStart\":false,\"joinModerator\":false,\"recording\":false}" # JSON string format
@ -632,7 +632,7 @@ describe RoomsController, type: :controller do
@admin.set_role :admin @admin.set_role :admin
@request.session[:user_id] = @admin.id @request.session[:user_id] = @admin.id
room_params = { "mute_on_join": "1", "name": @secondary_room.name } room_params = { mute_on_join: "1", name: @secondary_room.name }
expect { post :update_settings, params: { room_uid: @secondary_room.uid, room: room_params } } expect { post :update_settings, params: { room_uid: @secondary_room.uid, room: room_params } }
.not_to change { @secondary_room.reload.room_settings } .not_to change { @secondary_room.reload.room_settings }

View File

@ -416,7 +416,7 @@ describe UsersController, type: :controller do
tmp_role1.update_permission("send_promoted_email", "true") tmp_role1.update_permission("send_promoted_email", "true")
params = random_valid_user_params params = random_valid_user_params
params = params.merge!(user_uid: user, user: { role_id: tmp_role1.id.to_s }) params.merge!(user_uid: user, user: { role_id: tmp_role1.id.to_s })
expect { post :update, params: params }.to change { ActionMailer::Base.deliveries.count }.by(1) expect { post :update, params: params }.to change { ActionMailer::Base.deliveries.count }.by(1)
@ -440,7 +440,7 @@ describe UsersController, type: :controller do
@request.session[:user_id] = admin.id @request.session[:user_id] = admin.id
params = random_valid_user_params params = random_valid_user_params
params = params.merge!(user_uid: user, user: { role_id: new_role.id.to_s }) params.merge!(user_uid: user, user: { role_id: new_role.id.to_s })
expect(user.role.name).to eq("test1") expect(user.role.name).to eq("test1")
expect(user.main_room).to be_nil expect(user.main_room).to be_nil
@ -503,7 +503,7 @@ describe UsersController, type: :controller do
user: { user: {
password: "incorrect_password", password: "incorrect_password",
new_password: @password, new_password: @password,
password_confirmation: @password + "_random_string", password_confirmation: "#{@password}_random_string",
} }
} }
post :update_password, params: params.merge!(user_uid: @user) post :update_password, params: params.merge!(user_uid: @user)

View File

@ -54,27 +54,27 @@ RSpec.configure do |config|
.with( .with(
headers: headers:
{ {
'Accept': '*/*', Accept: '*/*',
'Accept-Encoding': 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Accept-Encoding': 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent': 'Ruby', 'User-Agent': 'Ruby',
} }
) )
.to_return(status: 200, body: "", headers: {}) .to_return(status: 200, body: "", headers: {})
stub_request(:any, /#{ENV['LOADBALANCER_ENDPOINT'] + 'api'}/) stub_request(:any, /#{"#{ENV['LOADBALANCER_ENDPOINT']}api"}/)
.with( .with(
headers: headers:
{ {
'Accept': '*/*', Accept: '*/*',
'Accept-Encoding': 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Accept-Encoding': 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent': 'Ruby', 'User-Agent': 'Ruby',
} }
) )
.to_return(status: 200, body: "", headers: {}) if ENV['LOADBALANCER_ENDPOINT'] .to_return(status: 200, body: "", headers: {}) if ENV['LOADBALANCER_ENDPOINT']
stub_request(:any, /#{ENV['LOADBALANCER_ENDPOINT'] + 'api\/getUser'}/) stub_request(:any, /#{"#{ENV['LOADBALANCER_ENDPOINT']}api\\/getUser"}/)
.with( .with(
headers: headers:
{ {
'Accept': '*/*', Accept: '*/*',
'Accept-Encoding': 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Accept-Encoding': 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent': 'Ruby', 'User-Agent': 'Ruby',
} }
@ -90,11 +90,11 @@ RSpec.configure do |config|
<secret>secret</secret> <secret>secret</secret>
</user> </user>
</response>", headers: {}) if ENV['LOADBALANCER_ENDPOINT'] </response>", headers: {}) if ENV['LOADBALANCER_ENDPOINT']
stub_request(:any, /#{ENV['LOADBALANCER_ENDPOINT'] + 'api2\/getUserGreenlightCredentials'}/) stub_request(:any, /#{"#{ENV['LOADBALANCER_ENDPOINT']}api2\\/getUserGreenlightCredentials"}/)
.with( .with(
headers: headers:
{ {
'Accept': '*/*', Accept: '*/*',
'Accept-Encoding': 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Accept-Encoding': 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent': 'Ruby', 'User-Agent': 'Ruby',
} }

View File

@ -2,6 +2,7 @@
class UserMailerPreview < ActionMailer::Preview class UserMailerPreview < ActionMailer::Preview
def initialize(_params) def initialize(_params)
super
@logo = "https://raw.githubusercontent.com/bigbluebutton/greenlight/master/app/assets/images/logo_with_text.png" @logo = "https://raw.githubusercontent.com/bigbluebutton/greenlight/master/app/assets/images/logo_with_text.png"
@color = "#467fcf" @color = "#467fcf"
end end
@ -11,7 +12,7 @@ class UserMailerPreview < ActionMailer::Preview
def password_reset def password_reset
user = User.first user = User.first
user.reset_token = User.new_token user.reset_token = User.new_token
url = "http://example.com" + "/password_resets/" + user.reset_token + "/edit?email=" + user.email url = "http://example.com/password_resets/#{user.reset_token}/edit?email=#{user.email}"
UserMailer.password_reset(user, url, @logo, @color) UserMailer.password_reset(user, url, @logo, @color)
end end
@ -19,7 +20,7 @@ class UserMailerPreview < ActionMailer::Preview
# http://localhost:3000/rails/mailers/user_mailer/verify_email # http://localhost:3000/rails/mailers/user_mailer/verify_email
def verify_email def verify_email
user = User.first user = User.first
url = "http://example.com" + "/u/verify/confirm/" + user.uid url = "http://example.com/u/verify/confirm/#{user.uid}"
UserMailer.verify_email(user, url, @logo, @color) UserMailer.verify_email(user, url, @logo, @color)
end end

View File