diff --git a/app/assets/javascripts/meeting.coffee b/app/assets/javascripts/meeting.coffee index 6f93c046..c79ea908 100644 --- a/app/assets/javascripts/meeting.coffee +++ b/app/assets/javascripts/meeting.coffee @@ -47,6 +47,8 @@ class @Meeting url = location.protocol + '//' + location.hostname if location.port url += ':' + location.port + if GreenLight.relative_root + url += GreenLight.relative_root return url # Sends the end meeting request diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a3384de6..6c43a367 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -29,4 +29,9 @@ class ApplicationController < ActionController::Base @current_user ||= User.find_by(id: session[:user_id]) end helper_method :current_user + + def relative_root + Rails.configuration.relative_url_root || "" + end + helper_method :relative_root end diff --git a/app/controllers/bbb_controller.rb b/app/controllers/bbb_controller.rb index bff60339..7f8b3858 100644 --- a/app/controllers/bbb_controller.rb +++ b/app/controllers/bbb_controller.rb @@ -66,7 +66,7 @@ class BbbController < ApplicationController } end - base_url = "#{request.base_url}/#{params[:resource]}/#{meeting_path}" + base_url = "#{request.base_url}#{relative_root}/#{params[:resource]}/#{meeting_path}" options[:meeting_logout_url] = base_url options[:hook_url] = "#{base_url}/callback" diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 01bdb262..2e15f26e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -44,7 +44,7 @@ module ApplicationHelper end def omniauth_login_url(provider) - "/auth/#{provider}" + "#{relative_root}/auth/#{provider}" end # Whether the current page is the page of a room/meeting or not diff --git a/app/models/user.rb b/app/models/user.rb index 01a16ce4..f9a27a8d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -44,7 +44,7 @@ class User < ApplicationRecord end def room_url - "/rooms/#{encrypted_id}" + "#{Rails.configuration.relative_url_root}/rooms/#{encrypted_id}" end def set_encrypted_id diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index fe415073..c670ddb5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -18,8 +18,8 @@ with BigBlueButton; if not, see . Greenlight <%= csrf_meta_tags %> - <%= action_cable_meta_tag %> - + + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> @@ -53,6 +53,7 @@ with BigBlueButton; if not, see .