Merge branch 'master' into bn_launcher_integration

This commit is contained in:
bruckwubete 2018-07-09 13:20:34 -04:00
commit 590e189474
12 changed files with 52 additions and 24 deletions

View File

@ -14,7 +14,7 @@ tmp
/db/**/*.sqlite3-journal
/db/production
public/assets
public/gl
public/b
coverage/
spec/tmp
.rvmrc

2
.gitignore vendored
View File

@ -14,7 +14,7 @@
# Ignore static assets.
/public/system/**
/public/assets/**
/public/gl/**
/public/b/**
# Ignore production paths.
/db/production

View File

@ -1,7 +1,7 @@
FROM ruby:2.5
# Install app dependencies.
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable for the install location.
ENV RAILS_ROOT /usr/src/app
@ -26,8 +26,8 @@ RUN bundle install --without development test --deployment --clean
RUN bundle exec rake assets:clean
RUN bundle exec rake assets:precompile
# Expose port 3000.
EXPOSE 3000
# Expose port 80.
EXPOSE 80
# Start the application.
CMD ["bin/start"]

View File

@ -1,5 +1,7 @@
# Greenlight
Greenlight is currently on version 2.0. If you are still running Greenlight 1.0 we suggest [upgrading to 2.0](http://docs.bigbluebutton.org/install/greenlight-v2.html#upgrading-from-greenlight-10).
Greenlight is a simple front-end interface for your BigBlueButton server. At it's heart, Greenlight provides a minimalistic web-based application that allows users to:
* Signup/Login with Twitter, Google, or through the application itself.
@ -10,7 +12,7 @@ Greenlight is a simple front-end interface for your BigBlueButton server. At it'
Interested? Try Greenlight out on our [demo server](https://demo.bigbluebutton.org/gl)!
Greenlight is also completely configurable. This means you can turn on/off features to make Greenlight fit your specific use case. For more information on Greenlight and its features, see our [documentation](http://docs.bigbluebutton.org/install/greenlight.html).
Greenlight is also completely configurable. This means you can turn on/off features to make Greenlight fit your specific use case. For more information on Greenlight and its features, see our [documentation](http://docs.bigbluebutton.org/install/greenlight-v2.html).
For a overview of how Greenlight works, checkout our Introduction to Greenlight Video:

View File

@ -5,6 +5,13 @@ require 'bigbluebutton_api'
class ApplicationController < ActionController::Base
include SessionsHelper
before_action :migration_error?
# Show an information page when migration fails and there is a version error.
def migration_error?
render :migration_error unless ENV["DB_MIGRATE_FAILED"].blank?
end
protect_from_forgery with: :exception
MEETING_NAME_LIMIT = 90

View File

@ -0,0 +1,16 @@
<div class="page mt-0">
<div class="page-content mt-0">
<div class="container text-center">
<i class="fas fa-database fa-6x mb-4"></i>
<h1 class="h3 mb-2">Greenlight encountered a database migration error.<br>This may be because you haven't updated to Greenlight 2.0.</h1>
<p class="h4 text-muted font-weight-normal mb-7">If you are not an administrator, please contact one.</p>
<h1 class="h3 mb-3">We've released a new version of Greenlight, but your database isn't compatible.</h1>
<a class="btn btn-success mt-3 mx-3" href="http://docs.bigbluebutton.org/install/greenlight-v2.html#upgrading-from-greenlight-10" target="_blank">
<i class="far fa-star mr-2"></i>Show me how to upgrade to 2.0!
</a>
<a class="btn btn-info mt-3 mx-3 w-20" href="http://docs.bigbluebutton.org/install/greenlight-v2.html#remaining-on-greenlight-10" target="_blank">
<i class="far fa-hand-paper mr-2"></i>I'd like to stay using 1.0.
</a>
</div>
</div>
</div>

View File

@ -8,6 +8,8 @@ if [ "$RAILS_ENV" = "production" ]; then
fi
bundle exec rake db:create
bundle exec rake db:migrate
if ! bundle exec rake db:migrate ; then
export DB_MIGRATE_FAILED=1
fi
exec bundle exec puma -C config/puma.rb

View File

@ -90,6 +90,7 @@ Rails.application.configure do
config.active_record.dump_schema_after_migration = false
# Set the relative url root for deployment to a subdirectory.
config.relative_url_root = "/"
config.relative_url_root = ENV['RELATIVE_URL_ROOT'] if ENV['RELATIVE_URL_ROOT'].present?
if ENV['RELATIVE_URL_ROOT'] != "/"
config.relative_url_root = ENV['RELATIVE_URL_ROOT'] || "/b"
end
end

View File

@ -11,7 +11,7 @@ threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
#
port ENV.fetch("PORT") { 3000 }
port ENV.fetch("PORT") { 80 }
# Specifies the `environment` that Puma will run in.
#

View File

@ -1,14 +1,14 @@
version: '3'
services:
services:
app:
entrypoint: [bin/start]
image: joshblind/greenlight:latest
container_name: greenlight-web
image: bigbluebutton/greenlight:v2
container_name: greenlight-v2
env_file: env
restart: unless-stopped
ports:
- 6000:3000
volumes:
- 5000:80
volumes:
- ./db/production:/usr/src/app/db/production
- ./log:/usr/src/app/log

View File

@ -1,18 +1,18 @@
# Routes requests to Greenlight based on the '/gl' prefix.
# Use this file to route '/gl' paths on your BigBlueButton server
# Routes requests to Greenlight based on the '/b' prefix.
# Use this file to route '/b' paths on your BigBlueButton server
# to the Greenlight application. If you are using a different
# subpath, you should change it here.
location /gl {
proxy_pass http://127.0.0.1:6000;
location /b {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
}
location /gl/cable {
proxy_pass http://127.0.0.1:6000;
location /b/cable {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

View File

@ -3,7 +3,7 @@
# You can generate a secure one through the Greenlight docker image
# with with the command.
#
# docker run --rm bigbluebutton/greenlight bundle exec rake secret
# docker run --rm bigbluebutton/greenlight:v2 bundle exec rake secret
#
SECRET_KEY_BASE=
@ -50,6 +50,6 @@ ALLOW_GREENLIGHT_ACCOUNTS=true
# if deploying on a BigBlueButton server. Keep in mind that if you change this, you'll
# have to update your authentication callback URL's to reflect this change.
#
# The recommended prefix is "/gl".
# The recommended prefix is "/b".
#
RELATIVE_URL_ROOT=/gl
RELATIVE_URL_ROOT=/b