Skip to content

Commit

Permalink
move common config setting to application.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
pengyin-shan committed Nov 4, 2022
1 parent 4daad39 commit 14effcf
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 24 deletions.
4 changes: 4 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class Application < Rails::Application

config.autoload_paths += %W[#{config.root}/lib]

# CVE-2022-32224: add some compatibility with YAML.safe_load
# Rails 5,6,7 are using YAML.safe_load as the default YAML deserializer
config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess, Symbol, Date, Time]

# HTML tags that are allowed to pass through `sanitize`.
config.action_view.sanitized_allowed_tags = %w[
p br strong em a table thead tbody tr td th tfoot caption ul ol li
Expand Down
4 changes: 0 additions & 4 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker

# CVE-2022-32224: add some compatibility with YAML.safe_load
# Rails 5,6,7 are using YAML.safe_load as the default YAML deserializer
config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess, Symbol, Date, Time]
end

# Used by Rails' routes url_helpers (typically when including a link in an email)
Expand Down
4 changes: 0 additions & 4 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# CVE-2022-32224: add some compatibility with YAML.safe_load
# Rails 5,6,7 are using YAML.safe_load as the default YAML deserializer
config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess, Symbol, Date, Time]

# Use syslog for logging
config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new('dmp_assistant'))

Expand Down
4 changes: 0 additions & 4 deletions config/environments/sandbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# CVE-2022-32224: add some compatibility with YAML.safe_load
# Rails 5,6,7 are using YAML.safe_load as the default YAML deserializer
config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess, Symbol, Date, Time]

# Use syslog for logging
config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new('dmp_assistant'))

Expand Down
4 changes: 0 additions & 4 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# CVE-2022-32224: add some compatibility with YAML.safe_load
# Rails 5,6,7 are using YAML.safe_load as the default YAML deserializer
config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess, Symbol, Date, Time]

# Use syslog for logging
config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new('dmp_assistant'))

Expand Down
4 changes: 0 additions & 4 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
# config.action_view.raise_on_missing_translations = true

config.i18n.enforce_available_locales = false

# CVE-2022-32224: add some compatibility with YAML.safe_load
# Rails 5,6,7 are using YAML.safe_load as the default YAML deserializer
config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess, Symbol, Date, Time]
end

# Used by Rails' routes url_helpers (typically when including a link in an email)
Expand Down
4 changes: 0 additions & 4 deletions config/environments/uat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@
# Use syslog for logging
config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new('dmp_assistant'))

# CVE-2022-32224: add some compatibility with YAML.safe_load
# Rails 5,6,7 are using YAML.safe_load as the default YAML deserializer
config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess, Symbol, Date, Time]

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

Expand Down

0 comments on commit 14effcf

Please sign in to comment.