This repository has been archived on 2021-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
greenlight/config/environments/production.rb

171 lines
6.7 KiB
Ruby
Raw Normal View History

2018-06-26 10:29:46 -04:00
# frozen_string_literal: true
2018-05-07 16:06:01 -04:00
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
if ENV['REDIS_URL'].present?
# Set up Redis cache store
config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'],
connect_timeout: 30, # Defaults to 20 seconds
read_timeout: 0.2, # Defaults to 1 second
write_timeout: 0.2, # Defaults to 1 second
reconnect_attempts: 1, # Defaults to 0
error_handler: lambda { |method:, returning:, exception:|
config.logger.warn "Support: Redis cache action #{method} failed and returned '#{returning}': #{exception}"
} }
else
config.cache_store = :memory_store
end
2019-08-14 17:05:14 -04:00
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.years.to_i}"
}
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
2018-05-07 16:06:01 -04:00
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
2018-06-19 16:43:27 -04:00
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].blank?
2018-05-07 16:06:01 -04:00
# Compress JavaScripts and CSS.
2018-06-14 14:22:19 -04:00
config.assets.js_compressor = Uglifier.new(harmony: true)
2018-05-07 16:06:01 -04:00
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
2018-05-07 16:06:01 -04:00
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Store uploaded files on the local file system (see config/storage.yml for options)
Merge v2.7-alpha (#1951) * Fix wrong conditional (reported by LGTM) (#1477) Signed-off-by: Stefan Weil <sw@weilnetz.de> Co-authored-by: Ahmad Farhat <ahmad.af.farhat@gmail.com> * Bump rack from 2.2.2 to 2.2.3 (#1839) Bumps [rack](https://github.com/rack/rack) from 2.2.2 to 2.2.3. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v2.2.2...2.2.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [FIX] Unable to edit long recording names #1776 (#1780) * Allow to set a filter for LDAP authentication * [FIX] Unable to edit long recording names #1776 Co-authored-by: François Ménabé <francois.menabe@unistra.fr> Co-authored-by: farhatahmad <ahmad.af.farhat@gmail.com> * Desgin for Manage Users Tabs (#1777) * Update _subtitle.html.erb * Update _manage_users_tags.html.erb * Update admins.scss * Update _primary_themes.scss * Update _manage_users_tags.html.erb * Minor style changes to manage users (#1845) * Maintenance banner moved to admin site (#1775) * initial * finish * travis fixes * travis again * not required * Co-authored-by: Tobias Fiebig <t.fiebig@tudelft.nl> (#1296) Co-authored-by: Ahmad Farhat <ahmad.af.farhat@gmail.com> * Enhance Room OpenGraph Metadata (#1601) * Revert "Enhance Room OpenGraph Metadata (#1601)" (#1852) This reverts commit 3b007c233ae12e0407f216ae269c63d6179f73b8. * GRN2-xx: Tab title now displays the current page name (#1853) * Tab title now displays the current page name * Added page title for the rest of the pages * Split Site Settings into 3 different tabs (#1858) * Split Site Settings into 3 different tabs * Fix copyright * Added redirect to correct tab * Make sure settings are displaying when they should * Update en.yml (#1857) * Build images for alpha branches (#1867) * Upgraded jquery to latest version (#1896) * Added favicon tag (#1898) * Fixed XSS issue with role name (#1899) * Update path for coloring redirect (#1908) * Added a fourth section to the room uid (#1910) * Fixed issue with insecure room sharing removal (#1914) * Fixes typo (#1917) Fixes typo: successfully was written incorrect. * Fixed order of rooms in server rooms (#1915) * Change default room sort to latest activity (#1919) * GRN2-xx: Small changes/improvements to the recording settings (#1851) * Small changes/improvements to the recording settings * Replaced room warning with info flash * Added global setting to enable/disable the recording consent feature * Replace Legal with Terms (#1931) * Added a more friendly OpenGraph description when invited to join a room (#1932) * Fixed issue causing maintenance banner not to hide correctly (#1933) * Hide recording menu and recording list when it is disabled (#1935) * Hide recording menu and recording list when it is disabled * Hide recording list when disabled * GRN2-xx: Added an auto-refresh after 2 mins while waiting for room to start (#1947) * Added an auto-refresh after 2 mins while waiting for room to start * Fixed random issue with test case * GRN2-xx: Added ability to preupload presentations to rooms (#1895) * Added ability to preupload presentations to rooms (#1868) * Added setting to site settings and allowed admins to change the presentation * Added AWS S3 and GCS Storage ENV variables * Added check to ensure file extension is correct * Added icon to remove presentation * Added testcases for preupload * Add nginx redirect to solve issue with relative root * Record title, instead of room name, in the popup (#1924) * Update _public_recording_row.html.erb * Update _recording_row.html.erb Co-authored-by: Stefan Weil <sw@weilnetz.de> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: beckerr-rzht <beckerr@hochschule-trier.de> Co-authored-by: François Ménabé <francois.menabe@unistra.fr> Co-authored-by: MrKeksi <mrkeksi@users.noreply.github.com> Co-authored-by: yanosz <yanosz@users.noreply.github.com> Co-authored-by: Moritz Schlarb <moschlar@metalabs.de> Co-authored-by: chronikum <34622984+chronikum@users.noreply.github.com> Co-authored-by: Mitsutaka Sato <miztaka@honestyworks.jp> Co-authored-by: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
2020-07-29 11:03:22 -04:00
config.active_storage.service = if ENV["AWS_ACCESS_KEY_ID"].present?
:amazon
elsif ENV["GCS_PRIVATE_KEY_ID"].present?
:google
else
:local
end
2018-05-07 16:06:01 -04:00
# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
2018-08-02 14:58:20 -04:00
config.force_ssl = (ENV["ENABLE_SSL"] == "true")
# Don't wrap form components in field_with_error divs
ActionView::Base.field_error_proc = proc do |html_tag|
html_tag.html_safe
end
2018-05-07 16:06:01 -04:00
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
2018-10-26 11:59:49 -04:00
# Tell Action Mailer to use smtp server, if configured
config.action_mailer.delivery_method = ENV['SMTP_SERVER'].present? ? :smtp : :sendmail
ActionMailer::Base.smtp_settings = if ENV['SMTP_AUTH'].present? && ENV['SMTP_AUTH'] != "none"
{
address: ENV['SMTP_SERVER'],
port: ENV["SMTP_PORT"],
domain: ENV['SMTP_DOMAIN'],
user_name: ENV['SMTP_USERNAME'],
password: ENV['SMTP_PASSWORD'],
authentication: ENV['SMTP_AUTH'],
enable_starttls_auto: ENV['SMTP_STARTTLS_AUTO'],
}
else
{
address: ENV['SMTP_SERVER'],
port: ENV["SMTP_PORT"],
domain: ENV['SMTP_DOMAIN'],
enable_starttls_auto: ENV['SMTP_STARTTLS_AUTO'],
}
end
# enable SMTPS: SMTP over direct TLS connection
ActionMailer::Base.smtp_settings[:tls] = true if ENV['SMTP_TLS'].present? && ENV['SMTP_TLS'] != "false"
# If configured to 'none' don't check the smtp servers certificate
ActionMailer::Base.smtp_settings[:openssl_verify_mode] =
ENV['SMTP_OPENSSL_VERIFY_MODE'] if ENV['SMTP_OPENSSL_VERIFY_MODE'].present?
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = true
2018-05-07 16:06:01 -04:00
# Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "greenlight-2_0_#{Rails.env}"
config.action_mailer.perform_caching = false
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Specify the log level
config.log_level = ENV["RAILS_LOG_LEVEL"].present? ? ENV['RAILS_LOG_LEVEL'].to_sym : :info
# Use Lograge for logging
config.lograge.enabled = true
2018-05-07 16:06:01 -04:00
config.lograge.ignore_actions = ["HealthCheckController#all", "ThemesController#index",
"ApplicationCable::Connection#connect", "WaitingChannel#subscribe",
"ApplicationCable::Connection#disconnect", "WaitingChannel#unsubscribe"]
config.lograge.custom_options = lambda do |event|
# capture some specific timing values you are interested in
{ host: event.payload[:host] }
end
config.log_formatter = proc do |severity, time, _progname, msg|
"#{time} - #{severity}: #{msg} \n"
end
# Prepend all log lines with the following tags.
2021-03-23 18:20:48 -04:00
config.log_tags = [:request_id, :remote_ip]
if ENV["RAILS_LOG_TO_STDOUT"] == "true"
logger = ActiveSupport::Logger.new($stdout)
2018-05-07 16:06:01 -04:00
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
elsif ENV["RAILS_LOG_REMOTE_NAME"] && ENV["RAILS_LOG_REMOTE_PORT"]
require 'remote_syslog_logger'
logger_program = ENV["RAILS_LOG_REMOTE_TAG"] || "greenlight-#{ENV['RAILS_ENV']}"
logger = RemoteSyslogLogger.new(ENV["RAILS_LOG_REMOTE_NAME"],
ENV["RAILS_LOG_REMOTE_PORT"], program: logger_program)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
2018-05-07 16:06:01 -04:00
end
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
# Set the relative url root for deployment to a subdirectory.
2020-01-24 15:09:56 -05:00
config.relative_url_root = ENV['RELATIVE_URL_ROOT'] || "/b" if ENV['RELATIVE_URL_ROOT'] != "/"
config.hosts = ENV['SAFE_HOSTS'].presence || nil
2018-05-07 16:06:01 -04:00
end