Merge branch master into tests

This commit is contained in:
Joshua Arts 2018-06-28 11:29:30 -04:00
commit 63cdbdc874
11 changed files with 34 additions and 26 deletions

View File

@ -8,7 +8,7 @@ Greenlight is a simple front-end interface for your BigBlueButton server. At it'
* Invite others to your room using a simple URL.
* View recordings and share them with others.
Furthermore, Greenlight is completely configurable. This means you can turn on/off features to make Greenlight fit your specific use case. For more information on Greenlight and it's features, see our [documentation](http://docs.bigbluebutton.org/install/green-light.html).
Furthermore, Greenlight is completely configurable. This means you can turn on/off features to make Greenlight fit your specific use case. For more information on Greenlight and it's features, see our [documentation](http://docs.bigbluebutton.org/install/greenlight.html).
For a overview of how GreenLight works, checkout our [Introduction to Greenlight Video](https://youtu.be/yGX3JCv7OVM).

View File

@ -10,7 +10,9 @@ $(document).on("turbolinks:load", function(){
uid: $(".background").attr("room")
}, {
received: function(data){
if(data.action = "started"){ request_to_join_meeting(); }
if(data.action = "started"){
request_to_join_meeting();
}
}
});
}
@ -29,8 +31,8 @@ var request_to_join_meeting = function(){
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
},
error: function(){
// The meeting is still booting (going slowly), retry shortly.
success: function(){
// Enqueue another trial just incase they didn't actually join.
if(join_attempts < 4){ setTimeout(request_to_join_meeting, 10000); }
join_attempts++;
}

View File

@ -26,7 +26,7 @@
$background-color: #F5F7FB;
$error-background-color: #EFE6E6;
$footer-height: 80px;
$footer-height: 65px;
html, body {
width: 100%;
@ -45,9 +45,11 @@ a {
}
.footer {
position: fixed;
height: $footer-height;
width: 100%;
position: abolute;
bottom: 0px;
bottom: 0;
z-index: 5;
}
.table-responsive {

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class SessionsController < ApplicationController
LOGIN_FAILED = "Login failed due to invalid credentials. Are you sure you typed them correctly?"
# GET /users/logout
def destroy
logout
@ -10,8 +12,10 @@ class SessionsController < ApplicationController
# POST /users/login
def create
user = User.find_by(email: session_params[:email])
if user&.authenticate(session_params[:password])
if user.try(:authenticate, session_params[:password])
login(user)
else
redirect_to root_path, notice: LOGIN_FAILED
end
end

View File

@ -74,7 +74,6 @@ class Room < ApplicationRecord
# Generate the join URL.
join_opts = {}
join_opts[:userID] = uid if uid
join_opts[:joinViaHtml5] = true if Rails.configuration.html5_enabled
bbb.join_meeting_url(bbb_id, name, password, join_opts)
end

View File

@ -27,7 +27,7 @@
<i class="fas fa-exclamation-triangle"></i>
<p class="d-inline">This deployment is using a pre-configured testing server,
you should replace this with your own.
For details, see the <%= link_to "documentation", "http://docs.bigbluebutton.org/install/green-light.html#installing-greenlight", target: "_blank" %>.
For details, see the <%= link_to "documentation", "http://docs.bigbluebutton.org/install/greenlight.html#installing-greenlight", target: "_blank" %>.
<% end %>
<% end %>

View File

@ -1,3 +1,11 @@
<% unless flash.empty? %>
<%= render "shared/error_banner" do %>
<% flash.each do |key, value| %>
<%= content_tag :div, value, class: "flash #{key} d-inline" %>
<% end %>
<% end %>
<% end %>
<div class="background landing-section">
<div class="d-flex align-items-center" style="height: 100%;">
<div class="container text-center">

View File

@ -1,3 +1,3 @@
<div class="footer">
<footer class="footer page-footer">
<h5 class="text-center">Powered by <a target="_blank" href="http://bigbluebutton.org/">BigBlueButton</a>.</h5>
</div>
</footer>

View File

@ -1,8 +0,0 @@
# frozen_string_literal: true
# Send a request to check if the HTML5 client is enabled on the BigBlueButton server.
uri = URI.parse(Rails.configuration.bigbluebutton_endpoint.gsub('bigbluebutton/api', 'html5client/check'))
res = Net::HTTP.get_response(uri)
# Set the HTML5 status.
Rails.application.config.html5_enabled = (res.code.to_i == 200)

View File

@ -20,7 +20,7 @@ BIGBLUEBUTTON_SECRET=
#
# For in-depth steps on setting up a Google Login Provider, see:
#
# http://docs.bigbluebutton.org/install/green-light.html#google-oauth
# http://docs.bigbluebutton.org/install/greenlight.html#google-oauth2
#
# 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
@ -33,14 +33,16 @@ GOOGLE_OAUTH2_HD=
#
# For in-depth steps on setting up a Twitter Login Provider, see:
#
# http://docs.bigbluebutton.org/install/green-light.html#twitter-oauth
# http://docs.bigbluebutton.org/install/greenlight.html#twitter-oauth2
#
TWITTER_ID=
TWITTER_SECRET=
# Set this to true if you want GreenLight to support user signup and login without
# Omniauth. This will allow users to create an account at www.hostname.com/signup
# and use that account to fully interact with GreenLight.
# Omniauth. For more information, see:
#
# http://docs.bigbluebutton.org/install/greenlight.html#in-application-greenlight
#
ALLOW_GREENLIGHT_ACCOUNTS=true
# Prefix for the applications root URL.

View File

@ -78,11 +78,10 @@ describe Room, type: :model do
endpoint = Rails.configuration.bigbluebutton_endpoint
secret = Rails.configuration.bigbluebutton_secret
fullname = "fullName=Example"
html = Rails.configuration.html5_enabled ? "&joinViaHtml5=true" : ""
meeting_id = "&meetingID=#{@room.bbb_id}"
password = "&password=testpass"
query = fullname + html + meeting_id + password
query = fullname + meeting_id + password
checksum_string = "join#{query + secret}"
checksum = OpenSSL::Digest.digest('sha1', checksum_string).unpack("H*").first