Skip to content

Commit

Permalink
Merge branch 'bigbluebutton:fix-migration' into fix-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil authored Feb 10, 2024
2 parents 5ac2561 + 167c7dc commit e3c49a1
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 24 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Metrics/BlockLength:
AllowedMethods: [ 'describe', 'context', 'xdescribe', 'xcontext', 'FactoryBot.define' ]
Exclude:
- 'config/routes.rb'
- 'config/environments/production.rb'
Max: 70

Metrics/ClassLength:
Expand Down
7 changes: 7 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,11 @@

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# Enable HSTS in production mode
config.force_ssl = true
config.ssl_options = {
redirect: { exclude: ->(request) { request.path.include?('health_check') } },
hsts: { expires: 1.year, subdomains: true }
}
end
12 changes: 9 additions & 3 deletions config/initializers/session_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
# frozen_string_literal: true

if ENV['LOADBALANCER_ENDPOINT'].present?
Rails.application.config.session_store :cookie_store, key: '_greenlight-3_0_session', domain: ENV.fetch('SESSION_DOMAIN_NAME', nil),
path: ENV.fetch('RELATIVE_URL_ROOT', '/')
Rails.application.config.session_store :cookie_store,
key: '_greenlight-3_0_session',
domain: ENV.fetch('SESSION_DOMAIN_NAME', nil),
secure: Rails.env.production?,
path: ENV.fetch('RELATIVE_URL_ROOT', '/')
else
Rails.application.config.session_store :cookie_store, key: '_greenlight-3_0_session', path: ENV.fetch('RELATIVE_URL_ROOT', '/')
Rails.application.config.session_store :cookie_store,
key: '_greenlight-3_0_session',
secure: Rails.env.production?,
path: ENV.fetch('RELATIVE_URL_ROOT', '/')
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ class AddDefaultRecordingVisibilityToSettings < ActiveRecord::Migration[7.1]
def up
setting = Setting.create!(name: 'DefaultRecordingVisibility')
SiteSetting.create!(setting:, value: 'Published', provider: 'greenlight')
Tenant.all.each do |tenant|
SiteSetting.create!(setting:, value: 'Published', provider: tenant.name)
end
end

def down
Expand Down
18 changes: 18 additions & 0 deletions db/data/20240125154727_add_help_center_setting.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

class AddHelpCenterSetting < ActiveRecord::Migration[7.1]
def up
setting = Setting.create(name: 'HelpCenter') unless Setting.exists?(name: 'HelpCenter')

SiteSetting.create(setting:, value: '', provider: 'greenlight') unless SiteSetting.exists?(setting:, value: '', provider: 'greenlight')

Tenant.all.each do |tenant|
SiteSetting.find_or_create_by(setting:, value: '', provider: tenant.name)
end
end

def down
Setting.find_by(name: 'HelpCenter')&.destroy
SiteSetting.find_by(setting: Setting.find_by(name: 'HelpCenter')).destroy
end
end
2 changes: 1 addition & 1 deletion db/data_schema.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DataMigrate::Data.define(version: 20231213203353)
DataMigrate::Data.define(version: 20240125154727)
20 changes: 0 additions & 20 deletions db/migrate/20231218154727_add_help_center_setting.rb

This file was deleted.

0 comments on commit e3c49a1

Please sign in to comment.