# HG changeset patch # User nanaya # Date 1607626059 -32400 # Node ID 2335107f35d03ed0efebdb8f47ebb65d66941a34 # Parent 609e96a79ad8d47f116bccf1b457a29c9cb694aa Run rails update diff -r 609e96a79ad8 -r 2335107f35d0 bin/rails --- a/bin/rails Fri Dec 11 03:41:31 2020 +0900 +++ b/bin/rails Fri Dec 11 03:47:39 2020 +0900 @@ -1,4 +1,4 @@ #!/usr/bin/env ruby APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' +require_relative "../config/boot" +require "rails/commands" diff -r 609e96a79ad8 -r 2335107f35d0 bin/rake --- a/bin/rake Fri Dec 11 03:41:31 2020 +0900 +++ b/bin/rake Fri Dec 11 03:47:39 2020 +0900 @@ -1,4 +1,4 @@ #!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' +require_relative "../config/boot" +require "rake" Rake.application.run diff -r 609e96a79ad8 -r 2335107f35d0 bin/setup --- a/bin/setup Fri Dec 11 03:41:31 2020 +0900 +++ b/bin/setup Fri Dec 11 03:47:39 2020 +0900 @@ -1,5 +1,5 @@ #!/usr/bin/env ruby -require 'fileutils' +require "fileutils" # path to your application root. APP_ROOT = File.expand_path('..', __dir__) @@ -9,8 +9,8 @@ end FileUtils.chdir APP_ROOT do - # This script is a way to setup or update your development environment automatically. - # This script is idempotent, so that you can run it at anytime and get an expectable outcome. + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. # Add necessary setup steps to this file. puts '== Installing dependencies ==' diff -r 609e96a79ad8 -r 2335107f35d0 config.ru --- a/config.ru Fri Dec 11 03:41:31 2020 +0900 +++ b/config.ru Fri Dec 11 03:47:39 2020 +0900 @@ -3,3 +3,4 @@ require_relative "config/environment" run Rails.application +Rails.application.load_server diff -r 609e96a79ad8 -r 2335107f35d0 config/application.rb --- a/config/application.rb Fri Dec 11 03:41:31 2020 +0900 +++ b/config/application.rb Fri Dec 11 03:47:39 2020 +0900 @@ -24,6 +24,7 @@ module Rsstweet class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. config.load_defaults 6.1 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers diff -r 609e96a79ad8 -r 2335107f35d0 config/boot.rb --- a/config/boot.rb Fri Dec 11 03:41:31 2020 +0900 +++ b/config/boot.rb Fri Dec 11 03:47:39 2020 +0900 @@ -1,3 +1,3 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -require 'bundler/setup' # Set up gems listed in the Gemfile. +require "bundler/setup" # Set up gems listed in the Gemfile. diff -r 609e96a79ad8 -r 2335107f35d0 config/environment.rb --- a/config/environment.rb Fri Dec 11 03:41:31 2020 +0900 +++ b/config/environment.rb Fri Dec 11 03:47:39 2020 +0900 @@ -1,5 +1,5 @@ # Load the Rails application. -require_relative 'application' +require_relative "application" # Initialize the Rails application. Rails.application.initialize! diff -r 609e96a79ad8 -r 2335107f35d0 config/environments/development.rb --- a/config/environments/development.rb Fri Dec 11 03:41:31 2020 +0900 +++ b/config/environments/development.rb Fri Dec 11 03:47:39 2020 +0900 @@ -1,8 +1,10 @@ +require "active_support/core_ext/integer/time" + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false @@ -31,10 +33,23 @@ # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. - # config.action_view.raise_on_missing_translations = true + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true # 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 + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true end diff -r 609e96a79ad8 -r 2335107f35d0 config/environments/production.rb --- a/config/environments/production.rb Fri Dec 11 03:41:31 2020 +0900 +++ b/config/environments/production.rb Fri Dec 11 03:47:39 2020 +0900 @@ -1,3 +1,5 @@ +require "active_support/core_ext/integer/time" + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -23,7 +25,7 @@ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' + # config.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 @@ -32,12 +34,12 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Use the lowest log level to ensure availability of diagnostic information - # when problems arise. - config.log_level = :debug + # Include generic and useful information about system operation, but avoid logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). + config.log_level = :info # Prepend all log lines with the following tags. - config.log_tags = [:request_id] + config.log_tags = [ :request_id ] # Use a different cache store in production. # config.cache_store = :mem_cache_store @@ -53,11 +55,17 @@ # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify + # Log disallowed deprecations. + config.active_support.disallowed_deprecation = :log + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Use a different logger for distributed setups. - # require 'syslog/logger' + # require "syslog/logger" # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV["RAILS_LOG_TO_STDOUT"].present? diff -r 609e96a79ad8 -r 2335107f35d0 config/environments/test.rb --- a/config/environments/test.rb Fri Dec 11 03:41:31 2020 +0900 +++ b/config/environments/test.rb Fri Dec 11 03:47:39 2020 +0900 @@ -1,3 +1,5 @@ +require "active_support/core_ext/integer/time" + # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped @@ -33,6 +35,15 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + # Raises error for missing translations. - # config.action_view.raise_on_missing_translations = true + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true end diff -r 609e96a79ad8 -r 2335107f35d0 config/initializers/backtrace_silencers.rb --- a/config/initializers/backtrace_silencers.rb Fri Dec 11 03:41:31 2020 +0900 +++ b/config/initializers/backtrace_silencers.rb Fri Dec 11 03:47:39 2020 +0900 @@ -1,7 +1,8 @@ # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } +# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code +# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". +Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] diff -r 609e96a79ad8 -r 2335107f35d0 config/initializers/content_security_policy.rb --- a/config/initializers/content_security_policy.rb Fri Dec 11 03:41:31 2020 +0900 +++ b/config/initializers/content_security_policy.rb Fri Dec 11 03:47:39 2020 +0900 @@ -19,6 +19,9 @@ # If you are using UJS then enable automatic nonce generation # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } +# Set the nonce only to specific directives +# Rails.application.config.content_security_policy_nonce_directives = %w(script-src) + # Report CSP violations to a specified URI # For further information see the following documentation: # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only diff -r 609e96a79ad8 -r 2335107f35d0 config/initializers/filter_parameter_logging.rb --- a/config/initializers/filter_parameter_logging.rb Fri Dec 11 03:41:31 2020 +0900 +++ b/config/initializers/filter_parameter_logging.rb Fri Dec 11 03:47:39 2020 +0900 @@ -1,4 +1,6 @@ # Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff -r 609e96a79ad8 -r 2335107f35d0 config/initializers/permissions_policy.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/initializers/permissions_policy.rb Fri Dec 11 03:47:39 2020 +0900 @@ -0,0 +1,11 @@ +# 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 |f| +# f.camera :none +# f.gyroscope :none +# f.microphone :none +# f.usb :none +# f.fullscreen :self +# f.payment :self, "https://secure.example.com" +# end