diff --git a/Gemfile b/Gemfile
index 45acc2b1d..cbe970031 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
ruby file: '.ruby-version'
-gem 'rails', '~> 8.0.4' # LOCKED: It is Rails.
+gem 'rails', '~> 8.1.2' # LOCKED: It is Rails.
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'
diff --git a/Gemfile.lock b/Gemfile.lock
index 3106bde0f..d78fc3a92 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -19,29 +19,31 @@ GIT
GEM
remote: https://rubygems.org/
specs:
- actioncable (8.0.4)
- actionpack (= 8.0.4)
- activesupport (= 8.0.4)
+ action_text-trix (2.1.16)
+ railties
+ actioncable (8.1.2)
+ actionpack (= 8.1.2)
+ activesupport (= 8.1.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
- actionmailbox (8.0.4)
- actionpack (= 8.0.4)
- activejob (= 8.0.4)
- activerecord (= 8.0.4)
- activestorage (= 8.0.4)
- activesupport (= 8.0.4)
+ actionmailbox (8.1.2)
+ actionpack (= 8.1.2)
+ activejob (= 8.1.2)
+ activerecord (= 8.1.2)
+ activestorage (= 8.1.2)
+ activesupport (= 8.1.2)
mail (>= 2.8.0)
- actionmailer (8.0.4)
- actionpack (= 8.0.4)
- actionview (= 8.0.4)
- activejob (= 8.0.4)
- activesupport (= 8.0.4)
+ actionmailer (8.1.2)
+ actionpack (= 8.1.2)
+ actionview (= 8.1.2)
+ activejob (= 8.1.2)
+ activesupport (= 8.1.2)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
- actionpack (8.0.4)
- actionview (= 8.0.4)
- activesupport (= 8.0.4)
+ actionpack (8.1.2)
+ actionview (= 8.1.2)
+ activesupport (= 8.1.2)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
@@ -49,42 +51,43 @@ GEM
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
- actiontext (8.0.4)
- actionpack (= 8.0.4)
- activerecord (= 8.0.4)
- activestorage (= 8.0.4)
- activesupport (= 8.0.4)
+ actiontext (8.1.2)
+ action_text-trix (~> 2.1.15)
+ actionpack (= 8.1.2)
+ activerecord (= 8.1.2)
+ activestorage (= 8.1.2)
+ activesupport (= 8.1.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
- actionview (8.0.4)
- activesupport (= 8.0.4)
+ actionview (8.1.2)
+ activesupport (= 8.1.2)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
- activejob (8.0.4)
- activesupport (= 8.0.4)
+ activejob (8.1.2)
+ activesupport (= 8.1.2)
globalid (>= 0.3.6)
- activemodel (8.0.4)
- activesupport (= 8.0.4)
- activerecord (8.0.4)
- activemodel (= 8.0.4)
- activesupport (= 8.0.4)
+ activemodel (8.1.2)
+ activesupport (= 8.1.2)
+ activerecord (8.1.2)
+ activemodel (= 8.1.2)
+ activesupport (= 8.1.2)
timeout (>= 0.4.0)
- activestorage (8.0.4)
- actionpack (= 8.0.4)
- activejob (= 8.0.4)
- activerecord (= 8.0.4)
- activesupport (= 8.0.4)
+ activestorage (8.1.2)
+ actionpack (= 8.1.2)
+ activejob (= 8.1.2)
+ activerecord (= 8.1.2)
+ activesupport (= 8.1.2)
marcel (~> 1.0)
- activesupport (8.0.4)
+ activesupport (8.1.2)
base64
- benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
+ json
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
@@ -225,7 +228,7 @@ GEM
thor (~> 1.4)
friendly_id (5.6.0)
activerecord (>= 4.0.0)
- globalid (1.2.1)
+ globalid (1.3.0)
activesupport (>= 6.1)
google-protobuf (4.33.2-aarch64-linux-gnu)
bigdecimal
@@ -298,7 +301,8 @@ GEM
loofah (2.25.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
- mail (2.8.1)
+ mail (2.9.0)
+ logger
mini_mime (>= 0.1.1)
net-imap
net-pop
@@ -315,7 +319,7 @@ GEM
mutex_m (0.3.0)
net-http (0.6.0)
uri
- net-imap (0.5.10)
+ net-imap (0.6.2)
date
net-protocol
net-pop (0.1.2)
@@ -423,20 +427,20 @@ GEM
rack (>= 1.3)
rackup (2.3.1)
rack (>= 3)
- rails (8.0.4)
- actioncable (= 8.0.4)
- actionmailbox (= 8.0.4)
- actionmailer (= 8.0.4)
- actionpack (= 8.0.4)
- actiontext (= 8.0.4)
- actionview (= 8.0.4)
- activejob (= 8.0.4)
- activemodel (= 8.0.4)
- activerecord (= 8.0.4)
- activestorage (= 8.0.4)
- activesupport (= 8.0.4)
+ rails (8.1.2)
+ actioncable (= 8.1.2)
+ actionmailbox (= 8.1.2)
+ actionmailer (= 8.1.2)
+ actionpack (= 8.1.2)
+ actiontext (= 8.1.2)
+ actionview (= 8.1.2)
+ activejob (= 8.1.2)
+ activemodel (= 8.1.2)
+ activerecord (= 8.1.2)
+ activestorage (= 8.1.2)
+ activesupport (= 8.1.2)
bundler (>= 1.15.0)
- railties (= 8.0.4)
+ railties (= 8.1.2)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
@@ -450,9 +454,9 @@ GEM
rack
railties (>= 5.1)
semantic_logger (~> 4.16)
- railties (8.0.4)
- actionpack (= 8.0.4)
- activesupport (= 8.0.4)
+ railties (8.1.2)
+ actionpack (= 8.1.2)
+ activesupport (= 8.1.2)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
@@ -694,7 +698,7 @@ DEPENDENCIES
puma (~> 7.2)
pundit
rack-mini-profiler (~> 4.0)
- rails (~> 8.0.4)
+ rails (~> 8.1.2)
rails-html-sanitizer (~> 1.6.2)
rails4-autocomplete
rails_semantic_logger
diff --git a/bin/ci b/bin/ci
new file mode 100755
index 000000000..4137ad5bb
--- /dev/null
+++ b/bin/ci
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+require_relative "../config/boot"
+require "active_support/continuous_integration"
+
+CI = ActiveSupport::ContinuousIntegration
+require_relative "../config/ci.rb"
diff --git a/bin/rubocop b/bin/rubocop
index 40330c0ff..5a2050471 100755
--- a/bin/rubocop
+++ b/bin/rubocop
@@ -2,7 +2,7 @@
require "rubygems"
require "bundler/setup"
-# explicit rubocop config increases performance slightly while avoiding config confusion.
+# 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 be3db3c0d..81be011e8 100755
--- a/bin/setup
+++ b/bin/setup
@@ -22,6 +22,7 @@ FileUtils.chdir APP_ROOT do
puts "\n== Preparing database =="
system! "bin/rails db:prepare"
+ system! "bin/rails db:reset" if ARGV.include?("--reset")
puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"
diff --git a/config/application.rb b/config/application.rb
index 0ff59db98..a8af5e442 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,7 +1,6 @@
require_relative "boot"
require "rails/all"
-require "sprockets/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
@@ -10,7 +9,7 @@
module Planner
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
- config.load_defaults 8.0
+ config.load_defaults 8.1
# 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 --git a/config/ci.rb b/config/ci.rb
new file mode 100644
index 000000000..7e3f04c46
--- /dev/null
+++ b/config/ci.rb
@@ -0,0 +1,22 @@
+# Run using bin/ci
+
+CI.run do
+ step "Setup", "bin/setup --skip-server"
+
+ step "Style: Ruby", "bin/rubocop"
+
+ step "Security: Importmap vulnerability audit", "bin/importmap audit"
+ step "Tests: Rails", "bin/rails test"
+ step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
+
+ # Optional: Run system tests
+ # step "Tests: System", "bin/rails test:system"
+
+ # Optional: set a green GitHub commit status to unblock PR merge.
+ # Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
+ # if success?
+ # step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff"
+ # else
+ # failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again."
+ # end
+end
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 0800607a1..5da35e3b7 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -61,6 +61,9 @@
# Suppress logger output for asset requests.
config.assets.quiet = true
+ # Highlight code that triggered redirect in logs.
+ config.action_dispatch.verbose_redirect_logs = true
+
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 89fd77d4a..ba891f0c4 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -42,7 +42,7 @@
config.log_tags = [ :request_id ]
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
- # Change to "debug" to log everything (including potentially personally-identifiable information!)
+ # Change to "debug" to log everything (including potentially personally-identifiable information!).
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
# Prevent health checks from clogging up the logs.
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb
index b3076b38f..d51d71397 100644
--- a/config/initializers/content_security_policy.rb
+++ b/config/initializers/content_security_policy.rb
@@ -20,6 +20,10 @@
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
# config.content_security_policy_nonce_directives = %w(script-src style-src)
#
+# # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag`
+# # if the corresponding directives are specified in `content_security_policy_nonce_directives`.
+# # config.content_security_policy_nonce_auto = true
+#
# # Report violations without enforcing the policy.
# # config.content_security_policy_report_only = true
# end
diff --git a/config/puma.rb b/config/puma.rb
index 65a901396..0c350dd16 100644
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -7,7 +7,8 @@
#
# 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.
+# default is already 1. You can set it to `auto` to automatically start a worker
+# for each available processor.
#
# 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
@@ -33,7 +34,7 @@
# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
-# Run the Solid Queue supervisor inside of Puma for single-server deployments
+# Run the Solid Queue supervisor inside of Puma for single-server deployments.
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
# Specify the PID file. Defaults to tmp/pids/server.pid in development.
@@ -45,4 +46,4 @@
# Silence Puma output in test environment
if ENV.fetch("RAILS_ENV", "development") == "test"
quiet
-end
\ No newline at end of file
+end
diff --git a/public/400.html b/public/400.html
index 282dbc8cc..640de0339 100644
--- a/public/400.html
+++ b/public/400.html
@@ -35,12 +35,35 @@
font-weight: 400;
letter-spacing: -0.0025em;
line-height: 1.4;
- min-height: 100vh;
+ min-height: 100dvh;
place-items: center;
text-rendering: optimizeLegibility;
-webkit-text-size-adjust: 100%;
}
+ #error-description {
+ fill: #d30001;
+ }
+
+ #error-id {
+ fill: #f0eff0;
+ }
+
+ @media (prefers-color-scheme: dark) {
+ body {
+ background: #101010;
+ color: #e0e0e0;
+ }
+
+ #error-description {
+ fill: #FF6161;
+ }
+
+ #error-id {
+ fill: #2c2c2c;
+ }
+ }
+
a {
color: inherit;
font-weight: 700;
@@ -83,13 +106,11 @@
}
main article br {
-
display: none;
@media(min-width: 48em) {
display: inline;
}
-
}
@@ -102,10 +123,10 @@
- The server cannot process the request due to a client error. Please check the request and try again. If you’re the application owner check the logs for more information.
+ The server cannot process the request due to a client error. Please check the request and try again. If you're the application owner check the logs for more information.
diff --git a/public/404.html b/public/404.html
index c0670bc87..d7f0f1422 100644
--- a/public/404.html
+++ b/public/404.html
@@ -4,7 +4,7 @@
- The page you were looking for doesn’t exist (404 Not found)
+ The page you were looking for doesn't exist (404 Not found)
@@ -35,12 +35,35 @@
font-weight: 400;
letter-spacing: -0.0025em;
line-height: 1.4;
- min-height: 100vh;
+ min-height: 100dvh;
place-items: center;
text-rendering: optimizeLegibility;
-webkit-text-size-adjust: 100%;
}
+ #error-description {
+ fill: #d30001;
+ }
+
+ #error-id {
+ fill: #f0eff0;
+ }
+
+ @media (prefers-color-scheme: dark) {
+ body {
+ background: #101010;
+ color: #e0e0e0;
+ }
+
+ #error-description {
+ fill: #FF6161;
+ }
+
+ #error-id {
+ fill: #2c2c2c;
+ }
+ }
+
a {
color: inherit;
font-weight: 700;
@@ -83,13 +106,11 @@
}
main article br {
-
display: none;
@media(min-width: 48em) {
display: inline;
}
-
}
@@ -102,10 +123,10 @@
- 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.
+ 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 --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html
index 9532a9ccd..43d2811e8 100644
--- a/public/406-unsupported-browser.html
+++ b/public/406-unsupported-browser.html
@@ -35,12 +35,35 @@
font-weight: 400;
letter-spacing: -0.0025em;
line-height: 1.4;
- min-height: 100vh;
+ min-height: 100dvh;
place-items: center;
text-rendering: optimizeLegibility;
-webkit-text-size-adjust: 100%;
}
+ #error-description {
+ fill: #d30001;
+ }
+
+ #error-id {
+ fill: #f0eff0;
+ }
+
+ @media (prefers-color-scheme: dark) {
+ body {
+ background: #101010;
+ color: #e0e0e0;
+ }
+
+ #error-description {
+ fill: #FF6161;
+ }
+
+ #error-id {
+ fill: #2c2c2c;
+ }
+ }
+
a {
color: inherit;
font-weight: 700;
@@ -83,13 +106,11 @@
}
main article br {
-
display: none;
@media(min-width: 48em) {
display: inline;
}
-
}
@@ -102,7 +123,7 @@
Your browser is not supported.
Please upgrade your browser to continue.
diff --git a/public/422.html b/public/422.html
index 8bcf06014..f12fb4aa1 100644
--- a/public/422.html
+++ b/public/422.html
@@ -35,12 +35,35 @@
font-weight: 400;
letter-spacing: -0.0025em;
line-height: 1.4;
- min-height: 100vh;
+ min-height: 100dvh;
place-items: center;
text-rendering: optimizeLegibility;
-webkit-text-size-adjust: 100%;
}
+ #error-description {
+ fill: #d30001;
+ }
+
+ #error-id {
+ fill: #f0eff0;
+ }
+
+ @media (prefers-color-scheme: dark) {
+ body {
+ background: #101010;
+ color: #e0e0e0;
+ }
+
+ #error-description {
+ fill: #FF6161;
+ }
+
+ #error-id {
+ fill: #2c2c2c;
+ }
+ }
+
a {
color: inherit;
font-weight: 700;
@@ -83,13 +106,11 @@
}
main article br {
-
display: none;
@media(min-width: 48em) {
display: inline;
}
-
}
@@ -102,10 +123,10 @@
- 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.
+ 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 --git a/public/500.html b/public/500.html
index d77718c3a..e4eb18a75 100644
--- a/public/500.html
+++ b/public/500.html
@@ -4,7 +4,7 @@
- We’re sorry, but something went wrong (500 Internal Server Error)
+ We're sorry, but something went wrong (500 Internal Server Error)
@@ -35,12 +35,35 @@
font-weight: 400;
letter-spacing: -0.0025em;
line-height: 1.4;
- min-height: 100vh;
+ min-height: 100dvh;
place-items: center;
text-rendering: optimizeLegibility;
-webkit-text-size-adjust: 100%;
}
+ #error-description {
+ fill: #d30001;
+ }
+
+ #error-id {
+ fill: #f0eff0;
+ }
+
+ @media (prefers-color-scheme: dark) {
+ body {
+ background: #101010;
+ color: #e0e0e0;
+ }
+
+ #error-description {
+ fill: #FF6161;
+ }
+
+ #error-id {
+ fill: #2c2c2c;
+ }
+ }
+
a {
color: inherit;
font-weight: 700;
@@ -83,13 +106,11 @@
}
main article br {
-
display: none;
@media(min-width: 48em) {
display: inline;
}
-
}
@@ -102,10 +123,10 @@
- We’re sorry, but something went wrong.
If you’re 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.