From 5d1af76df88e05864ea9d750fc88f523cb1a0a37 Mon Sep 17 00:00:00 2001 From: Adrien Poly Date: Wed, 10 Jul 2024 00:34:58 +0200 Subject: [PATCH] Rails 7.2.beta (#81) * increase web concurency * wip * update dependencies * add comment --- Gemfile | 4 +- Gemfile.lock | 189 +++++++++--------- app/models/organisation.rb | 4 +- app/models/suggestion.rb | 2 +- bin/brakeman | 7 + bin/rubocop | 8 + bin/setup | 9 +- config/application.rb | 16 +- config/deploy.yml | 2 +- config/environments/development.rb | 11 +- config/environments/production.rb | 20 +- config/environments/test.rb | 11 +- config/initializers/assets.rb | 5 - .../initializers/content_security_policy.rb | 9 - .../initializers/filter_parameter_logging.rb | 8 +- db/cache_schema.rb | 2 +- ..._to_active_storage_blobs.active_storage.rb | 22 ++ ..._storage_variant_records.active_storage.rb | 28 +++ ...e_storage_blobs_checksum.active_storage.rb | 8 + db/queue_schema.rb | 2 +- public/406-unsupported-browser.html | 66 ++++++ public/icon.png | Bin 0 -> 5599 bytes public/icon.svg | 3 + public/robots.txt | 5 +- 24 files changed, 291 insertions(+), 150 deletions(-) create mode 100755 bin/brakeman create mode 100755 bin/rubocop create mode 100644 db/migrate/20240614060121_add_service_name_to_active_storage_blobs.active_storage.rb create mode 100644 db/migrate/20240614060122_create_active_storage_variant_records.active_storage.rb create mode 100644 db/migrate/20240614060123_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb create mode 100644 public/406-unsupported-browser.html create mode 100644 public/icon.png create mode 100644 public/icon.svg diff --git a/Gemfile b/Gemfile index fa0424c5..ba74810d 100644 --- a/Gemfile +++ b/Gemfile @@ -4,13 +4,13 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.3.1" # Use main development branch of Rails -gem "rails", "~> 7.1.0" +gem "rails", "~> 7.2.0.beta2" # The modern asset pipeline for Rails [https://github.com/rails/propshaft] gem "propshaft" # Use sqlite3 as the database for Active Record -gem "sqlite3", "~> 1.4" +gem "sqlite3", "~> 2.0" # Use the Puma web server [https://github.com/puma/puma] gem "puma" diff --git a/Gemfile.lock b/Gemfile.lock index d071b556..d11fa653 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,35 +1,29 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + actioncable (7.2.0.beta2) + actionpack (= 7.2.0.beta2) + activesupport (= 7.2.0.beta2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.3.4) - actionpack (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.0.beta2) + actionpack (= 7.2.0.beta2) + activejob (= 7.2.0.beta2) + activerecord (= 7.2.0.beta2) + activestorage (= 7.2.0.beta2) + activesupport (= 7.2.0.beta2) + mail (>= 2.8.0) + actionmailer (7.2.0.beta2) + actionpack (= 7.2.0.beta2) + actionview (= 7.2.0.beta2) + activejob (= 7.2.0.beta2) + activesupport (= 7.2.0.beta2) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.3.4) - actionview (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionpack (7.2.0.beta2) + actionview (= 7.2.0.beta2) + activesupport (= 7.2.0.beta2) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -37,51 +31,51 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.4) - actionpack (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + useragent (~> 0.16) + actiontext (7.2.0.beta2) + actionpack (= 7.2.0.beta2) + activerecord (= 7.2.0.beta2) + activestorage (= 7.2.0.beta2) + activesupport (= 7.2.0.beta2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.4) - activesupport (= 7.1.3.4) + actionview (7.2.0.beta2) + activesupport (= 7.2.0.beta2) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) active_job-performs (0.3.1) activejob (>= 6.1) - activejob (7.1.3.4) - activesupport (= 7.1.3.4) + activejob (7.2.0.beta2) + activesupport (= 7.2.0.beta2) globalid (>= 0.3.6) - activemodel (7.1.3.4) - activesupport (= 7.1.3.4) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.4) + activemodel (7.2.0.beta2) + activesupport (= 7.2.0.beta2) + activerecord (7.2.0.beta2) + activemodel (= 7.2.0.beta2) + activesupport (= 7.2.0.beta2) timeout (>= 0.4.0) activerecord-enhancedsqlite3-adapter (0.8.0) activerecord (>= 7.1) sqlite3 (>= 1.6) - activestorage (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activesupport (= 7.1.3.4) + activestorage (7.2.0.beta2) + actionpack (= 7.2.0.beta2) + activejob (= 7.2.0.beta2) + activerecord (= 7.2.0.beta2) + activesupport (= 7.2.0.beta2) marcel (~> 1.0) - activesupport (7.1.3.4) + activesupport (7.2.0.beta2) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ahoy_matey (4.2.1) activesupport (>= 5.2) device_detector @@ -89,7 +83,7 @@ GEM annotate (3.2.0) activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) - appsignal (3.7.6) + appsignal (3.10.0) rack ast (2.4.2) authentication-zero (2.16.36) @@ -128,8 +122,8 @@ GEM debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) - device_detector (1.1.2) - dockerfile-rails (1.6.16) + device_detector (1.1.3) + dockerfile-rails (1.6.17) rails (>= 3.0.0) dotenv (3.1.2) dotenv-rails (3.1.2) @@ -140,7 +134,7 @@ GEM dry-core (1.0.1) concurrent-ruby (~> 1.0) zeitwerk (~> 2.6) - dry-inflector (1.0.0) + dry-inflector (1.1.0) dry-initializer (3.1.1) dry-initializer-rails (3.1.1) dry-initializer (>= 2.4, < 4) @@ -172,16 +166,16 @@ GEM raabro (~> 1.4) globalid (1.2.1) activesupport (>= 6.1) - google-protobuf (4.27.1-aarch64-linux) + google-protobuf (4.27.2-aarch64-linux) bigdecimal rake (>= 13) - google-protobuf (4.27.1-arm64-darwin) + google-protobuf (4.27.2-arm64-darwin) bigdecimal rake (>= 13) - google-protobuf (4.27.1-x86_64-darwin) + google-protobuf (4.27.2-x86_64-darwin) bigdecimal rake (>= 13) - google-protobuf (4.27.1-x86_64-linux) + google-protobuf (4.27.2-x86_64-linux) bigdecimal rake (>= 13) groupdate (6.4.0) @@ -209,16 +203,16 @@ GEM json (2.7.2) language_server-protocol (3.17.0.3) lint_roller (1.1.0) - litestream (0.10.3) + litestream (0.10.4) logfmt (>= 0.0.10) sqlite3 - litestream (0.10.3-arm64-darwin) + litestream (0.10.4-arm64-darwin) logfmt (>= 0.0.10) sqlite3 - litestream (0.10.3-x86_64-darwin) + litestream (0.10.4-x86_64-darwin) logfmt (>= 0.0.10) sqlite3 - litestream (0.10.3-x86_64-linux) + litestream (0.10.4-x86_64-linux) logfmt (>= 0.0.10) sqlite3 logfmt (0.0.10) @@ -250,10 +244,9 @@ GEM msgpack (1.7.2) multi_xml (0.7.1) bigdecimal (~> 3.1) - mutex_m (0.2.0) net-http (0.3.2) uri - net-imap (0.4.12) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) @@ -284,7 +277,7 @@ GEM railties (>= 7.0.0) psych (5.1.2) stringio - public_suffix (5.0.5) + public_suffix (6.0.0) puma (6.4.2) nio4r (~> 2.0) raabro (1.4.0) @@ -301,20 +294,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.4) - actioncable (= 7.1.3.4) - actionmailbox (= 7.1.3.4) - actionmailer (= 7.1.3.4) - actionpack (= 7.1.3.4) - actiontext (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activemodel (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + rails (7.2.0.beta2) + actioncable (= 7.2.0.beta2) + actionmailbox (= 7.2.0.beta2) + actionmailer (= 7.2.0.beta2) + actionpack (= 7.2.0.beta2) + actiontext (= 7.2.0.beta2) + actionview (= 7.2.0.beta2) + activejob (= 7.2.0.beta2) + activemodel (= 7.2.0.beta2) + activerecord (= 7.2.0.beta2) + activestorage (= 7.2.0.beta2) + activesupport (= 7.2.0.beta2) bundler (>= 1.15.0) - railties (= 7.1.3.4) + railties (= 7.2.0.beta2) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -330,10 +323,10 @@ GEM actionview (> 3.1) activesupport (> 3.1) railties (> 3.1) - railties (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) - irb + railties (7.2.0.beta2) + actionpack (= 7.2.0.beta2) + activesupport (= 7.2.0.beta2) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -347,7 +340,7 @@ GEM regexp_parser (2.9.2) reline (0.5.9) io-console (~> 0.5) - rexml (3.3.0) + rexml (3.3.1) strscan rubocop (1.64.1) json (~> 2.3) @@ -362,21 +355,22 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.31.3) parser (>= 3.3.1.0) - rubocop-performance (1.21.0) + rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - ruby-lsp (0.17.3) + ruby-lsp (0.17.5) language_server-protocol (~> 3.17.0) prism (>= 0.29.0, < 0.31) rbs (>= 3, < 4) sorbet-runtime (>= 0.5.10782) - ruby-lsp-rails (0.3.7) - ruby-lsp (>= 0.17.0, < 0.18.0) + ruby-lsp-rails (0.3.8) + ruby-lsp (>= 0.17.2, < 0.18.0) ruby-progressbar (1.13.0) rubyzip (2.3.2) safely_block (0.4.0) - selenium-webdriver (4.21.1) + selenium-webdriver (4.22.0) base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) @@ -393,12 +387,12 @@ GEM concurrent-ruby (>= 1.3.1) fugit (~> 1.11.0) railties (>= 7.1) - sorbet-runtime (0.5.11432) - sqlite3 (1.7.3-aarch64-linux) - sqlite3 (1.7.3-arm64-darwin) - sqlite3 (1.7.3-x86_64-darwin) - sqlite3 (1.7.3-x86_64-linux) - standard (1.37.0) + sorbet-runtime (0.5.11475) + sqlite3 (2.0.2-aarch64-linux-gnu) + sqlite3 (2.0.2-arm64-darwin) + sqlite3 (2.0.2-x86_64-darwin) + sqlite3 (2.0.2-x86_64-linux-gnu) + standard (1.39.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) rubocop (~> 1.64.0) @@ -426,6 +420,7 @@ GEM concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) uri (0.13.0) + useragent (0.16.10) vcr (6.2.0) view_component (3.12.1) activesupport (>= 5.2.0, < 8.0) @@ -448,7 +443,7 @@ GEM crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) webrick (1.8.1) - websocket (1.2.10) + websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -495,7 +490,7 @@ DEPENDENCIES propshaft puma rack-mini-profiler - rails (~> 7.1.0) + rails (~> 7.2.0.beta2) rails-controller-testing rails_autolink (~> 1.1) ruby-lsp-rails @@ -503,7 +498,7 @@ DEPENDENCIES sitemap_generator (~> 6.3) solid_cache solid_queue - sqlite3 (~> 1.4) + sqlite3 (~> 2.0) standardrb (~> 1.0) turbo-rails tzinfo-data diff --git a/app/models/organisation.rb b/app/models/organisation.rb index bb2eed42..95ac8dcc 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -29,8 +29,8 @@ class Organisation < ApplicationRecord validates :name, presence: true # enums - enum kind: {conference: 0, meetup: 1} - enum frequency: {unknown: 0, yearly: 1, monthly: 2} + enum :kind, {conference: 0, meetup: 1} + enum :frequency, {unknown: 0, yearly: 1, monthly: 2} def edition "#{name} 2022" diff --git a/app/models/suggestion.rb b/app/models/suggestion.rb index fe62d060..89d2a1ad 100644 --- a/app/models/suggestion.rb +++ b/app/models/suggestion.rb @@ -22,7 +22,7 @@ class Suggestion < ApplicationRecord # callbacks # enums - enum status: {pending: 0, approved: 1, rejected: 2} + enum :status, {pending: 0, approved: 1, rejected: 2} def approved! suggestable.update!(content) diff --git a/bin/brakeman b/bin/brakeman new file mode 100755 index 00000000..ace1c9ba --- /dev/null +++ b/bin/brakeman @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +ARGV.unshift("--ensure-latest") + +load Gem.bin_path("brakeman", "brakeman") diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 00000000..40330c0f --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +# explicit rubocop config increases performance slightly while avoiding config confusion. +ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) + +load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/setup b/bin/setup index d38bf9f8..11546033 100755 --- a/bin/setup +++ b/bin/setup @@ -1,8 +1,8 @@ #!/usr/bin/env ruby require "fileutils" -# path to your application root. APP_ROOT = File.expand_path("..", __dir__) +APP_NAME = "rubyvideo" def system!(*args) system(*args, exception: true) @@ -17,9 +17,6 @@ FileUtils.chdir APP_ROOT do system! "gem install bundler --conservative" system("bundle check") || system!("bundle install") - # Install JavaScript dependencies - system("yarn check --check-files") || system!("yarn install") - # puts "\n== Copying sample files ==" # unless File.exist?("config/database.yml") # FileUtils.cp "config/database.yml.sample", "config/database.yml" @@ -33,4 +30,8 @@ FileUtils.chdir APP_ROOT do puts "\n== Restarting application server ==" system! "bin/rails restart" + + # puts "\n== Configuring puma-dev ==" + # system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}" + # system "curl -Is https://#{APP_NAME}.test/up | head -n 1" end diff --git a/config/application.rb b/config/application.rb index 08029be1..39ebacdd 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,7 +21,12 @@ module Rubyvideo class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.1 + config.load_defaults 7.2 + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w[assets tasks]) # Configuration for the application, engines, and railties goes here. # @@ -37,3 +42,12 @@ class Application < Rails::Application config.solid_queue.connects_to = {database: {writing: :queue}} end end + +# to remove once https://github.com/rails/solid_cache/pull/179 is merged or replaced +ActiveSupport.on_load(:solid_cache_entry) do + class << self + def model = self + + def scope_for_create = {} + end +end diff --git a/config/deploy.yml b/config/deploy.yml index 53c40fab..8d074411 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -22,7 +22,7 @@ registry: env: clear: RUBY_YJIT_ENABLE: 1 - WEB_CONCURRENCY: 2 + WEB_CONCURRENCY: 4 RAILS_MAX_THREADS: 3 secret: - RAILS_MASTER_KEY diff --git a/config/environments/development.rb b/config/environments/development.rb index 50c91c8e..e1930a41 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -15,7 +15,7 @@ # Show full error reports. config.consider_all_requests_local = true - # Enable server timing + # Enable server timing. config.server_timing = true # Enable/disable caching. By default caching is disabled. @@ -42,6 +42,8 @@ config.action_mailer.perform_caching = false + config.action_mailer.default_url_options = {host: "localhost", port: 3000} + # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log @@ -64,14 +66,17 @@ # config.i18n.raise_on_missing_translations = true # Annotate rendered view with file names. - # config.action_view.annotate_rendered_view_with_filenames = true + config.action_view.annotate_rendered_view_with_filenames = true # Uncomment if you wish to allow Action Cable access from any origin. # config.action_cable.disable_request_forgery_protection = true - # Raise error when a before_action's only/except options reference missing actions + # Raise error when a before_action's only/except options reference missing actions. config.action_controller.raise_on_missing_callback_actions = true + # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. + config.generators.apply_rubocop_autocorrect_after_generate! + if ENV["PROFILE"] config.cache_classes = true config.eager_load = true diff --git a/config/environments/production.rb b/config/environments/production.rb index 37130175..d878b784 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -2,8 +2,6 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # config.action_mailer.default_url_options = {host: "https://rubyvideo.dev"} - # config.action_controller.default_url_options = {host: "https://rubyvideo.dev"} # Code is not reloaded between requests. config.enable_reloading = false @@ -18,12 +16,12 @@ config.consider_all_requests_local = false config.action_controller.perform_caching = true - # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] - # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment + # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). # config.require_master_key = true - # Enable static file serving from the `/public` folder (turn off if using NGINX/Apache for it). - config.public_file_server.enabled = true + # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. + # config.public_file_server.enabled = false # Enable serving of images, stylesheets, and JavaScripts from an asset server. config.asset_host = "https://www.rubyvideo.dev" @@ -46,6 +44,8 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true + # Skip http-to-https redirect for the default health check endpoint. + # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } # Log to STDOUT by default config.logger = ActiveSupport::Logger.new($stdout) @@ -55,9 +55,9 @@ # Prepend all log lines with the following tags. config.log_tags = [:request_id] - # Info include generic and useful information about system operation, but avoids logging too much - # information to avoid inadvertent exposure of personally identifiable information (PII). Use "debug" - # for everything. + # "info" includes generic and useful information about system operation, but avoids logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). If you + # want to log everything, set the level to "debug". config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") # Use a different cache store in production. @@ -90,6 +90,4 @@ ] # Skip DNS rebinding protection for the default health check endpoint. config.host_authorization = {exclude: ->(request) { request.path == "/up" }} - - config.active_record.sqlite3_production_warning = false end diff --git a/config/environments/test.rb b/config/environments/test.rb index 943f1867..3399f66a 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -6,7 +6,6 @@ # and recreated between test runs. Don't rely on the data there! Rails.application.configure do - config.action_mailer.default_url_options = {host: "localhost", port: 3000} # Settings specified here will take precedence over those in config/application.rb. # While tests run files are not watched, reloading is not necessary. @@ -29,8 +28,8 @@ config.action_controller.perform_caching = false config.cache_store = :solid_cache_store - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false @@ -45,6 +44,10 @@ # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + # Unlike controllers, the mailer instance doesn't have any context about the + # incoming request so you'll need to provide the :host parameter yourself. + config.action_mailer.default_url_options = {host: "localhost", port: 3000} + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr @@ -60,7 +63,7 @@ # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true - # Raise error when a before_action's only/except options reference missing actions + # Raise error when a before_action's only/except options reference missing actions. config.action_controller.raise_on_missing_callback_actions = true config.active_job.queue_adapter = :test diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 2eeef966..48732442 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -5,8 +5,3 @@ # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 0b319544..b3076b38 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -11,16 +11,7 @@ # policy.img_src :self, :https, :data # policy.object_src :none # policy.script_src :self, :https -# Allow @vite/client to hot reload javascript changes in development -# policy.script_src *policy.script_src, :unsafe_eval, "http://#{ ViteRuby.config.host_with_port }" if Rails.env.development? - -# You may need to enable this in production as well depending on your setup. -# policy.script_src *policy.script_src, :blob if Rails.env.test? - # policy.style_src :self, :https -# Allow @vite/client to hot reload style changes in development -# policy.style_src *policy.style_src, :unsafe_inline if Rails.env.development? - # # Specify URI for violation reports # # policy.report_uri "/csp-violation-report-endpoint" # end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index adc6568c..c010b83d 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,8 +1,8 @@ # Be sure to restart your server when you modify this file. -# Configure parameters to be filtered from the log file. Use this to limit dissemination of -# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported -# notations and behaviors. +# 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, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn ] diff --git a/db/cache_schema.rb b/db/cache_schema.rb index 0281dab6..c9932677 100644 --- a/db/cache_schema.rb +++ b/db/cache_schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_05_16_085651) do +ActiveRecord::Schema[7.2].define(version: 2024_05_16_085651) do create_table "solid_cache_entries", force: :cascade do |t| t.binary "key", limit: 1024, null: false t.binary "value", limit: 536870912, null: false diff --git a/db/migrate/20240614060121_add_service_name_to_active_storage_blobs.active_storage.rb b/db/migrate/20240614060121_add_service_name_to_active_storage_blobs.active_storage.rb new file mode 100644 index 00000000..0267f128 --- /dev/null +++ b/db/migrate/20240614060121_add_service_name_to_active_storage_blobs.active_storage.rb @@ -0,0 +1,22 @@ +# This migration comes from active_storage (originally 20190112182829) +class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0] + def up + return unless table_exists?(:active_storage_blobs) + + unless column_exists?(:active_storage_blobs, :service_name) + add_column :active_storage_blobs, :service_name, :string + + if (configured_service = ActiveStorage::Blob.service.name) + ActiveStorage::Blob.unscoped.update_all(service_name: configured_service) + end + + change_column :active_storage_blobs, :service_name, :string, null: false + end + end + + def down + return unless table_exists?(:active_storage_blobs) + + remove_column :active_storage_blobs, :service_name + end +end diff --git a/db/migrate/20240614060122_create_active_storage_variant_records.active_storage.rb b/db/migrate/20240614060122_create_active_storage_variant_records.active_storage.rb new file mode 100644 index 00000000..95fd27fa --- /dev/null +++ b/db/migrate/20240614060122_create_active_storage_variant_records.active_storage.rb @@ -0,0 +1,28 @@ +# This migration comes from active_storage (originally 20191206030411) +class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0] + def change + return unless table_exists?(:active_storage_blobs) + + # Use Active Record's configured type for primary key + create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t| + t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type + t.string :variation_digest, null: false + + t.index %i[blob_id variation_digest], name: "index_active_storage_variant_records_uniqueness", unique: true + t.foreign_key :active_storage_blobs, column: :blob_id + end + end + + private + + def primary_key_type + config = Rails.configuration.generators + config.options[config.orm][:primary_key_type] || :primary_key + end + + def blobs_primary_key_type + pkey_name = connection.primary_key(:active_storage_blobs) + pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name } + pkey_column.bigint? ? :bigint : pkey_column.type + end +end diff --git a/db/migrate/20240614060123_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb b/db/migrate/20240614060123_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb new file mode 100644 index 00000000..93c8b85a --- /dev/null +++ b/db/migrate/20240614060123_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb @@ -0,0 +1,8 @@ +# This migration comes from active_storage (originally 20211119233751) +class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0] + def change + return unless table_exists?(:active_storage_blobs) + + change_column_null(:active_storage_blobs, :checksum, true) + end +end diff --git a/db/queue_schema.rb b/db/queue_schema.rb index 381a48c8..9bee061a 100644 --- a/db/queue_schema.rb +++ b/db/queue_schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_05_16_090840) do +ActiveRecord::Schema[7.2].define(version: 2024_05_16_090840) do create_table "solid_queue_blocked_executions", force: :cascade do |t| t.integer "job_id", null: false t.string "queue_name", null: false diff --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html new file mode 100644 index 00000000..7cf1e168 --- /dev/null +++ b/public/406-unsupported-browser.html @@ -0,0 +1,66 @@ + + + + Your browser is not supported (406) + + + + + + +
+
+

Your browser is not supported.

+

Please upgrade your browser to continue.

+
+
+ + diff --git a/public/icon.png b/public/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f3b5abcbde91cf6d7a6a26e514eb7e30f476f950 GIT binary patch literal 5599 zcmeHL-D}fO6hCR_taXJlzs3}~RuB=Iujyo=i*=1|1FN%E=zNfMTjru|Q<6v{J{U!C zBEE}?j6I3sz>fzN!6}L_BKjcuASk~1;Dg|U_@d{g?V8mM`~#9U+>>*Ezw>c(PjYWA z4(;!cgge6k5E&d$G5`S-0}!Ik>CV(0Y#1}s-v_gAHhja2=W1?nBAte9D2HG<(+)uj z!5=W4u*{VKMw#{V@^NNs4TClr!FAA%ID-*gc{R%CFKEzG<6gm*9s_uy)oMGW*=nJf zw{(Mau|2FHfXIv6C0@Wk5k)F=3jo1srV-C{pl&k&)4_&JjYrnbJiul}d0^NCSh(#7h=F;3{|>EU>h z6U8_p;^wK6mAB(1b92>5-HxJ~V}@3?G`&Qq-TbJ2(&~-HsH6F#8mFaAG(45eT3VPO zM|(Jd<+;UZs;w>0Qw}0>D%{~r{uo_Fl5_Bo3ABWi zWo^j^_T3dxG6J6fH8X)$a^%TJ#PU!=LxF=#Fd9EvKx_x>q<(KY%+y-08?kN9dXjXK z**Q=yt-FTU*13ouhCdqq-0&;Ke{T3sQU9IdzhV9LhQIpq*P{N)+}|Mh+a-VV=x?R} c>%+pvTcMWshj-umO}|qP?%A)*_KlqT3uEqhU;qFB literal 0 HcmV?d00001 diff --git a/public/icon.svg b/public/icon.svg new file mode 100644 index 00000000..78307ccd --- /dev/null +++ b/public/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/robots.txt b/public/robots.txt index 184c09a1..c19f78ab 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,4 +1 @@ -User-agent: * -Disallow: - -Sitemap: https://www.rubyvideo.com/sitemap.xml +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file