Merge pull request #183 from jfederico/updates

Updates to the environment variables
This commit is contained in:
Jesus Federico 2017-08-15 16:41:05 -04:00 committed by GitHub
commit 0719cbd1bf
15 changed files with 319 additions and 306 deletions

View File

@ -1,6 +1,6 @@
source 'https://rubygems.org' source 'https://rubygems.org'
ruby '2.3.4' ruby '2.4.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1' gem 'rails', '~> 5.0.0', '>= 5.0.0.1'

View File

@ -1,39 +1,39 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actioncable (5.0.0.1) actioncable (5.0.5)
actionpack (= 5.0.0.1) actionpack (= 5.0.5)
nio4r (~> 1.2) nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1) websocket-driver (~> 0.6.1)
actionmailer (5.0.0.1) actionmailer (5.0.5)
actionpack (= 5.0.0.1) actionpack (= 5.0.5)
actionview (= 5.0.0.1) actionview (= 5.0.5)
activejob (= 5.0.0.1) activejob (= 5.0.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.0.0.1) actionpack (5.0.5)
actionview (= 5.0.0.1) actionview (= 5.0.5)
activesupport (= 5.0.0.1) activesupport (= 5.0.5)
rack (~> 2.0) rack (~> 2.0)
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.0.0.1) actionview (5.0.5)
activesupport (= 5.0.0.1) activesupport (= 5.0.5)
builder (~> 3.1) builder (~> 3.1)
erubis (~> 2.7.0) erubis (~> 2.7.0)
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.3)
activejob (5.0.0.1) activejob (5.0.5)
activesupport (= 5.0.0.1) activesupport (= 5.0.5)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.0.0.1) activemodel (5.0.5)
activesupport (= 5.0.0.1) activesupport (= 5.0.5)
activerecord (5.0.0.1) activerecord (5.0.5)
activemodel (= 5.0.0.1) activemodel (= 5.0.5)
activesupport (= 5.0.0.1) activesupport (= 5.0.5)
arel (~> 7.0) arel (~> 7.0)
activesupport (5.0.0.1) activesupport (5.0.5)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7) i18n (~> 0.7)
minitest (~> 5.1) minitest (~> 5.1)
@ -41,67 +41,73 @@ GEM
arel (7.1.4) arel (7.1.4)
bigbluebutton-api-ruby (1.6.0) bigbluebutton-api-ruby (1.6.0)
xml-simple (~> 1.1) xml-simple (~> 1.1)
bindex (0.5.0)
bootstrap-sass (3.3.0.0) bootstrap-sass (3.3.0.0)
sass (~> 3.2) sass (~> 3.2)
bootstrap-social-rails (4.12.0) bootstrap-social-rails (4.12.0)
railties (>= 3.1) railties (>= 3.1)
builder (3.2.2) builder (3.2.3)
byebug (9.0.6) byebug (9.0.6)
climate_control (0.1.0) climate_control (0.2.0)
cocaine (0.5.8) cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0) climate_control (>= 0.0.3, < 1.0)
coffee-rails (4.2.1) coffee-rails (4.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.2.x) railties (>= 4.0.0)
coffee-script (2.4.1) coffee-script (2.4.1)
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.10.0) coffee-script-source (1.12.2)
concurrent-ruby (1.0.2) concurrent-ruby (1.0.5)
debug_inspector (0.0.2) concurrent-ruby (1.0.5-java)
docile (1.1.5) docile (1.1.5)
dotenv (2.1.1) dotenv (2.2.1)
dotenv-rails (2.1.1) dotenv-rails (2.2.1)
dotenv (= 2.1.1) dotenv (= 2.2.1)
railties (>= 4.0, < 5.1) railties (>= 3.2, < 5.2)
erubis (2.7.0) erubis (2.7.0)
execjs (2.7.0) execjs (2.7.0)
faraday (0.9.2) faraday (0.12.2)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
ffi (1.9.14) ffi (1.9.18)
ffi (1.9.18-java)
ffi (1.9.18-x64-mingw32)
ffi (1.9.18-x86-mingw32)
font-awesome-sass (4.7.0) font-awesome-sass (4.7.0)
sass (>= 3.2) sass (>= 3.2)
globalid (0.3.7) globalid (0.4.0)
activesupport (>= 4.1.0) activesupport (>= 4.2.0)
hashie (3.4.4) hashie (3.5.6)
http_accept_language (2.1.0) http_accept_language (2.1.1)
i18n (0.7.0) i18n (0.8.6)
jbuilder (2.6.0) jbuilder (2.7.0)
activesupport (>= 3.0.0, < 5.1) activesupport (>= 4.2.0)
multi_json (~> 1.2) multi_json (>= 1.2)
jquery-datatables-rails (3.4.0) jquery-datatables-rails (3.4.0)
actionpack (>= 3.1) actionpack (>= 3.1)
jquery-rails jquery-rails
railties (>= 3.1) railties (>= 3.1)
sass-rails sass-rails
jquery-rails (4.2.1) jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3) rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.5) jquery-ui-rails (6.0.1)
railties (>= 3.2.16) railties (>= 3.2.16)
json (1.8.3) json (1.8.6)
jwt (1.5.4) json (1.8.6-java)
jwt (1.5.6)
listen (3.0.8) listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
lograge (0.4.1) lograge (0.6.0)
actionpack (>= 4, < 5.1) actionpack (>= 4, < 5.2)
activesupport (>= 4, < 5.1) activesupport (>= 4, < 5.2)
railties (>= 4, < 5.1) railties (>= 4, < 5.2)
request_store (~> 1.0)
loofah (2.0.3) loofah (2.0.3)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
mail (2.6.4) mail (2.6.6)
mime-types (>= 1.16, < 4) mime-types (>= 1.16, < 4)
metaclass (0.0.4) metaclass (0.0.4)
method_source (0.8.2) method_source (0.8.2)
@ -109,20 +115,26 @@ GEM
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521) mime-types-data (3.2016.0521)
mimemagic (0.3.0) mimemagic (0.3.0)
mini_portile2 (2.1.0) mini_portile2 (2.2.0)
minitest (5.9.1) minitest (5.10.3)
mocha (1.2.1) mocha (1.2.1)
metaclass (~> 0.0.1) metaclass (~> 0.0.1)
multi_json (1.12.1) multi_json (1.12.1)
multi_xml (0.5.5) multi_xml (0.6.0)
multipart-post (2.0.0) multipart-post (2.0.0)
net-ldap (0.16.0) net-ldap (0.16.0)
nio4r (1.2.1) nio4r (2.1.0)
nokogiri (1.6.8.1) nio4r (2.1.0-java)
mini_portile2 (~> 2.1.0) nokogiri (1.8.0)
oauth (0.5.1) mini_portile2 (~> 2.2.0)
oauth2 (1.2.0) nokogiri (1.8.0-java)
faraday (>= 0.8, < 0.10) nokogiri (1.8.0-x64-mingw32)
mini_portile2 (~> 2.2.0)
nokogiri (1.8.0-x86-mingw32)
mini_portile2 (~> 2.2.0)
oauth (0.5.3)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
jwt (~> 1.0) jwt (~> 1.0)
multi_json (~> 1.3) multi_json (~> 1.3)
multi_xml (~> 0.5) multi_xml (~> 0.5)
@ -155,85 +167,101 @@ GEM
cocaine (~> 0.5.5) cocaine (~> 0.5.5)
mime-types mime-types
mimemagic (= 0.3.0) mimemagic (= 0.3.0)
pg (0.19.0) pg (0.21.0)
puma (3.6.0) pg (0.21.0-x64-mingw32)
pg (0.21.0-x86-mingw32)
puma (3.9.1)
puma (3.9.1-java)
pyu-ruby-sasl (0.0.3.3) pyu-ruby-sasl (0.0.3.3)
rack (2.0.1) rack (2.0.3)
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (5.0.0.1) rails (5.0.5)
actioncable (= 5.0.0.1) actioncable (= 5.0.5)
actionmailer (= 5.0.0.1) actionmailer (= 5.0.5)
actionpack (= 5.0.0.1) actionpack (= 5.0.5)
actionview (= 5.0.0.1) actionview (= 5.0.5)
activejob (= 5.0.0.1) activejob (= 5.0.5)
activemodel (= 5.0.0.1) activemodel (= 5.0.5)
activerecord (= 5.0.0.1) activerecord (= 5.0.5)
activesupport (= 5.0.0.1) activesupport (= 5.0.5)
bundler (>= 1.3.0, < 2.0) bundler (>= 1.3.0)
railties (= 5.0.0.1) railties (= 5.0.5)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.1) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0, < 6.0) activesupport (>= 4.2.0)
nokogiri (~> 1.6.0) nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3) rails-html-sanitizer (1.0.3)
loofah (~> 2.0) loofah (~> 2.0)
rails-timeago (2.15.0) rails-timeago (2.16.0)
actionpack (>= 3.1) actionpack (>= 3.1)
activesupport (>= 3.1) activesupport (>= 3.1)
railties (5.0.0.1) railties (5.0.5)
actionpack (= 5.0.0.1) actionpack (= 5.0.5)
activesupport (= 5.0.0.1) activesupport (= 5.0.5)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rake (11.3.0) rake (12.0.0)
rb-fsevent (0.9.7) rb-fsevent (0.10.2)
rb-inotify (0.9.7) rb-inotify (0.9.10)
ffi (>= 0.5.0) ffi (>= 0.5.0, < 2)
request_store (1.3.2)
rubyntlm (0.3.4) rubyntlm (0.3.4)
sass (3.4.22) sass (3.5.1)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.6) sass-rails (5.0.6)
railties (>= 4.0.0, < 6) railties (>= 4.0.0, < 6)
sass (~> 3.1) sass (~> 3.1)
sprockets (>= 2.8, < 4.0) sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0) sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3) tilt (>= 1.1, < 3)
simplecov (0.13.0) simplecov (0.15.0)
docile (~> 1.1.0) docile (~> 1.1.0)
json (>= 1.8, < 3) json (>= 1.8, < 3)
simplecov-html (~> 0.10.0) simplecov-html (~> 0.10.0)
simplecov-html (0.10.0) simplecov-html (0.10.2)
slack-notifier (2.1.0) slack-notifier (2.3.1)
spring (2.0.0) spring (2.0.2)
activesupport (>= 4.2) activesupport (>= 4.2)
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)
sprockets (3.7.0) sprockets (3.7.1)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
rack (> 1, < 3) rack (> 1, < 3)
sprockets-rails (3.2.0) sprockets-rails (3.2.0)
actionpack (>= 4.0) actionpack (>= 4.0)
activesupport (>= 4.0) activesupport (>= 4.0)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
sqlite3 (1.3.12) sqlite3 (1.3.13)
thor (0.19.1) sqlite3 (1.3.13-x64-mingw32)
thread_safe (0.3.5) sqlite3 (1.3.13-x86-mingw32)
tilt (2.0.5) sqlite3 (1.3.13-x86-mswin32-60)
thor (0.19.4)
thread_safe (0.3.6)
thread_safe (0.3.6-java)
tilt (2.0.8)
turbolinks (5.0.1) turbolinks (5.0.1)
turbolinks-source (~> 5) turbolinks-source (~> 5)
turbolinks-source (5.0.0) turbolinks-source (5.0.3)
tzinfo (1.2.2) tzinfo (1.2.3)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (3.0.2) tzinfo-data (1.2017.2)
tzinfo (>= 1.0.0)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
web-console (3.3.1) web-console (3.5.1)
actionview (>= 5.0) actionview (>= 5.0)
activemodel (>= 5.0) activemodel (>= 5.0)
debug_inspector bindex (>= 0.4.0)
railties (>= 5.0) railties (>= 5.0)
websocket-driver (0.6.4) websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-driver (0.6.5-java)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2) websocket-extensions (0.1.2)
xml-simple (1.1.5) xml-simple (1.1.5)
@ -241,7 +269,11 @@ GEM
activesupport activesupport
PLATFORMS PLATFORMS
java
ruby ruby
x64-mingw32
x86-mingw32
x86-mswin32
DEPENDENCIES DEPENDENCIES
bigbluebutton-api-ruby bigbluebutton-api-ruby
@ -282,7 +314,4 @@ DEPENDENCIES
yt (~> 0.28.0) yt (~> 0.28.0)
RUBY VERSION RUBY VERSION
ruby 2.3.4p301 ruby 2.4.0p0
BUNDLED WITH
1.14.6

View File

@ -14,10 +14,16 @@
// You should have received a copy of the GNU Lesser General Public License along // You should have received a copy of the GNU Lesser General Public License along
// with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. // with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
/** global: Meeting */
/** global: PreviousMeetings */
/** global: QRCode */
/** global: Recordings */
/** global: Turbolinks */
(function() { (function() {
var waitForModerator = function(url) { var waitForModerator = function(url) {
localStorage.setItem("waitingName", $('.meeting-user-name').val()); window.localStorage.setItem("waitingName", $('.meeting-user-name').val());
$.post(url + "/wait", {name: $('.meeting-user-name').val()}, function(html) { $.post(url + "/wait", {name: $('.meeting-user-name').val()}, function(html) {
$(".center-panel-wrapper").html(html); $(".center-panel-wrapper").html(html);
}); });
@ -33,7 +39,7 @@
Meeting.clear(); Meeting.clear();
var nameInput = $('.meeting-user-name'); var nameInput = $('.meeting-user-name');
if (!nameInput.val()) { if (!nameInput.val()) {
var lastName = localStorage.getItem('lastJoinedName'); var lastName = window.localStorage.getItem('lastJoinedName');
if (lastName !== 'undefined') { if (lastName !== 'undefined') {
nameInput.val(lastName); nameInput.val(lastName);
} }

View File

@ -46,4 +46,9 @@ class ApplicationController < ActionController::Base
USER_NAME_LIMIT USER_NAME_LIMIT
end end
helper_method :user_name_limit helper_method :user_name_limit
def bigbluebutton_endpoint_default?
Rails.configuration.bigbluebutton_endpoint_default == Rails.configuration.bigbluebutton_endpoint
end
helper_method :bigbluebutton_endpoint_default?
end end

View File

@ -205,7 +205,7 @@ class BbbController < ApplicationController
if Rails.configuration.enable_youtube_uploading == false then if Rails.configuration.enable_youtube_uploading == false then
uploadable = 'uploading_disabled' uploadable = 'uploading_disabled'
elsif current_user.provider != 'google' elsif current_user.provider != 'google'
uploadable = 'invalid_provider' uploadable = 'invalid_provider'
else else
uploadable = (Faraday.head(get_webcams_url(params[:rec_id])).status == 200 && current_user.provider == 'google').to_s uploadable = (Faraday.head(get_webcams_url(params[:rec_id])).status == 200 && current_user.provider == 'google').to_s
end end
@ -213,7 +213,7 @@ class BbbController < ApplicationController
end end
def get_webcams_url(recording_id) def get_webcams_url(recording_id)
uri = URI.parse(ENV['BIGBLUEBUTTON_ENDPOINT']) uri = URI.parse(Rails.configuration.bigbluebutton_endpoint)
uri.scheme + '://' + uri.host + '/presentation/' + recording_id + '/video/webcams.webm' uri.scheme + '://' + uri.host + '/presentation/' + recording_id + '/video/webcams.webm'
end end
@ -291,10 +291,10 @@ class BbbController < ApplicationController
actioncable_event('create', params[:id], params[:room_id]) actioncable_event('create', params[:id], params[:room_id])
elsif eventName == "meeting_destroyed_event" elsif eventName == "meeting_destroyed_event"
actioncable_event('destroy', params[:id], params[:room_id]) actioncable_event('destroy', params[:id], params[:room_id])
# Since the meeting is destroyed we have no way get the callback url to remove the meeting, so we must build it. # Since the meeting is destroyed we have no way get the callback url to remove the meeting, so we must build it.
remove_url = build_callback_url(params[:id], params[:room_id]) remove_url = build_callback_url(params[:id], params[:room_id])
# Remove webhook for the meeting. # Remove webhook for the meeting.
webhook_remove(remove_url) webhook_remove(remove_url)
elsif eventName == "user_joined_message" elsif eventName == "user_joined_message"
@ -307,7 +307,7 @@ class BbbController < ApplicationController
render head(:ok) && return render head(:ok) && return
end end
def build_callback_url(id, room_id) def build_callback_url(id, room_id)
"#{request.base_url}#{relative_root}/rooms/#{room_id}/#{URI.encode(id)}/callback" "#{request.base_url}#{relative_root}/rooms/#{room_id}/#{URI.encode(id)}/callback"
end end

View File

@ -24,7 +24,7 @@ class LandingController < ApplicationController
def resource def resource
if Rails.configuration.disable_guest_access && params[:resource] == 'meetings' if Rails.configuration.disable_guest_access && params[:resource] == 'meetings'
redirect_to guest_path redirect_to guest_path
else else
if params[:id].size > meeting_name_limit if params[:id].size > meeting_name_limit
redirect_to root_url, flash: {danger: t('meeting_name_long')} redirect_to root_url, flash: {danger: t('meeting_name_long')}
@ -39,7 +39,7 @@ class LandingController < ApplicationController
end end
end end
end end
def guest def guest
# If someone tries to access the guest landing when guest access is enabled, just send them to root. # If someone tries to access the guest landing when guest access is enabled, just send them to root.
redirect_to root_url unless Rails.configuration.disable_guest_access redirect_to root_url unless Rails.configuration.disable_guest_access
@ -51,21 +51,13 @@ class LandingController < ApplicationController
def wait_for_moderator def wait_for_moderator
WaitingList.add(params[:room_id], params[:name], params[:id]) WaitingList.add(params[:room_id], params[:name], params[:id])
ActionCable.server.broadcast 'refresh_meetings', send_alert(params, 'waiting')
method: 'waiting',
meeting: params[:id],
room: params[:room_id],
user: params[:name]
render layout: false render layout: false
end end
def no_longer_waiting def no_longer_waiting
WaitingList.remove(params[:room_id], params[:name], params[:id]) WaitingList.remove(params[:room_id], params[:name], params[:id])
ActionCable.server.broadcast 'refresh_meetings', send_alert(params, 'no_longer_waiting')
method: 'no_longer_waiting',
meeting: params[:id],
room: params[:room_id],
user: params[:name]
end end
def session_status_refresh def session_status_refresh
@ -124,4 +116,11 @@ class LandingController < ApplicationController
render :action => 'rooms' render :action => 'rooms'
end end
def send_alert(params, method)
ActionCable.server.broadcast 'refresh_meetings',
method: method,
meeting: params[:id],
room: params[:room_id],
user: params[:name]
end
end end

View File

@ -20,15 +20,15 @@ module BbbApi
META_HOOK_URL = "gl-webhooks-callback-url" META_HOOK_URL = "gl-webhooks-callback-url"
def bbb_endpoint def bbb_endpoint
Rails.configuration.bigbluebutton_endpoint || '' Rails.configuration.bigbluebutton_endpoint
end end
def bbb_secret def bbb_secret
Rails.configuration.bigbluebutton_secret || '' Rails.configuration.bigbluebutton_secret
end end
def bbb def bbb
@bbb ||= BigBlueButton::BigBlueButtonApi.new(bbb_endpoint + "api", bbb_secret, "0.8", true) @bbb ||= BigBlueButton::BigBlueButtonApi.new(bbb_endpoint + "api", bbb_secret, "0.8")
end end
def bbb_meeting_id(id) def bbb_meeting_id(id)

View File

@ -18,6 +18,9 @@
<div class="center-block center-panel-size col-xs-12"> <div class="center-block center-panel-size col-xs-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-body">
<% if bigbluebutton_endpoint_default? %>
<div class="panel-alert alert alert-danger"><%= t('warning_bigbluebutton_endpoint_default') %></div>
<% end %>
<h3 class="title-wrapper text-center"> <h3 class="title-wrapper text-center">
<%= yield :title %> <%= yield :title %>
</h3> </h3>

View File

@ -14,4 +14,4 @@ deployment:
test: test:
pre: pre:
- cp env .env - cp sample.env .env

View File

@ -37,13 +37,16 @@ module Greenlight
config.i18n.fallbacks = {'en' => 'en-US'} config.i18n.fallbacks = {'en' => 'en-US'}
# BigBlueButton # BigBlueButton
config.bigbluebutton_endpoint = ENV['BIGBLUEBUTTON_ENDPOINT'] config.bigbluebutton_endpoint_default = 'http://test-install.blindsidenetworks.com/bigbluebutton/'
config.bigbluebutton_secret = ENV['BIGBLUEBUTTON_SECRET'] config.bigbluebutton_secret_default = '8cd8ef52e8e101574e400365b55e11a6'
config.bigbluebutton_endpoint = ENV['BIGBLUEBUTTON_ENDPOINT'] || config.bigbluebutton_endpoint_default
config.bigbluebutton_secret = ENV['BIGBLUEBUTTON_SECRET'] || config.bigbluebutton_secret_default
config.use_webhooks = ENV['GREENLIGHT_USE_WEBHOOKS'] == "true" # Greelight specific
config.mail_notifications = ENV['GREENLIGHT_MAIL_NOTIFICATIONS'] == "true" config.use_webhooks = ENV['GREENLIGHT_USE_WEBHOOKS'] && ENV['GREENLIGHT_USE_WEBHOOKS'] == "true"
config.disable_guest_access = ENV['DISABLE_GUEST_ACCESS'] == "true" config.mail_notifications = ENV['GREENLIGHT_MAIL_NOTIFICATIONS'] && ENV['GREENLIGHT_MAIL_NOTIFICATIONS'] == "true"
config.enable_youtube_uploading = ENV['ENABLE_YOUTUBE_UPLOADING'] == "true" config.disable_guest_access = ENV['DISABLE_GUEST_ACCESS'] && ENV['DISABLE_GUEST_ACCESS'] == "true"
config.enable_youtube_uploading = ENV['ENABLE_YOUTUBE_UPLOADING'] && ENV['ENABLE_YOUTUBE_UPLOADING'] == "true"
# SMTP and action mailer # SMTP and action mailer
if config.mail_notifications if config.mail_notifications
@ -57,7 +60,7 @@ module Greenlight
config.smtp_starttls_auto = ENV['SMTP_STARTTLS_AUTO'].nil? ? true : ENV['SMTP_STARTTLS_AUTO'] config.smtp_starttls_auto = ENV['SMTP_STARTTLS_AUTO'].nil? ? true : ENV['SMTP_STARTTLS_AUTO']
config.smtp_tls = ENV['SMTP_TLS'].nil? ? false : ENV['SMTP_TLS'] config.smtp_tls = ENV['SMTP_TLS'].nil? ? false : ENV['SMTP_TLS']
config.action_mailer.default_url_options = { host: ENV['GREENLIGHT_DOMAIN'] } config.action_mailer.default_url_options = { host: ENV['GREENLIGHT_DOMAIN'] || 'localhost' }
config.action_mailer.delivery_method = :smtp config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true config.action_mailer.raise_delivery_errors = true

View File

@ -1,24 +1,22 @@
Rails.application.config.providers = [:google, :twitter, :ldap] Rails.application.config.providers = [:google, :twitter, :ldap]
Rails.application.config.omniauth_google = ENV['GOOGLE_OAUTH2_ID'].present? Rails.application.config.omniauth_google = ENV['GOOGLE_OAUTH2_ID'].present? && ENV['GOOGLE_OAUTH2_SECRET'].present?
Rails.application.config.omniauth_twitter = ENV['TWITTER_ID'].present? Rails.application.config.omniauth_twitter = ENV['TWITTER_ID'].present? && ENV['TWITTER_SECRET'].present?
Rails.application.config.omniauth_ldap = ENV['LDAP_SERVER'].present? Rails.application.config.omniauth_ldap = ENV['LDAP_SERVER'].present? && ENV['LDAP_UID'].present? && ENV['LDAP_BASE'].present? && ENV['LDAP_BIND_DN'].present? && ENV['LDAP_PASSWORD'].present?
Rails.application.config.middleware.use OmniAuth::Builder do Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, ENV['TWITTER_ID'], ENV['TWITTER_SECRET'] provider :twitter, ENV['TWITTER_ID'], ENV['TWITTER_SECRET']
provider :google_oauth2, provider :google_oauth2, ENV['GOOGLE_OAUTH2_ID'], ENV['GOOGLE_OAUTH2_SECRET'],
ENV['GOOGLE_OAUTH2_ID'], scope: ENV['ENABLE_YOUTUBE_UPLOADING'] && ENV['ENABLE_YOUTUBE_UPLOADING'] == "true" ? ['profile', 'email', 'youtube', 'youtube.upload'] : ['profile', 'email'] ,
ENV['GOOGLE_OAUTH2_SECRET'], access_type: 'online',
scope: ENV['ENABLE_YOUTUBE_UPLOADING'] == 'true' ? ['profile', 'email', 'youtube', 'youtube.upload'] : ['profile', 'email'] ,
access_type: 'online',
name: 'google', name: 'google',
hd: ENV['GOOGLE_OAUTH2_HD'].blank? ? nil : ENV['GOOGLE_OAUTH2_HD'] hd: ENV['GOOGLE_OAUTH2_HD']
provider :ldap, provider :ldap,
host: ENV['LDAP_SERVER'], host: ENV['LDAP_SERVER'],
port: ENV['LDAP_PORT'], port: ENV['LDAP_PORT'] || '389',
method: ENV['LDAP_METHOD'].present? ? ENV['LDAP_METHOD'].to_sym : :plain, method: (ENV['LDAP_METHOD'] || 'plain').to_sym,
allow_username_or_email_login: true, allow_username_or_email_login: true,
uid: ENV['LDAP_UID'], uid: ENV['LDAP_UID'],
base: ENV['LDAP_BASE'], base: ENV['LDAP_BASE'],
@ -37,10 +35,10 @@ OmniAuth.config.on_failure = Proc.new { |env|
module OmniAuthLDAPExt module OmniAuthLDAPExt
def request_phase def request_phase
rel_root = ENV['RELATIVE_URL_ROOT'].present? ? ENV['RELATIVE_URL_ROOT'] : '/b' rel_root = ENV['RELATIVE_URL_ROOT'].present? ? ENV['RELATIVE_URL_ROOT'] : '/b'
rel_root = '' if Rails.env == 'development' rel_root = '' if Rails.env == 'development'
@callback_path = nil @callback_path = nil
path = options[:callback_path] path = options[:callback_path]
options[:callback_path] = "#{rel_root}/auth/ldap/callback" options[:callback_path] = "#{rel_root}/auth/ldap/callback"

View File

@ -23,14 +23,15 @@ rescue URI::InvalidURIError
false false
end end
if !ENV['SLACK_WEBHOOK'].nil? && !ENV['SLACK_WEBHOOK'].empty? && uri?(ENV['SLACK_WEBHOOK']) then if !ENV['SLACK_WEBHOOK'] || !ENV['SLACK_CHANNEL'] || !uri?(ENV['SLACK_WEBHOOK']) then
# Initialize the slack notifier.
Rails.application.config.slack_notifier = Slack::Notifier.new ENV['SLACK_WEBHOOK'] do
defaults channel: ENV['SLACK_CHANNEL'],
username: "BigBlueButton",
icon_url: 'https://avatars3.githubusercontent.com/u/230228?v=3&s=200'
end
else
# Initialize it to nil (slack not configured) # Initialize it to nil (slack not configured)
Rails.application.config.slack_notifier = nil Rails.application.config.slack_notifier = nil
return
end
# Initialize the slack notifier.
Rails.application.config.slack_notifier = Slack::Notifier.new ENV['SLACK_WEBHOOK'] do
defaults channel: ENV['SLACK_CHANNEL'],
username: "BigBlueButton",
icon_url: 'https://avatars3.githubusercontent.com/u/230228?v=3&s=200'
end end

View File

@ -187,6 +187,7 @@ en-US:
wait_for_mod_explanation: You will automatically join when the meeting starts wait_for_mod_explanation: You will automatically join when the meeting starts
watch: Watch watch: Watch
'yes': 'Yes' 'yes': 'Yes'
warning_bigbluebutton_endpoint_default: This deployment of Greenlight is making use of the BigBlueButton testing server that comes pre-configured by default. It should be replaced.
welcome_to_greenlight: Welcome to GreenLight! welcome_to_greenlight: Welcome to GreenLight!
youtube_description: This recording was recorded with BigBlueButton. For more information check out %{url}. youtube_description: This recording was recorded with BigBlueButton. For more information check out %{url}.
youtube_footer: this will upload all webcam and audio data youtube_footer: this will upload all webcam and audio data

124
env
View File

@ -1,124 +0,0 @@
# Step 1 - Create a secret key for rails
#
# You can generate a secure one through the Greenlight docker image
# with with the command
#
# docker run --rm bigbluebutton/greenlight rake secret
#
SECRET_KEY_BASE=
# Step 2 - Enter credentials for your BigBlueButton Server
#
# The endpoint and secret from your bigbluebutton server. To get these values, run
# the following command on your BigBlueButton server
#
# bbb-conf --secret
#
# and uncomment the following two variables
#BIGBLUEBUTTON_ENDPOINT=
#BIGBLUEBUTTON_SECRET=
# Twitter Login Provider (optional)
#
# You will need to register the app at https://apps.twitter.com/
# For the callback URL use 'http://<your hostname:port>/auth/twitter/callback'
# Once registered copy the ID and Secret here
#
TWITTER_ID=
TWITTER_SECRET=
# Google Login Provider (optional)
#
# You will need to register for at https://console.developers.google.com/apis/credentials
# Select Oauth client ID -> web application
# For the callback URL use 'http://<your hostname:port>/auth/google/callback'
# Once registered copy the ID and Secret here
#
# The GOOGLE_OAUTH2_HD variable is used to limit sign-in to a particular Google Apps hosted domain. This
# can be a string such as, 'domain.com'. If left blank, GreenLight will allow sign-in from all Google Apps hosted
# domains.
#
GOOGLE_OAUTH2_ID=
GOOGLE_OAUTH2_SECRET=
GOOGLE_OAUTH2_HD=
# LDAP Login Provider (optional)
#
# You can enable LDAP authentication by providing values for the variables below.
# For information about setting up LDAP, see:
# http://docs.bigbluebutton.org/install/green-light.html#ldap-oauth
#
LDAP_SERVER=
LDAP_PORT=
LDAP_METHOD=
LDAP_UID=
LDAP_BASE=
LDAP_BIND_DN=
LDAP_PASSWORD=
# If "true", GreenLight will register a webhook callback for each meeting
# created. This callback is called for all events that happen in the meeting,
# including the processing of its recording. These events are used to update
# the web page dynamically as things happen in the server.
# If not "true", the application will add a metadata to the meetings with this same
# callback URL. Scripts can then be added to BigBlueButton to call this callback
# URL and send specific events to GreenLight (e.g. a post publish script to warn
# the application when recordings are done).
GREENLIGHT_USE_WEBHOOKS=false
# Enable uploading to Youtube (optional)
#
# When this is enabled, users will be able to directly upload their recordings
# to Youtube. If you plan to enable this, you should follow the steps outlined
# in our docs for setting up the Youtube data API.
#
# http://docs.bigbluebutton.org/install/green-light.html#8-enabling-uploading-to-youtube-optional
#
ENABLE_YOUTUBE_UPLOADING=false
# Slack Integration (optional)
#
# You will need to register an incoming-webhook for your slack channel
# in order for GreenLight to post to it. You can do this by going
# to https://slack.com/apps/A0F7XDUAZ-incoming-webhooks, selecting your
# team and then selecting "Add Incoming WebHooks integration" on the
# desired channel. You will then need to paste the webhook below.
#
SLACK_WEBHOOK=
SLACK_CHANNEL=
# Landing Background (optional)
#
# Supply a URL to an image to change the landing background. If no
# URL is provided GreenLight will use a default image. If you
# supply a path that does not lead to an image, no landing image
# will appear.
#
LANDING_BACKGROUND=
# SMTP Mailer
#
GREENLIGHT_MAIL_NOTIFICATIONS=true
GREENLIGHT_DOMAIN=localhost-lxc.org
SMTP_FROM=youremail@gmail.com
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_DOMAIN=gmail.com
SMTP_USERNAME=youremail@gmail.com
SMTP_PASSWORD=yourpassword
# SMTP_TLS=false
# SMTP_AUTH=login
# SMTP_STARTTLS_AUTO=true
# Prefix for the application's root URL
# Useful for deploying the application to a subdirectory
#
# default is '/b' (recommended)
#
#RELATIVE_URL_ROOT=/b
# Uncomment and set to 'true' to only allow users to create meetings when authenticated.
# Unauthenticated users are still able to join meetings through invites.
#DISABLE_GUEST_ACCESS=false
# Comment this out to send logs to STDOUT in production instead of log/production.log .
DISABLE_RAILS_LOG_TO_STDOUT=true

View File

@ -1,11 +1,71 @@
# This is a sample of the environment variables you will need for development # This is a sample of the environment variables you will need
# To use, copy this file to .env `cp sample.env .env` # To use, copy this file to .env `cp sample.env .env`
RAILS_ENV=development
# BigBlueButton # For production only
BIGBLUEBUTTON_ENDPOINT=
BIGBLUEBUTTON_SECRET= # RAILS_ENV=production
# Create a secret key for rails
#
# You can generate a secure one through the Greenlight docker image
# with with the command
#
# docker run --rm bigbluebutton/greenlight rake secret
#
# SECRET_KEY_BASE=
# For either developent or production
# Enter credentials for your BigBlueButton Server
#
# The endpoint and secret from your bigbluebutton server. To get these values, run
# the following command on your BigBlueButton server
#
# bbb-conf --secret
#
# and uncomment the following two variables
# BIGBLUEBUTTON_ENDPOINT=http://test-install.blindsidenetworks.com/bigbluebutton/
# BIGBLUEBUTTON_SECRET=8cd8ef52e8e101574e400365b55e11a6
# Twitter Login Provider (optional)
#
# You will need to register the app at https://apps.twitter.com/
# For the callback URL use 'http://<your hostname:port>/auth/twitter/callback'
# Once registered copy the ID and Secret here
#
# TWITTER_ID=
# TWITTER_SECRET=
# Google Login Provider (optional)
#
# You will need to register for at https://console.developers.google.com/apis/credentials
# Select Oauth client ID -> web application
# For the callback URL use 'http://<your hostname:port>/auth/google/callback'
# Once registered copy the ID and Secret here
#
# The GOOGLE_OAUTH2_HD variable is used to limit sign-in to a particular Google Apps hosted domain. This
# can be a string such as, 'domain.com'. If left blank, GreenLight will allow sign-in from all Google Apps hosted
# domains.
#
# GOOGLE_OAUTH2_ID=
# GOOGLE_OAUTH2_SECRET=
# GOOGLE_OAUTH2_HD=
# LDAP Login Provider (optional)
#
# You can enable LDAP authentication by providing values for the variables below.
# For information about setting up LDAP, see:
# http://docs.bigbluebutton.org/install/green-light.html#ldap-oauth
#
# LDAP_SERVER=
# LDAP_PORT=
# LDAP_METHOD=
# LDAP_UID=
# LDAP_BASE=
# LDAP_BIND_DN=
# LDAP_PASSWORD=
# If "true", GreenLight will register a webhook callback for each meeting # If "true", GreenLight will register a webhook callback for each meeting
# created. This callback is called for all events that happen in the meeting, # created. This callback is called for all events that happen in the meeting,
@ -15,31 +75,63 @@ BIGBLUEBUTTON_SECRET=
# callback URL. Scripts can then be added to BigBlueButton to call this callback # callback URL. Scripts can then be added to BigBlueButton to call this callback
# URL and send specific events to GreenLight (e.g. a post publish script to warn # URL and send specific events to GreenLight (e.g. a post publish script to warn
# the application when recordings are done). # the application when recordings are done).
GREENLIGHT_USE_WEBHOOKS=false # GREENLIGHT_USE_WEBHOOKS=true
# The web site domain, needed for emails mostly # Enable uploading to Youtube (optional)
GREENLIGHT_DOMAIN=localhost #
# When this is enabled, users will be able to directly upload their recordings
# to Youtube. If you plan to enable this, you should follow the steps outlined
# in our docs for setting up the Youtube data API.
#
# http://docs.bigbluebutton.org/install/green-light.html#8-enabling-uploading-to-youtube-optional
#
# ENABLE_YOUTUBE_UPLOADING=false
# Enable email notifications # Slack Integration (optional)
GREENLIGHT_MAIL_NOTIFICATIONS=true #
# You will need to register an incoming-webhook for your slack channel
# in order for GreenLight to post to it. You can do this by going
# to https://slack.com/apps/A0F7XDUAZ-incoming-webhooks, selecting your
# team and then selecting "Add Incoming WebHooks integration" on the
# desired channel. You will then need to paste the webhook below.
#
# SLACK_WEBHOOK=
# SLACK_CHANNEL=
# Email configurations # Landing Background (optional)
SMTP_FROM=email@gmail.com #
SMTP_SERVER=smtp.gmail.com # Supply a URL to an image to change the landing background. If no
SMTP_DOMAIN=gmail.com # URL is provided GreenLight will use a default image. If you
SMTP_PORT=587 # supply a path that does not lead to an image, no landing image
SMTP_USERNAME=email@gmail.com # will appear.
SMTP_PASSWORD=my-secret-password #
# LANDING_BACKGROUND=
# SMTP Mailer (optional)
#
# GREENLIGHT_MAIL_NOTIFICATIONS=true
# In the format [localhost.localdomain]
# GREENLIGHT_DOMAIN=localhost
# SMTP_FROM=youremail@gmail.com
# SMTP_SERVER=smtp.gmail.com
# SMTP_PORT=587
# SMTP_DOMAIN=gmail.com
# SMTP_USERNAME=youremail@gmail.com
# SMTP_PASSWORD=yourpassword
# SMTP_TLS=false # SMTP_TLS=false
# SMTP_AUTH=login # SMTP_AUTH=login
# SMTP_STARTTLS_AUTO=true # SMTP_STARTTLS_AUTO=true
# OmniAuth # Prefix for the application's root URL
TWITTER_ID= # Useful for deploying the application to a subdirectory
TWITTER_SECRET= #
GOOGLE_OAUTH2_ID= # default is '/b' (recommended)
GOOGLE_OAUTH2_SECRET= #
# RELATIVE_URL_ROOT=/b
# For production # Uncomment and set to 'true' to only allow users to create meetings when authenticated.
SECRET_KEY_BASE= # Unauthenticated users are still able to join meetings through invites.
HOSTNAME= # DISABLE_GUEST_ACCESS=false
# Comment this out to send logs to STDOUT in production instead of log/production.log .
DISABLE_RAILS_LOG_TO_STDOUT=true