diff --git a/config/application.rb b/config/application.rb index c678a12fe8e0efa7b0e907b76880561868e31c5b..d23746fd7a09e0c9c423a20e56a7cdcf2da2d30b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -51,10 +51,6 @@ module Greenlight # The default callback url that bn launcher will redirect to config.gl_callback_url = ENV["GL_CALLBACK_URL"] - # Greenlight V3 variables: - config.v3_endpoint = ENV["V3_ENDPOINT"] - config.v3_secret_key_base = ENV["V3_SECRET_KEY_BASE"] - # Default credentials (test-install.blindsidenetworks.com/bigbluebutton). config.bigbluebutton_endpoint_default = "http://test-install.blindsidenetworks.com/bigbluebutton/api/" config.bigbluebutton_secret_default = "8cd8ef52e8e101574e400365b55e11a6" diff --git a/lib/tasks/migrations/migrations.rake b/lib/tasks/migrations/migrations.rake index d012f95ce22974ce27b61a49819efcc9744d1c2b..bced060d57e0bf59e863e4b1a3b6e29b0ed0e191 100644 --- a/lib/tasks/migrations/migrations.rake +++ b/lib/tasks/migrations/migrations.rake @@ -4,7 +4,7 @@ namespace :migrations do DEFAULT_ROLES_MAP = { "admin" => "Administrator", "user" => "User" }.freeze COMMON = { headers: { "Content-Type" => "application/json" }, - batch_size: 1000, + batch_size: 500, }.freeze desc "Migrates v2 resources to v3" @@ -116,25 +116,23 @@ namespace :migrations do private def encrypt_params(params) - unless Rails.configuration.v3_secret_key_base.present? + unless ENV["V3_SECRET_KEY_BASE"].present? raise red 'Unable to migrate: No "V3_SECRET_KEY_BASE" provided, please check your .env file.' end - unless Rails.configuration.v3_secret_key_base.size >= 32 + unless ENV["V3_SECRET_KEY_BASE"].size >= 32 raise red 'Unable to migrate: Provided "V3_SECRET_KEY_BASE" must be at least 32 charchters in length.' end - key = Rails.configuration.v3_secret_key_base[0..31] + key = ENV["V3_SECRET_KEY_BASE"][0..31] crypt = ActiveSupport::MessageEncryptor.new(key, cipher: 'aes-256-gcm', serializer: Marshal) crypt.encrypt_and_sign(params, expires_in: 10.seconds) end def uri(path) - unless Rails.configuration.v3_endpoint.present? - raise red 'Unable to migrate: No "V3_ENDPOINT" provided, please check your .env file.' - end + raise red 'Unable to migrate: No "V3_ENDPOINT" provided, please check your .env file.' unless ENV["V3_ENDPOINT"].present? - res = URI(Rails.configuration.v3_endpoint) + res = URI(ENV["V3_ENDPOINT"]) res.path = "/api/v1/migrations/#{path}.json" res end