make upgrading from 1.0 easier

v2
Joshua Arts 5 years ago
parent fd1b550f93
commit e2ad6e7715
  1. 2
      .dockerignore
  2. 2
      .gitignore
  3. 6
      Dockerfile
  4. 4
      README.md
  5. 7
      app/controllers/application_controller.rb
  6. 16
      app/views/application/migration_error.html.erb
  7. 4
      bin/start
  8. 5
      config/environments/production.rb
  9. 2
      config/puma.rb
  10. 10
      docker-compose.yml
  11. 12
      greenlight.nginx
  12. 4
      sample.env

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

2
.gitignore vendored

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

@ -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
@ -23,8 +23,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"]

@ -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:

@ -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

@ -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="" target="_blank">
<i class="far fa-hand-paper mr-2"></i>I'd like to stay using 1.0.
</a>
</div>
</div>
</div>

@ -1,6 +1,8 @@
#!/bin/bash
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

@ -87,6 +87,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

@ -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.
#

@ -1,14 +1,14 @@
version: '3'
services:
services:
app:
entrypoint: [bin/start]
image: joshblind/greenlight:latest
container_name: greenlight-web
image: joshblind/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

@ -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;

@ -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