forked from External/greenlight
		
	bbb_endpoint and bbb_secret can be configured with environment variables
This commit is contained in:
		
							
								
								
									
										1
									
								
								Gemfile
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								Gemfile
									
									
									
									
									
								
							@@ -33,7 +33,6 @@ gem 'jbuilder', '~> 2.5'
 | 
				
			|||||||
group :development, :test do
 | 
					group :development, :test do
 | 
				
			||||||
  # For environment configuration
 | 
					  # For environment configuration
 | 
				
			||||||
  gem 'dotenv-rails'
 | 
					  gem 'dotenv-rails'
 | 
				
			||||||
 | 
					 | 
				
			||||||
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
 | 
					  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
 | 
				
			||||||
  gem 'byebug', platform: :mri
 | 
					  gem 'byebug', platform: :mri
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,19 +1,10 @@
 | 
				
			|||||||
module ApplicationHelper
 | 
					module ApplicationHelper
 | 
				
			||||||
  def bbb_endpoint
 | 
					  def bbb_endpoint
 | 
				
			||||||
    logger.info APP_CONFIG
 | 
					    Rails.application.secrets[:bbb_endpoint]
 | 
				
			||||||
    #if ((defined? APP_CONFIG).to_s == 'constant') && (APP_CONFIG.has_key?('bbb_endpoint'))
 | 
					 | 
				
			||||||
    #  APP_CONFIG['bbb_endpoint']
 | 
					 | 
				
			||||||
    #else
 | 
					 | 
				
			||||||
      'http://test-install.blindsidenetworks.com/bigbluebutton/'
 | 
					 | 
				
			||||||
    #end
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def bbb_secret
 | 
					  def bbb_secret
 | 
				
			||||||
    #if (defined? APP_CONFIG).to_s == 'constant' && (APP_CONFIG.has_key? 'bbb_secret')
 | 
					    Rails.application.secrets[:bbb_secret]
 | 
				
			||||||
    #  APP_CONFIG['bbb_secret']
 | 
					 | 
				
			||||||
    #else
 | 
					 | 
				
			||||||
      '8cd8ef52e8e101574e400365b55e11a6'
 | 
					 | 
				
			||||||
    #end
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def random_password(length)
 | 
					  def random_password(length)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,5 +32,4 @@ module BbbHelper
 | 
				
			|||||||
      return { :returncode => true, :join_url => join_url, :messageKey => "", :message => "" }
 | 
					      return { :returncode => true, :join_url => join_url, :messageKey => "", :message => "" }
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +0,0 @@
 | 
				
			|||||||
default:
 | 
					 | 
				
			||||||
  bbb_endpoint: <%= ENV['BIGBLUEBUTTON_ENDPOINT'] %>
 | 
					 | 
				
			||||||
  bbb_secret: <%= ENV['BIGBLUEBUTTON_SECRET'] %>
 | 
					 | 
				
			||||||
@@ -1 +0,0 @@
 | 
				
			|||||||
APP_CONFIG = YAML.load_file("#{Rails.root}/config/config.yml")[Rails.env]
 | 
					 | 
				
			||||||
@@ -10,13 +10,20 @@
 | 
				
			|||||||
# Make sure the secrets in this file are kept private
 | 
					# Make sure the secrets in this file are kept private
 | 
				
			||||||
# if you're sharing your code publicly.
 | 
					# if you're sharing your code publicly.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					default: &default
 | 
				
			||||||
 | 
					  bbb_endpoint: <%= ENV['BIGBLUEBUTTON_ENDPOINT'] %>
 | 
				
			||||||
 | 
					  bbb_secret: <%= ENV['BIGBLUEBUTTON_SECRET'] %>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
development:
 | 
					development:
 | 
				
			||||||
 | 
					  <<: *default
 | 
				
			||||||
  secret_key_base: d7d93ffde4e0eb407fd82d5ae207445834d2cef5acbfc2d42fa10be44f94a8342c82d2c9b4785e1e2ec9d135b7cd3dda443ea3da732ffb8ba182368f0909cfa5
 | 
					  secret_key_base: d7d93ffde4e0eb407fd82d5ae207445834d2cef5acbfc2d42fa10be44f94a8342c82d2c9b4785e1e2ec9d135b7cd3dda443ea3da732ffb8ba182368f0909cfa5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test:
 | 
					test:
 | 
				
			||||||
 | 
					  <<: *default
 | 
				
			||||||
  secret_key_base: 16b4c8a9b05f13aa2430fbe55cc675a7b323deedaceb761e6fbb5aace1353354b14813ad58e71db07e5345934713bcf3401c62dce79696574ddece2b5360d953
 | 
					  secret_key_base: 16b4c8a9b05f13aa2430fbe55cc675a7b323deedaceb761e6fbb5aace1353354b14813ad58e71db07e5345934713bcf3401c62dce79696574ddece2b5360d953
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Do not keep production secrets in the repository,
 | 
					# Do not keep production secrets in the repository,
 | 
				
			||||||
# instead read values from the environment.
 | 
					# instead read values from the environment.
 | 
				
			||||||
production:
 | 
					production:
 | 
				
			||||||
 | 
					  <<: *default
 | 
				
			||||||
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
 | 
					  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,3 +12,6 @@ TWITTER_ID=
 | 
				
			|||||||
TWITTER_SECRET=
 | 
					TWITTER_SECRET=
 | 
				
			||||||
GOOGLE_OAUTH2_ID=
 | 
					GOOGLE_OAUTH2_ID=
 | 
				
			||||||
GOOGLE_OAUTH2_SECRET=
 | 
					GOOGLE_OAUTH2_SECRET=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# For production
 | 
				
			||||||
 | 
					SECRET_KEY_BASE=
 | 
				
			||||||
		Reference in New Issue
	
	Block a user