forked from External/greenlight
Merge pull request #4 from joshua-arts/loadbalanced
Add ability to launch through a loadbalanced BBB configuration.
This commit is contained in:
commit
924ba7256b
|
@ -141,13 +141,12 @@ class Room < ApplicationRecord
|
|||
|
||||
# Sets a BigBlueButtonApi object for interacting with the API.
|
||||
def bbb
|
||||
@bbb ||= BigBlueButton::BigBlueButtonApi.new(remove_slash(bbb_endpoint), bbb_secret, "0.8")
|
||||
# @bbb ||= if Rails.configuration.loadbalanced_configuration
|
||||
# lb_user = retrieve_loadbalanced_credentials(self.room.owner.provider)
|
||||
# BigBlueButton::BigBlueButtonApi.new(remove_slash(lb_user["apiURL"]), lb_user["secret"], "0.8")
|
||||
# else
|
||||
# BigBlueButton::BigBlueButtonApi.new(remove_slash(bbb_endpoint), bbb_secret, "0.8")
|
||||
# end
|
||||
@bbb ||= if Rails.configuration.loadbalanced_configuration
|
||||
lb_user = retrieve_loadbalanced_credentials(owner.provider)
|
||||
BigBlueButton::BigBlueButtonApi.new(remove_slash(lb_user["apiURL"]), lb_user["secret"], "0.8")
|
||||
else
|
||||
BigBlueButton::BigBlueButtonApi.new(remove_slash(bbb_endpoint), bbb_secret, "0.8")
|
||||
end
|
||||
end
|
||||
|
||||
# Generates a uid for the room and BigBlueButton.
|
||||
|
@ -174,7 +173,7 @@ class Room < ApplicationRecord
|
|||
|
||||
# Build the URI.
|
||||
uri = encode_bbb_url(
|
||||
Rails.configuration.loadbalancer_endpoint,
|
||||
Rails.configuration.loadbalancer_endpoint + "getUser",
|
||||
Rails.configuration.loadbalancer_secret,
|
||||
name: provider
|
||||
)
|
||||
|
|
|
@ -17,7 +17,7 @@ module Greenlight
|
|||
# Use custom error routes.
|
||||
config.exceptions_app = routes
|
||||
|
||||
config.loadbalanced_configuration = (ENV["USE_LOADBALANCED_CONFIGURATION"] == "true")
|
||||
config.loadbalanced_configuration = ENV["LOADBALANCER_ENDPOINT"].present? && ENV["LOADBALANCER_SECRET"].present?
|
||||
|
||||
# Setup BigBlueButton configuration.
|
||||
if config.loadbalanced_configuration
|
||||
|
|
Loading…
Reference in New Issue