pvincent
3 months ago
7 changed files with 104 additions and 142 deletions
-
25config/initializers/content_security_policy.rb
-
16config/initializers/inflections.rb
-
14config/initializers/monkey_patcher.rb
-
13config/initializers/permissions_policy.rb
-
3config/initializers/rails_live_reload.rb
-
21lib/hot/constants.rb
-
20lib/monkey_patches/rails_live_reload/watcher.rb
@ -1,25 +0,0 @@ |
|||||
# 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 |
|
@ -1,16 +0,0 @@ |
|||||
# Be sure to restart your server when you modify this file. |
|
||||
|
|
||||
# Add new inflection rules using the following format. Inflections |
|
||||
# are locale specific, and you may define rules for as many different |
|
||||
# locales as you wish. All of these examples are active by default: |
|
||||
# ActiveSupport::Inflector.inflections(:en) do |inflect| |
|
||||
# inflect.plural /^(ox)$/i, "\\1en" |
|
||||
# inflect.singular /^(ox)en/i, "\\1" |
|
||||
# inflect.irregular "person", "people" |
|
||||
# inflect.uncountable %w( fish sheep ) |
|
||||
# end |
|
||||
|
|
||||
# These inflection rules are supported but not enabled by default: |
|
||||
# ActiveSupport::Inflector.inflections(:en) do |inflect| |
|
||||
# inflect.acronym "RESTful" |
|
||||
# end |
|
@ -1,14 +1,14 @@ |
|||||
return unless Rails.application.server? |
return unless Rails.application.server? |
||||
|
|
||||
puts 'MonkeyPatcher runs:' |
|
||||
|
# puts 'MonkeyPatcher runs:' |
||||
patches = Dir.glob(Rails.root.join('lib', 'monkey_patches', '**', '*.rb')) |
patches = Dir.glob(Rails.root.join('lib', 'monkey_patches', '**', '*.rb')) |
||||
patches.each do |file| |
patches.each do |file| |
||||
puts "🐵 patching... #{Pathname.new(file).relative_path_from Rails.root}" |
|
||||
|
# puts "🐵 patching... #{Pathname.new(file).relative_path_from Rails.root}" |
||||
require file |
require file |
||||
end |
end |
||||
|
|
||||
puts case patches.count |
|
||||
when 0 then 'No patch found' |
|
||||
when 1 then '1 successful patch applied' |
|
||||
else "#{patches.count} successful patches applied" |
|
||||
end |
|
||||
|
# puts case patches.count |
||||
|
# when 0 then 'No patch found' |
||||
|
# when 1 then '1 successful patch applied' |
||||
|
# else "#{patches.count} successful patches applied" |
||||
|
# end |
@ -1,13 +0,0 @@ |
|||||
# 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 |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue