forked from DGNum/infrastructure
64 lines
3.6 KiB
Diff
64 lines
3.6 KiB
Diff
diff --git a/config/environments/production.rb b/config/environments/production.rb
|
|
index 16d8c8e84..6262b8782 100644
|
|
--- a/config/environments/production.rb
|
|
+++ b/config/environments/production.rb
|
|
@@ -118,7 +118,7 @@ Rails.application.configure do
|
|
# the I18n.default_locale when a translation cannot be found).
|
|
config.i18n.fallbacks = true
|
|
|
|
- config.active_storage.service = ENV.fetch("ACTIVE_STORAGE_SERVICE").to_sym
|
|
+ config.active_storage.service = ENV.fetch("ACTIVE_STORAGE_SERVICE", 'local').to_sym
|
|
|
|
# Send deprecation notices to registered listeners.
|
|
config.active_support.deprecation = :notify
|
|
@@ -174,5 +174,5 @@ Rails.application.configure do
|
|
# The Content-Security-Policy is NOT in Report-Only mode
|
|
config.content_security_policy_report_only = false
|
|
|
|
- config.lograge.enabled = ENV['LOGRAGE_ENABLED'] == 'enabled'
|
|
+ config.lograge.enabled = ENV.fetch('LOGRAGE_ENABLED', 'disabled') == 'enabled'
|
|
end
|
|
|
|
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb
|
|
index 135495216..4d4bcf8dc 100644
|
|
--- a/config/initializers/content_security_policy.rb
|
|
+++ b/config/initializers/content_security_policy.rb
|
|
@@ -23,7 +23,7 @@ Rails.application.config.content_security_policy do |policy|
|
|
connect_whitelist = ["wss://*.crisp.chat", "*.crisp.chat", "app.franceconnect.gouv.fr", "openmaptiles.geo.data.gouv.fr", "openmaptiles.github.io", "tiles.geo.api.gouv.fr", "wxs.ign.fr"]
|
|
connect_whitelist << ENV.fetch('APP_HOST')
|
|
connect_whitelist << "*.amazonaws.com" if Rails.configuration.active_storage.service == :amazon
|
|
- connect_whitelist += [URI(ENV["SENTRY_DSN_JS"]).host, URI(ENV["SENTRY_DSN_RAILS"]).host].compact.uniq
|
|
+ connect_whitelist += [URI(ENV.fetch("SENTRY_DSN_JS", '')).host, URI(ENV.fetch("SENTRY_DSN_RAILS", '')).host].compact.uniq
|
|
connect_whitelist << URI(DS_PROXY_URL).host if DS_PROXY_URL.present?
|
|
connect_whitelist << URI(API_ADRESSE_URL).host if API_ADRESSE_URL.present?
|
|
connect_whitelist << URI(API_EDUCATION_URL).host if API_EDUCATION_URL.present?
|
|
@@ -39,7 +39,7 @@ Rails.application.config.content_security_policy do |policy|
|
|
# Everything else: allow us
|
|
# Add the error source in the violation notification
|
|
default_whitelist = ["fonts.gstatic.com", "in-automate.sendinblue.com", "player.vimeo.com", "app.franceconnect.gouv.fr", "*.crisp.chat", "crisp.chat", "*.crisp.help", "*.sibautomation.com", "sibautomation.com", "data"]
|
|
- default_whitelist += [URI(ENV["SENTRY_DSN_JS"]).host, URI(ENV["SENTRY_DSN_RAILS"]).host].compact.uniq
|
|
+ default_whitelist += [URI(ENV.fetch("SENTRY_DSN_JS", '')).host, URI(ENV.fetch("SENTRY_DSN_RAILS", '')).host].compact.uniq
|
|
default_whitelist << URI(DS_PROXY_URL).host if DS_PROXY_URL.present?
|
|
policy.default_src(:self, :data, :blob, :report_sample, *default_whitelist)
|
|
|
|
diff --git a/config/initializers/mailcatcher.rb b/config/initializers/mailcatcher.rb
|
|
index 8b931f704..dbeceb4ec 100644
|
|
--- a/config/initializers/mailcatcher.rb
|
|
+++ b/config/initializers/mailcatcher.rb
|
|
@@ -1,4 +1,4 @@
|
|
-if ENV.fetch('MAILCATCHER_ENABLED') == 'enabled'
|
|
+if ENV.fetch('MAILCATCHER_ENABLED', 'disabled') == 'enabled'
|
|
ActiveSupport.on_load(:action_mailer) do
|
|
module Mailcatcher
|
|
class SMTP < ::Mail::SMTP; end
|
|
|
|
diff --git a/config/initializers/mailtrap.rb b/config/initializers/mailtrap.rb
|
|
index 6d1faa04b..658673ed1 100644
|
|
--- a/config/initializers/mailtrap.rb
|
|
+++ b/config/initializers/mailtrap.rb
|
|
@@ -1,4 +1,4 @@
|
|
-if ENV.fetch('MAILTRAP_ENABLED') == 'enabled'
|
|
+if ENV.fetch('MAILTRAP_ENABLED', 'disabled') == 'enabled'
|
|
ActiveSupport.on_load(:action_mailer) do
|
|
module Mailtrap
|
|
class SMTP < ::Mail::SMTP; end
|