From f4b8348e4301267be4932f64bef274e4a877cd6b Mon Sep 17 00:00:00 2001 From: jfederico Date: Mon, 17 Oct 2016 10:37:44 -0400 Subject: [PATCH 1/3] Added extra gems required for ui and authentication --- Gemfile | 7 +++++++ Gemfile.lock | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/Gemfile b/Gemfile index 00c79238..33f29772 100644 --- a/Gemfile +++ b/Gemfile @@ -47,5 +47,12 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] +gem 'devise', '4.2.0' +gem 'omniauth', '1.3.1' +gem 'omniauth-twitter', '1.2.1' +gem 'omniauth-google-oauth2', '0.4.1' + gem 'bigbluebutton-api-ruby' +gem 'bootstrap-sass', '3.3.0.0' +gem 'bootstrap-social-rails', '~> 4.12' diff --git a/Gemfile.lock b/Gemfile.lock index 3aa0a317..32c8ad22 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,8 +39,13 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) arel (7.1.4) + bcrypt (3.1.11) bigbluebutton-api-ruby (1.6.0) xml-simple (~> 1.1) + bootstrap-sass (3.3.0.0) + sass (~> 3.2) + bootstrap-social-rails (4.12.0) + railties (>= 3.1) builder (3.2.2) byebug (9.0.6) coffee-rails (4.2.1) @@ -52,11 +57,20 @@ GEM coffee-script-source (1.10.0) concurrent-ruby (1.0.2) debug_inspector (0.0.2) + devise (4.2.0) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0, < 5.1) + responders + warden (~> 1.2.3) erubis (2.7.0) execjs (2.7.0) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) ffi (1.9.14) globalid (0.3.7) activesupport (>= 4.1.0) + hashie (3.4.4) i18n (0.7.0) jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) @@ -65,6 +79,8 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) + json (1.8.3) + jwt (1.5.4) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -79,9 +95,36 @@ GEM mini_portile2 (2.1.0) minitest (5.9.1) multi_json (1.12.1) + multi_xml (0.5.5) + multipart-post (2.0.0) nio4r (1.2.1) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) + oauth (0.5.1) + oauth2 (1.2.0) + faraday (>= 0.8, < 0.10) + jwt (~> 1.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (>= 1.2, < 3) + omniauth (1.3.1) + hashie (>= 1.2, < 4) + rack (>= 1.0, < 3) + omniauth-google-oauth2 (0.4.1) + jwt (~> 1.5.2) + multi_json (~> 1.3) + omniauth (>= 1.1.1) + omniauth-oauth2 (>= 1.3.1) + omniauth-oauth (1.1.0) + oauth + omniauth (~> 1.0) + omniauth-oauth2 (1.4.0) + oauth2 (~> 1.0) + omniauth (~> 1.2) + omniauth-twitter (1.2.1) + json (~> 1.3) + omniauth-oauth (~> 1.1) + orm_adapter (0.5.0) puma (3.6.0) rack (2.0.1) rack-test (0.6.3) @@ -113,6 +156,8 @@ GEM rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) + responders (2.3.0) + railties (>= 4.2.0, < 5.1) sass (3.4.22) sass-rails (5.0.6) railties (>= 4.0.0, < 6) @@ -143,6 +188,8 @@ GEM thread_safe (~> 0.1) uglifier (3.0.2) execjs (>= 0.3.0, < 3) + warden (1.2.6) + rack (>= 1.0) web-console (3.3.1) actionview (>= 5.0) activemodel (>= 5.0) @@ -158,11 +205,17 @@ PLATFORMS DEPENDENCIES bigbluebutton-api-ruby + bootstrap-sass (= 3.3.0.0) + bootstrap-social-rails (~> 4.12) byebug coffee-rails (~> 4.2) + devise (= 4.2.0) jbuilder (~> 2.5) jquery-rails listen (~> 3.0.5) + omniauth (= 1.3.1) + omniauth-google-oauth2 (= 0.4.1) + omniauth-twitter (= 1.2.1) puma (~> 3.0) rails (~> 5.0.0, >= 5.0.0.1) sass-rails (~> 5.0) From 682cbadbf0c27fb64b893b18da64f3848ccb0e5c Mon Sep 17 00:00:00 2001 From: jfederico Date: Mon, 17 Oct 2016 13:45:24 -0400 Subject: [PATCH 2/3] Added some style to the landing page --- Gemfile | 2 + Gemfile.lock | 11 ++- app/assets/images/bbb-logo.png | Bin 0 -> 7318 bytes app/assets/javascripts/application.js | 5 +- app/assets/stylesheets/application.css | 2 + app/assets/stylesheets/landing.scss | 4 + app/assets/stylesheets/narrow-jumbotron.css | 79 ++++++++++++++++++++ app/controllers/landing_controller.rb | 11 +-- app/helpers/landing_helper.rb | 7 ++ app/views/landing/index.html.erb | 67 ++++++++++------- app/views/layouts/application.html.erb | 11 +++ 11 files changed, 159 insertions(+), 40 deletions(-) create mode 100644 app/assets/images/bbb-logo.png create mode 100644 app/assets/stylesheets/narrow-jumbotron.css diff --git a/Gemfile b/Gemfile index 33f29772..c1ee7d59 100644 --- a/Gemfile +++ b/Gemfile @@ -56,3 +56,5 @@ gem 'bigbluebutton-api-ruby' gem 'bootstrap-sass', '3.3.0.0' gem 'bootstrap-social-rails', '~> 4.12' +gem 'jquery-ui-rails' +gem 'jquery-datatables-rails', '~> 3.4.0' diff --git a/Gemfile.lock b/Gemfile.lock index 32c8ad22..6e41f344 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,10 +75,17 @@ GEM jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) + jquery-datatables-rails (3.4.0) + actionpack (>= 3.1) + jquery-rails + railties (>= 3.1) + sass-rails jquery-rails (4.2.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) + jquery-ui-rails (5.0.5) + railties (>= 3.2.16) json (1.8.3) jwt (1.5.4) listen (3.0.8) @@ -211,7 +218,9 @@ DEPENDENCIES coffee-rails (~> 4.2) devise (= 4.2.0) jbuilder (~> 2.5) + jquery-datatables-rails (~> 3.4.0) jquery-rails + jquery-ui-rails listen (~> 3.0.5) omniauth (= 1.3.1) omniauth-google-oauth2 (= 0.4.1) @@ -228,4 +237,4 @@ DEPENDENCIES web-console BUNDLED WITH - 1.13.2 + 1.13.5 diff --git a/app/assets/images/bbb-logo.png b/app/assets/images/bbb-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..3737f7c5773ebbca34a14ccd00560893c3c3166a GIT binary patch literal 7318 zcmbVRXE>qnS&)#d@tKDmtXGd#kDBqx9rNG0(yMaL~>fqtwGhUBT zWF*)71mJMt^?}6;W$2}gwe#||^svQ~x4~N30x>R@_O?2T1%~SQlZ-KQh98E^gP_cz7~$er}f5PPSe^D_eUjXn(FVbNUtC>8-A%#P z!4VzcVXGUUp=TZ7WG!XGEhh_<@sqv=aIy8W1p2u+yLw9dA-Mm-mA)STISt_k{w3n& zgy8;{Q-VY#^RTg#)=^aY+t&3A!R_GXGc&%YCOoid1@r5gk) zECO+H`4iV)(w<&Aw*T$Mf0Xvr^LMj_=-7HtV<9kMecy{%=En1h2i3*7R_^ zE{dhIBG%g5#n#meqlnq$?qc5{FC3ONpYC6roTQR9+D-j}(=Xmk@)Zv(PV zZ{2HS|A(%$f`_f87uG`$i*^2o0a^}NFRZ5n)(xnjD-Kk*w03m;GyhYbe?_Zk>*45Q zYop|WbpigBUunnxU|&hoBvPFAlJ@7{*dE;kma9K z*9`nK{5SQlC;x69Ti5H3@wjdcQv;59JUr$BjH0}r-}^mN7iacC|G*56 zaI;1#uYMX^uH5b%wO92RXxh$p!X^SG0%VNa%?n{ zBm;|+x%u8R%apiNHrAnLqvbYL3JHdj=@w-$jQlIhE8g}8xyzZ02OY0yFh^unua-FW z$M+^=&N~mrI_W}gf9$XA%G2}Z|8QLSfIzb(yjbeP=h?4~?Lx_4o3Me76-NFq^aOxh zT-t2N8@B;S_Kh#iG$+y05KNSv*|J9RD-|(+3>X0LC9f|JL(&i7dylr3eBF+^7ldt@ zORQ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0pXFZHcu?r?E(0EomeuGQ|%sWAJI&~udo=-ro?Wlz+`g$T zz($8CBp0(zH^qQk5cPN&MW@s2^h?iQ&8Zev0W}&s4y&6wjDEC?)e&=iXzl41ore(w zqEBMO_*mRtCiTd$En352-tQV-$)8aDj4g&8C<*|4!P^c-?gZSwx~TLcTNg%^HoAn@ zejPo-1myi<>nJfQFS?YRkt>+u&lh`od{ZWWV3l5(q%8cRG^0U?a%V@%c#gQ1<;J7O z%xA4+NN~|o3rV5Qy@dTOtVDw@9HuN$uGj3m$^AtL>Eh`F+NT-|_4lwO+3jPNXq779 zN+t;)c-G{-^*ZAej=x2Ajw!tv4|UutB?W)8_}CAy}PoTuX0yuJPL%jhFH)YZXG< z%XN`UUa+4#sO0o%gGHgx@SaYFUCn`b{^k)LGxZlE5u}Tjy9o6_-?+l-+Cy~BOQvB5 zv!RY!@6tjuz+#eW=N;;6f-ug_QFJ}#*N}fvl}_e=QnH3MU|yvn7i~LQk&p8AM(ZTi z@i18oS#V~A+J3cW1@9&pHAtn=>&0&i8ud!Iu0|Mcf5;b;@N4h=)R^#i>*>MI!tXBI z0RF~7$GqV(2iDs{deh|HaLGM!E(vrRw2AAACeRg5Rjs*@NWnQ{Yz`dbD)&Z0+s-AP2}EYq%mY3$7}!OSl^c85Ph z2O1YiFE;x?3LwXFY_!=`3<|{L)4}SYh z(QYp4G|$m8-TNZHmIGtO#Oh|a)(DM0ag2N+53UKT0jQCPI@+3t6!Ho5RKJd?v@+03 z)*i9dpQLX@EXAo^NFW5F6}c^4G|^$S6u&RVufJXl`PL*??DOekVcJk}0j zswP`|wgRoc7OYw7MTk-qJrS|ueq(Ec`mijP;dn=z-o?Jxi5Pay`Sp;&{o2>CC%GB(Ko literal 0 HcmV?d00001 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b12018d0..ce912696 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -10,7 +10,8 @@ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // -//= require jquery -//= require jquery_ujs +//= require jquery2 +//= require jquery-ui +//= require bootstrap-sprockets //= require turbolinks //= require_tree . diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 0ebd7fe8..a15c8c86 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -11,5 +11,7 @@ * It is generally better to create a new file per style scope. * *= require_tree . + *= require jquery-ui + *= require dataTables/jquery.dataTables *= require_self */ diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss index f33d6f8d..0dbe3ca0 100644 --- a/app/assets/stylesheets/landing.scss +++ b/app/assets/stylesheets/landing.scss @@ -1,3 +1,7 @@ // Place all the styles related to the landing controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + +// Bootstrap +@import "bootstrap-sprockets"; +@import "bootstrap"; diff --git a/app/assets/stylesheets/narrow-jumbotron.css b/app/assets/stylesheets/narrow-jumbotron.css new file mode 100644 index 00000000..a2dbf869 --- /dev/null +++ b/app/assets/stylesheets/narrow-jumbotron.css @@ -0,0 +1,79 @@ +/* Space out content a bit */ +body { + padding-top: 1.5rem; + padding-bottom: 1.5rem; +} + +/* Everything but the jumbotron gets side spacing for mobile first views */ +.header, +.marketing, +.footer { + padding-right: 1rem; + padding-left: 1rem; +} + +/* Custom page header */ +.header { + padding-bottom: 1rem; + border-bottom: .05rem solid #e5e5e5; +} +/* Make the masthead heading the same height as the navigation */ +.header h3 { + margin-top: 0; + margin-bottom: 0; + line-height: 3rem; +} + +/* Custom page footer */ +.footer { + padding-top: 1.5rem; + color: #777; + border-top: .05rem solid #e5e5e5; +} + +/* Customize container */ +@media (min-width: 48em) { + .container { + max-width: 72rem; + } +} +.container-narrow > hr { + margin: 2rem 0; +} + +/* Main marketing message and sign up button */ +.jumbotron { + text-align: center; + border-bottom: .05rem solid #e5e5e5; +} +.jumbotron .btn { + padding: .75rem 1.5rem; + font-size: 1.5rem; +} + +/* Supporting marketing content */ +.marketing { + margin: 3rem 0; +} +.marketing p + h4 { + margin-top: 1.5rem; +} + +/* Responsive: Portrait tablets and up */ +@media screen and (min-width: 48em) { + /* Remove the padding we set earlier */ + .header, + .marketing, + .footer { + padding-right: 0; + padding-left: 0; + } + /* Space out the masthead */ + .header { + margin-bottom: 2rem; + } + /* Remove the bottom border on the jumbotron for visual effect */ + .jumbotron { + border-bottom: 0; + } +} diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb index 135fd099..d33b4e2b 100644 --- a/app/controllers/landing_controller.rb +++ b/app/controllers/landing_controller.rb @@ -1,15 +1,6 @@ class LandingController < ApplicationController def index @meeting_token = params[:id] || @meeting_token = rand.to_s[2..10] - @meeting_url = meeting_url(@meeting_token) - end - - private - def meeting_url(meeting_token) - _meeting_url = "#{request.original_url}" - _meeting_url += "meeting" if ( request.original_url == "#{request.base_url}/" ) - _meeting_url += "/" unless _meeting_url.end_with?('/') - _meeting_url += "#{meeting_token}" if !params.has_key?(:id) - _meeting_url + @meeting_url = helpers.meeting_url(@meeting_token) end end diff --git a/app/helpers/landing_helper.rb b/app/helpers/landing_helper.rb index 6aa3ee92..3f9b3bc7 100644 --- a/app/helpers/landing_helper.rb +++ b/app/helpers/landing_helper.rb @@ -1,2 +1,9 @@ module LandingHelper + def meeting_url(meeting_token) + _meeting_url = "#{request.original_url}" + _meeting_url += "meeting" if ( request.original_url == "#{request.base_url}/" ) + _meeting_url += "/" unless _meeting_url.end_with?('/') + _meeting_url += "#{meeting_token}" if !params.has_key?(:id) + _meeting_url.gsub(/\/+$/, '') + end end diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb index fed5c740..18eee059 100644 --- a/app/views/landing/index.html.erb +++ b/app/views/landing/index.html.erb @@ -1,35 +1,48 @@ -

Landing#index

-
-

<%= @meeting_url %>

-
+
-
-
- - -
-
+ +
-
- - - - -
+
+
+ +

+
+ <%= @meeting_url %> +
+

+ + +
+
+
+ + +
+ +
+
+
+ +

Hi Everyone

-

The meeting will be at this URL

-

<%= @meeting_url %>

-

Please join!

-
-
+ - + - + + + +
+ + +
+ + \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b8747eee..f240d1f4 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,6 +9,17 @@ + + + + + + <%= yield %> From f725b7f1bc42bdf1beeba144062d2dca0c958c58 Mon Sep 17 00:00:00 2001 From: jfederico Date: Mon, 17 Oct 2016 18:36:56 -0400 Subject: [PATCH 3/3] Implemented join to BBB first approach --- .gitignore | 1 + Gemfile | 3 ++ Gemfile.lock | 5 +++ app/assets/javascripts/bbb.coffee | 3 ++ app/assets/stylesheets/bbb.scss | 3 ++ app/controllers/application_controller.rb | 4 +++ app/controllers/bbb_controller.rb | 38 +++++++++++++++++++++++ app/controllers/landing_controller.rb | 4 ++- app/helpers/application_helper.rb | 22 +++++++++++++ app/helpers/bbb_helper.rb | 36 +++++++++++++++++++++ app/views/bbb/end.html.erb | 2 ++ app/views/bbb/join.html.erb | 2 ++ app/views/errors/error.html.erb | 2 ++ app/views/landing/index.html.erb | 38 +++++++++++++++++------ config/config.yml | 3 ++ config/initializers/load_config.rb | 1 + config/routes.rb | 3 ++ sample.env | 8 +++++ test/controllers/bbb_controller_test.rb | 14 +++++++++ 19 files changed, 182 insertions(+), 10 deletions(-) create mode 100644 app/assets/javascripts/bbb.coffee create mode 100644 app/assets/stylesheets/bbb.scss create mode 100644 app/controllers/bbb_controller.rb create mode 100644 app/helpers/bbb_helper.rb create mode 100644 app/views/bbb/end.html.erb create mode 100644 app/views/bbb/join.html.erb create mode 100644 app/views/errors/error.html.erb create mode 100644 config/config.yml create mode 100644 config/initializers/load_config.rb create mode 100644 sample.env create mode 100644 test/controllers/bbb_controller_test.rb diff --git a/.gitignore b/.gitignore index bab620de..7559b50b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ # Ignore Byebug command history file. .byebug_history +.env \ No newline at end of file diff --git a/Gemfile b/Gemfile index c1ee7d59..2c1ef168 100644 --- a/Gemfile +++ b/Gemfile @@ -31,6 +31,9 @@ gem 'jbuilder', '~> 2.5' # gem 'capistrano-rails', group: :development group :development, :test do + # For environment configuration + gem 'dotenv-rails' + # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platform: :mri end diff --git a/Gemfile.lock b/Gemfile.lock index 6e41f344..3a9be8f7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -63,6 +63,10 @@ GEM railties (>= 4.1.0, < 5.1) responders warden (~> 1.2.3) + dotenv (2.1.1) + dotenv-rails (2.1.1) + dotenv (= 2.1.1) + railties (>= 4.0, < 5.1) erubis (2.7.0) execjs (2.7.0) faraday (0.9.2) @@ -217,6 +221,7 @@ DEPENDENCIES byebug coffee-rails (~> 4.2) devise (= 4.2.0) + dotenv-rails jbuilder (~> 2.5) jquery-datatables-rails (~> 3.4.0) jquery-rails diff --git a/app/assets/javascripts/bbb.coffee b/app/assets/javascripts/bbb.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/bbb.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/bbb.scss b/app/assets/stylesheets/bbb.scss new file mode 100644 index 00000000..687fe4e6 --- /dev/null +++ b/app/assets/stylesheets/bbb.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the bbb controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1c07694e..0a71c41d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,7 @@ +require 'bigbluebutton_api' +require 'digest/sha1' + class ApplicationController < ActionController::Base protect_from_forgery with: :exception + include ApplicationHelper end diff --git a/app/controllers/bbb_controller.rb b/app/controllers/bbb_controller.rb new file mode 100644 index 00000000..e51f7c36 --- /dev/null +++ b/app/controllers/bbb_controller.rb @@ -0,0 +1,38 @@ +class BbbController < ApplicationController + include BbbHelper + + # GET /join + # GET /join.json + def join + logger.info params.to_json + if ( !params.has_key?(:id) ) + render_response("missing_parameter", "meeting token was not included", :bad_request) + elsif ( !params.has_key?(:name) ) + render_response("missing_parameter", "user name was not included", :bad_request) + else + bbb_join_url = bbb_join_url(params[:id], false, params[:name], false) + if bbb_join_url[:returncode] + logger.info "#Execute the redirect" + render_response("ok", "execute the redirect", :ok, {:join_url => bbb_join_url[:join_url]}) + else + render_response("bigbluebutton_error", "join url could not be created", :internal_server_error) + end + end + end + + def close + end + + private + def render_response(messageKey, message, status, response={}) + respond_to do |format| + if (status == :ok) + format.html { render :template => "bbb/join" } + format.json { render :json => { :messageKey => messageKey, :message => message, :status => status, :response => response }, :status => status } + else + format.html { render :template => "errors/error" } + format.json { render :json => { :messageKey => messageKey, :message => message, :status => status, :response => response }, :status => status } + end + end + end +end diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb index d33b4e2b..b02805b7 100644 --- a/app/controllers/landing_controller.rb +++ b/app/controllers/landing_controller.rb @@ -1,6 +1,8 @@ class LandingController < ApplicationController + include LandingHelper + def index @meeting_token = params[:id] || @meeting_token = rand.to_s[2..10] - @meeting_url = helpers.meeting_url(@meeting_token) + @meeting_url = meeting_url(@meeting_token) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be794..3b958476 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,24 @@ module ApplicationHelper + def bbb_endpoint + logger.info APP_CONFIG + #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 + + def bbb_secret + #if (defined? APP_CONFIG).to_s == 'constant' && (APP_CONFIG.has_key? 'bbb_secret') + # APP_CONFIG['bbb_secret'] + #else + '8cd8ef52e8e101574e400365b55e11a6' + #end + end + + def random_password(length) + o = [('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten + password = (0...length).map { o[rand(o.length)] }.join + return password + end end diff --git a/app/helpers/bbb_helper.rb b/app/helpers/bbb_helper.rb new file mode 100644 index 00000000..d99712bf --- /dev/null +++ b/app/helpers/bbb_helper.rb @@ -0,0 +1,36 @@ +module BbbHelper + def bbb_join_url(meeting_token, meeting_recorded=false, user_fullname='User', user_is_moderator=false) + bbb ||= BigBlueButton::BigBlueButtonApi.new(helpers.bbb_endpoint + "api", bbb_secret, "0.8", true) + if !bbb + return { :returncode => false, :messageKey => "BBBAPICallInvalid", :message => "BBB API call invalid." } + else + meeting_id = (Digest::SHA1.hexdigest("Rails.application.secrets.secret_key_base"+meeting_token)).to_s + + #See if the meeting is running + begin + bbb_meeting_info = bbb.get_meeting_info( meeting_id, nil ) + rescue BigBlueButton::BigBlueButtonException => exc + logger.info "Message for the log file #{exc.key}: #{exc.message}" + #This means that is not created, so create the meeting + logout_url = "#{request.base_url}/bbb/close" #Closes the window after correct logout + moderator_password = random_password(12) + viewer_password = random_password(12) + meeting_options = {:record => meeting_recorded.to_s, :logoutURL => logout_url, :moderatorPW => moderator_password, :attendeePW => viewer_password } + bbb.create_meeting(meeting_token, meeting_id, meeting_options) + + #And then get meeting info + bbb_meeting_info = bbb.get_meeting_info( meeting_id, nil ) + end + + #Get the join url + if (user_is_moderator) + password = bbb_meeting_info[:moderatorPW] + else + passord = bbb_meeting_info[:attendeePW] + end + join_url = bbb.join_meeting_url(meeting_id, user_fullname, password ) + return { :returncode => true, :join_url => join_url, :messageKey => "", :message => "" } + end + end + +end diff --git a/app/views/bbb/end.html.erb b/app/views/bbb/end.html.erb new file mode 100644 index 00000000..ad2b2d3f --- /dev/null +++ b/app/views/bbb/end.html.erb @@ -0,0 +1,2 @@ +

Bbb#end

+

Find me in app/views/bbb/end.html.erb

diff --git a/app/views/bbb/join.html.erb b/app/views/bbb/join.html.erb new file mode 100644 index 00000000..55f29286 --- /dev/null +++ b/app/views/bbb/join.html.erb @@ -0,0 +1,2 @@ +

Bbb#join

+

Find me in app/views/bbb/join.html.erb

diff --git a/app/views/errors/error.html.erb b/app/views/errors/error.html.erb new file mode 100644 index 00000000..f3066b91 --- /dev/null +++ b/app/views/errors/error.html.erb @@ -0,0 +1,2 @@ +

Errors#error

+

Find me in app/views/errors/error.html.erb

diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb index 18eee059..9334ddba 100644 --- a/app/views/landing/index.html.erb +++ b/app/views/landing/index.html.erb @@ -13,13 +13,13 @@ -
-
+
+
- - + +
- +
@@ -38,11 +38,31 @@ - - - + - \ No newline at end of file + + + diff --git a/config/config.yml b/config/config.yml new file mode 100644 index 00000000..e72a9fec --- /dev/null +++ b/config/config.yml @@ -0,0 +1,3 @@ +default: + bbb_endpoint: <%= ENV['BIGBLUEBUTTON_ENDPOINT'] %> + bbb_secret: <%= ENV['BIGBLUEBUTTON_SECRET'] %> diff --git a/config/initializers/load_config.rb b/config/initializers/load_config.rb new file mode 100644 index 00000000..46b175b5 --- /dev/null +++ b/config/initializers/load_config.rb @@ -0,0 +1 @@ +APP_CONFIG = YAML.load_file("#{Rails.root}/config/config.yml")[Rails.env] \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 57c3044e..4da8b4c6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,7 @@ Rails.application.routes.draw do + get 'bbb/join/:id', to: 'bbb#join', as: :bbb_join + get 'bbb/close' + get 'meeting(/:id)', to: 'landing#index' root to: 'landing#index' diff --git a/sample.env b/sample.env new file mode 100644 index 00000000..132c23d3 --- /dev/null +++ b/sample.env @@ -0,0 +1,8 @@ +# This is a sample of the environment variables you will need for development +# To use, copy this file to .env `cp sample.env .env` + +RAILS_ENV=development + +# BigBlueButton +BIGBLUEBUTTON_ENDPOINT=http://test-install.blindsidenetworks.com/bigbluebutton/ +BIGBLUEBUTTON_SECRET=8cd8ef52e8e101574e400365b55e11a6 \ No newline at end of file diff --git a/test/controllers/bbb_controller_test.rb b/test/controllers/bbb_controller_test.rb new file mode 100644 index 00000000..4c017be1 --- /dev/null +++ b/test/controllers/bbb_controller_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class BbbControllerTest < ActionDispatch::IntegrationTest + test "should get join" do + get bbb_join_url + assert_response :success + end + + test "should get end" do + get bbb_end_url + assert_response :success + end + +end