This commit is contained in:
5
config/initializers/active_storage.rb
Normal file
5
config/initializers/active_storage.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
ActiveSupport.on_load(:active_storage_blob) do
|
||||
ActiveStorage::DiskController.after_action only: :show do
|
||||
expires_in 1.year, public: true
|
||||
end
|
||||
end
|
||||
7
config/initializers/assets.rb
Normal file
7
config/initializers/assets.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets.
|
||||
Rails.application.config.assets.version = "1.0"
|
||||
|
||||
# Add additional assets to the asset load path.
|
||||
# Rails.application.config.assets.paths << Emoji.images_path
|
||||
25
config/initializers/content_security_policy.rb
Normal file
25
config/initializers/content_security_policy.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Define an application-wide content security policy.
|
||||
# See the Securing Rails Applications Guide for more information:
|
||||
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
||||
|
||||
# Rails.application.configure do
|
||||
# config.content_security_policy do |policy|
|
||||
# policy.default_src :self, :https
|
||||
# policy.font_src :self, :https, :data
|
||||
# policy.img_src :self, :https, :data
|
||||
# policy.object_src :none
|
||||
# policy.script_src :self, :https
|
||||
# policy.style_src :self, :https
|
||||
# # Specify URI for violation reports
|
||||
# # policy.report_uri "/csp-violation-report-endpoint"
|
||||
# end
|
||||
#
|
||||
# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
|
||||
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
||||
# config.content_security_policy_nonce_directives = %w(script-src style-src)
|
||||
#
|
||||
# # Report violations without enforcing the policy.
|
||||
# # config.content_security_policy_report_only = true
|
||||
# end
|
||||
11
config/initializers/enable_yjit.rb
Normal file
11
config/initializers/enable_yjit.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
# Automatically enable YJIT as of Ruby 3.3, as it brings very
|
||||
# sizeable performance improvements.
|
||||
|
||||
# If you are deploying to a memory constrained environment
|
||||
# you may want to delete this file, but otherwise it's free
|
||||
# performance.
|
||||
if defined? RubyVM::YJIT.enable
|
||||
Rails.application.config.after_initialize do
|
||||
RubyVM::YJIT.enable
|
||||
end
|
||||
end
|
||||
1
config/initializers/extensions.rb
Normal file
1
config/initializers/extensions.rb
Normal file
@@ -0,0 +1 @@
|
||||
Dir["#{Rails.root}/lib/rails_ext/*"].each { |path| require "rails_ext/#{File.basename(path)}" }
|
||||
8
config/initializers/filter_parameter_logging.rb
Normal file
8
config/initializers/filter_parameter_logging.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
|
||||
# Use this to limit dissemination of sensitive information.
|
||||
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
||||
Rails.application.config.filter_parameters += [
|
||||
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
||||
]
|
||||
3
config/initializers/inflections.rb
Normal file
3
config/initializers/inflections.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||
inflect.irregular "leaf", "leaves"
|
||||
end
|
||||
4
config/initializers/markdown.rb
Normal file
4
config/initializers/markdown.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
ActiveSupport.on_load :action_text_markdown do
|
||||
require "markdown_renderer"
|
||||
ActionText::Markdown.renderer = -> { MarkdownRenderer.build }
|
||||
end
|
||||
13
config/initializers/permissions_policy.rb
Normal file
13
config/initializers/permissions_policy.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Define an application-wide HTTP permissions policy. For further
|
||||
# information see: https://developers.google.com/web/updates/2018/06/feature-policy
|
||||
|
||||
# Rails.application.config.permissions_policy do |policy|
|
||||
# policy.camera :none
|
||||
# policy.gyroscope :none
|
||||
# policy.microphone :none
|
||||
# policy.usb :none
|
||||
# policy.fullscreen :self
|
||||
# policy.payment :self, "https://secure.example.com"
|
||||
# end
|
||||
17
config/initializers/sqlite3.rb
Normal file
17
config/initializers/sqlite3.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
module SQLite3Configuration
|
||||
private
|
||||
def configure_connection
|
||||
super
|
||||
|
||||
if @config[:retries]
|
||||
retries = self.class.type_cast_config_to_integer(@config[:retries])
|
||||
raw_connection.busy_handler do |count|
|
||||
(count <= retries).tap { |result| sleep count * 0.001 if result }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ActiveSupport.on_load :active_record do
|
||||
ActiveRecord::ConnectionAdapters::SQLite3Adapter.prepend SQLite3Configuration
|
||||
end
|
||||
2
config/initializers/version.rb
Normal file
2
config/initializers/version.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
Rails.application.config.app_version = ENV.fetch("APP_VERSION", "0")
|
||||
Rails.application.config.git_revision = ENV["GIT_REVISION"]
|
||||
Reference in New Issue
Block a user