# HG changeset patch # User nanaya # Date 1734270333 -32400 # Node ID eda83610b65c3a641b1661d99a7c421d456dc52f # Parent 89f6c0016bab7263fee0dbe0eb60b209971c1b7c Update rails and stuff diff -r 89f6c0016bab -r eda83610b65c Gemfile --- a/Gemfile Tue Sep 03 19:21:25 2024 +0900 +++ b/Gemfile Sun Dec 15 22:45:33 2024 +0900 @@ -1,6 +1,6 @@ source "https://rubygems.org" -rails_ver = "~> 7.2.0" +rails_ver = "~> 8.0.0" gem "actionview", rails_ver gem "railties", rails_ver diff -r 89f6c0016bab -r eda83610b65c Gemfile.lock --- a/Gemfile.lock Tue Sep 03 19:21:25 2024 +0900 +++ b/Gemfile.lock Sun Dec 15 22:45:33 2024 +0900 @@ -1,25 +1,25 @@ GEM remote: https://rubygems.org/ specs: - actionpack (7.2.1) - actionview (= 7.2.1) - activesupport (= 7.2.1) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4, < 3.2) + rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actionview (7.2.1) - activesupport (= 7.2.1) + actionview (8.0.1) + activesupport (= 8.0.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activesupport (7.2.1) + activesupport (8.0.1) base64 + benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) @@ -29,84 +29,89 @@ minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) base64 (0.2.0) + benchmark (0.4.0) bigdecimal (3.1.8) bigdecimal (3.1.8-java) builder (3.3.0) concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) + date (3.4.1) + date (3.4.1-java) drb (2.2.1) erubi (1.13.0) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) idn-ruby (0.1.5) - io-console (0.7.2) - io-console (0.7.2-java) - irb (1.14.0) + io-console (0.8.0) + io-console (0.8.0-java) + irb (1.14.2) rdoc (>= 4.0.0) reline (>= 0.4.2) - jar-dependencies (0.4.1) - logger (1.6.1) - loofah (2.22.0) + jar-dependencies (0.5.1) + logger (1.6.3) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mini_portile2 (2.8.7) - minitest (5.25.1) - newrelic_rpm (9.13.0) - nio4r (2.7.3) - nio4r (2.7.3-java) - nokogiri (1.16.7) + mini_portile2 (2.8.8) + minitest (5.25.4) + newrelic_rpm (9.16.1) + nio4r (2.7.4) + nio4r (2.7.4-java) + nokogiri (1.17.2) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.7-java) + nokogiri (1.17.2-java) racc (~> 1.4) - nokogiri (1.16.7-x86-mingw32) + nokogiri (1.17.2-x86-mingw32) racc (~> 1.4) - psych (5.1.2) + psych (5.2.1) + date stringio - psych (5.1.2-java) + psych (5.2.1-java) + date jar-dependencies (>= 0.1.7) - puma (6.4.2) + puma (6.5.0) nio4r (~> 2.0) - puma (6.4.2-java) + puma (6.5.0-java) nio4r (~> 2.0) racc (1.8.1) racc (1.8.1-java) - rack (3.1.7) + rack (3.1.8) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (2.1.0) + rackup (2.2.1) rack (>= 3) - webrick (~> 1.8) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - railties (7.2.1) - actionpack (= 7.2.1) - activesupport (= 7.2.1) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rake (13.2.1) - rdoc (6.7.0) + rdoc (6.9.0) psych (>= 4.0.0) redis (5.3.0) redis-client (>= 0.22.0) - redis-client (0.22.2) + redis-client (0.23.0) connection_pool - reline (0.5.9) + reline (0.5.12) io-console (~> 0.5) - securerandom (0.3.1) - stringio (3.1.1) + securerandom (0.4.0) + stringio (3.1.2) thor (1.3.2) twitter-text (3.1.0) idn-ruby @@ -117,9 +122,9 @@ unf_ext unf (0.1.4-java) unf_ext (0.0.9.1) - useragent (0.16.10) - webrick (1.8.1) - zeitwerk (2.6.18) + uri (1.0.2) + useragent (0.16.11) + zeitwerk (2.7.1) PLATFORMS java @@ -127,11 +132,11 @@ x86-mingw32 DEPENDENCIES - actionpack (~> 7.2.0) - actionview (~> 7.2.0) + actionpack (~> 8.0.0) + actionview (~> 8.0.0) newrelic_rpm puma - railties (~> 7.2.0) + railties (~> 8.0.0) redis twitter-text diff -r 89f6c0016bab -r eda83610b65c bin/setup --- a/bin/setup Tue Sep 03 19:21:25 2024 +0900 +++ b/bin/setup Sun Dec 15 22:45:33 2024 +0900 @@ -2,7 +2,6 @@ require "fileutils" APP_ROOT = File.expand_path("..", __dir__) -APP_NAME = "rsstweet" def system!(*args) system(*args, exception: true) @@ -14,16 +13,14 @@ # Add necessary setup steps to this file. puts "== Installing dependencies ==" - system! "gem install bundler --conservative" system("bundle check") || system!("bundle install") puts "\n== Removing old logs and tempfiles ==" system! "bin/rails log:clear tmp:clear" - 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" + unless ARGV.include?("--skip-server") + puts "\n== Starting development server ==" + STDOUT.flush # flush the output before exec(2) so that it displays + exec "bin/dev" + end end diff -r 89f6c0016bab -r eda83610b65c config/application.rb --- a/config/application.rb Tue Sep 03 19:21:25 2024 +0900 +++ b/config/application.rb Sun Dec 15 22:45:33 2024 +0900 @@ -23,7 +23,7 @@ module Rsstweet class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.2 + config.load_defaults 8.0 # 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. diff -r 89f6c0016bab -r eda83610b65c config/environments/development.rb --- a/config/environments/development.rb Tue Sep 03 19:21:25 2024 +0900 +++ b/config/environments/development.rb Sun Dec 15 22:45:33 2024 +0900 @@ -3,9 +3,7 @@ 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 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. + # Make code changes take effect immediately without server restart. config.enable_reloading = true # Do not eager load code on boot. @@ -17,29 +15,22 @@ # Enable server timing. config.server_timing = true - # Enable/disable caching. By default caching is disabled. - # Run rails dev:cache to toggle caching. + # Enable/disable Action Controller caching. By default Action Controller caching is disabled. + # Run rails dev:cache to toggle Action Controller caching. if Rails.root.join("tmp/caching-dev.txt").exist? config.action_controller.perform_caching = true config.action_controller.enable_fragment_cache_logging = true - - config.cache_store = :memory_store - config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" } + config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false + end - config.cache_store = :null_store - end + # Change to :null_store to avoid any caching. + config.cache_store = :memory_store # 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.i18n.raise_on_missing_translations = true diff -r 89f6c0016bab -r eda83610b65c config/environments/production.rb --- a/config/environments/production.rb Tue Sep 03 19:21:25 2024 +0900 +++ b/config/environments/production.rb Sun Dec 15 22:45:33 2024 +0900 @@ -6,33 +6,23 @@ # Code is not reloaded between requests. config.enable_reloading = false - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). config.eager_load = true - # Full error reports are disabled and caching is turned on. + # Full error reports are disabled. config.consider_all_requests_local = false + + # Turn on fragment caching in view templates. config.action_controller.perform_caching = true - # 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 - - # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. - # config.public_file_server.enabled = false + # Cache assets for far-future expiry since they are all digest stamped. + config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } # Enable serving of images, stylesheets, and JavaScripts from an asset server. # 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 - # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX - # Assume all access to the app is happening through a SSL-terminating reverse proxy. - # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. - # config.assume_ssl = true + config.assume_ssl = true # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true @@ -40,34 +30,32 @@ # 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) - .tap { |logger| logger.formatter = ::Logger::Formatter.new } - .then { |logger| ActiveSupport::TaggedLogging.new(logger) } + # Log to STDOUT with the current request id as a default log tag. + config.log_tags = [ :request_id ] + config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) - # Prepend all log lines with the following tags. - config.log_tags = [ :request_id ] - - # "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". + # Change to "debug" to log everything (including potentially personally-identifiable information!) config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") - # Use a different cache store in production. + # Prevent health checks from clogging up the logs. + config.silence_healthcheck_path = "/up" + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Replace the default in-process memory cache store with a durable alternative. # config.cache_store = :mem_cache_store # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Don't log any deprecations. - config.active_support.report_deprecations = false - # Enable DNS rebinding protection and other `Host` header attacks. # config.hosts = [ # "example.com", # Allow requests from example.com # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` # ] + # # Skip DNS rebinding protection for the default health check endpoint. # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } end diff -r 89f6c0016bab -r eda83610b65c config/environments/test.rb --- a/config/environments/test.rb Tue Sep 03 19:21:25 2024 +0900 +++ b/config/environments/test.rb Sun Dec 15 22:45:33 2024 +0900 @@ -1,5 +1,3 @@ -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 @@ -17,12 +15,11 @@ # loading is working properly before deploying your code. config.eager_load = ENV["CI"].present? - # Configure public file server for tests with Cache-Control for performance. - config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" } + # Configure public file server for tests with cache-control for performance. + config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } - # Show full error reports and disable caching. + # Show full error reports. config.consider_all_requests_local = true - config.action_controller.perform_caching = false config.cache_store = :null_store # Render exception templates for rescuable exceptions and raise for other exceptions. @@ -34,12 +31,6 @@ # 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.i18n.raise_on_missing_translations = true diff -r 89f6c0016bab -r eda83610b65c config/initializers/assets.rb --- a/config/initializers/assets.rb Tue Sep 03 19:21:25 2024 +0900 +++ b/config/initializers/assets.rb Sun Dec 15 22:45:33 2024 +0900 @@ -1,7 +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" +#Rails.application.config.assets.version = "1.0" # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path diff -r 89f6c0016bab -r eda83610b65c config/initializers/filter_parameter_logging.rb --- a/config/initializers/filter_parameter_logging.rb Tue Sep 03 19:21:25 2024 +0900 +++ b/config/initializers/filter_parameter_logging.rb Sun Dec 15 22:45:33 2024 +0900 @@ -4,5 +4,5 @@ # 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 + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc ] diff -r 89f6c0016bab -r eda83610b65c config/puma.rb --- a/config/puma.rb Tue Sep 03 19:21:25 2024 +0900 +++ b/config/puma.rb Sun Dec 15 22:45:33 2024 +0900 @@ -1,13 +1,17 @@ # This configuration file will be evaluated by Puma. The top-level methods that # are invoked here are part of Puma's configuration DSL. For more information # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. - +# # Puma starts a configurable number of processes (workers) and each process # serves each request in a thread from an internal thread pool. # +# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You +# should only set this value when you want to run 2 or more workers. The +# default is already 1. +# # The ideal number of threads per worker depends both on how much time the # application spends waiting for IO operations and on how much you wish to -# to prioritize throughput over latency. +# prioritize throughput over latency. # # As a rule of thumb, increasing the number of threads will increase how much # traffic a given process can handle (throughput), but due to CRuby's diff -r 89f6c0016bab -r eda83610b65c public/404.html --- a/public/404.html Tue Sep 03 19:21:25 2024 +0900 +++ b/public/404.html Sun Dec 15 22:45:33 2024 +0900 @@ -1,67 +1,114 @@ - - - - The page you were looking for doesn't exist (404) - - - + main article br { + + display: none; + + @media(min-width: 48em) { + display: inline; + } + + } + + + + - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- + + + + +
+
+ +
+
+

The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. If you’re the application owner check the logs for more information.

+
+
+ + + diff -r 89f6c0016bab -r eda83610b65c public/406-unsupported-browser.html --- a/public/406-unsupported-browser.html Tue Sep 03 19:21:25 2024 +0900 +++ b/public/406-unsupported-browser.html Sun Dec 15 22:45:33 2024 +0900 @@ -1,66 +1,114 @@ - - - - Your browser is not supported (406) - - - + main article br { + + display: none; + + @media(min-width: 48em) { + display: inline; + } + + } + + + + - - -
-
-

Your browser is not supported.

-

Please upgrade your browser to continue.

-
-
- + + + + +
+
+ +
+
+

Your browser is not supported.
Please upgrade your browser to continue.

+
+
+ + + diff -r 89f6c0016bab -r eda83610b65c public/422.html --- a/public/422.html Tue Sep 03 19:21:25 2024 +0900 +++ b/public/422.html Sun Dec 15 22:45:33 2024 +0900 @@ -1,67 +1,114 @@ - - - - The change you wanted was rejected (422) - - - + main article br { + + display: none; + + @media(min-width: 48em) { + display: inline; + } + + } + + + + - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- + + + + +
+
+ +
+
+

The change you wanted was rejected. Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.

+
+
+ + + diff -r 89f6c0016bab -r eda83610b65c public/500.html --- a/public/500.html Tue Sep 03 19:21:25 2024 +0900 +++ b/public/500.html Sun Dec 15 22:45:33 2024 +0900 @@ -1,66 +1,114 @@ - - - - We're sorry, but something went wrong (500) - - - + main article br { + + display: none; + + @media(min-width: 48em) { + display: inline; + } + + } + + + + - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- + + + + +
+
+ +
+
+

We’re sorry, but something went wrong.
If you’re the application owner check the logs for more information.

+
+
+ + +