railties 8.1.0.beta1 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +56 -1
- data/lib/rails/application/bootstrap.rb +1 -1
- data/lib/rails/application/configuration.rb +5 -9
- data/lib/rails/code_statistics.rb +4 -1
- data/lib/rails/commands/app/update_command.rb +1 -0
- data/lib/rails/gem_version.rb +1 -1
- data/lib/rails/generators/app_base.rb +12 -0
- data/lib/rails/generators/rails/app/app_generator.rb +6 -5
- data/lib/rails/generators/rails/app/templates/Dockerfile.tt +5 -3
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +3 -1
- data/lib/rails/generators/rails/app/templates/config/ci.rb.tt +4 -0
- data/lib/rails/generators/rails/app/templates/config/deploy.yml.tt +16 -11
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +3 -0
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +2 -14
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_8_1.rb.tt +8 -0
- data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +7 -3
- data/lib/rails/generators/rails/app/templates/kamal-secrets.tt +1 -1
- data/lib/rails/generators/rails/app/templates/public/400.html +25 -4
- data/lib/rails/generators/rails/app/templates/public/404.html +25 -4
- data/lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html +25 -4
- data/lib/rails/generators/rails/app/templates/public/422.html +25 -4
- data/lib/rails/generators/rails/app/templates/public/500.html +25 -4
- data/lib/rails/generators/rails/authentication/authentication_generator.rb +0 -9
- data/lib/rails/generators/rails/authentication/templates/app/views/passwords_mailer/reset.html.erb.tt +3 -1
- data/lib/rails/generators/rails/authentication/templates/app/views/passwords_mailer/reset.text.erb.tt +3 -1
- data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +1 -1
- data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +1 -1
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +1 -0
- data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +0 -4
- data/lib/rails/generators/test_unit/authentication/authentication_generator.rb +12 -0
- data/lib/rails/generators/{rails → test_unit}/authentication/templates/test/test_helpers/session_test_helper.rb.tt +6 -2
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +4 -2
- data/lib/rails/info_controller.rb +2 -2
- data/lib/rails/tasks/statistics.rake +3 -21
- data/lib/rails/tasks.rb +1 -3
- data/lib/rails/templates/rails/mailers/email.html.erb +1 -1
- data/lib/rails/templates/rails/welcome/index.html.erb +2 -2
- metadata +12 -13
- data/lib/rails/console/methods.rb +0 -7
- /data/lib/rails/generators/{rails → test_unit}/authentication/templates/test/mailers/previews/passwords_mailer_preview.rb.tt +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad8da0555d797f82b2d0201539e2b87d71a4a034693160ce5f1a695bb2fba206
|
|
4
|
+
data.tar.gz: 7141209b64c173556b4e68710077f2020a0e4d1f78849f189b618ae5aadf0323
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb16ac913da82747b4d06e8c7578ccc830219010f1ef5846305f2f6640a84f08df45f191f76899b6449d7dd85903a7e89f236b33cb8c83daef7f46863f86cf6f
|
|
7
|
+
data.tar.gz: badbe8ab05d917deed317baf5d1b8adbb339c95ed6bd0ea01f13c6d61ff41d270e49b27624d0d27f94625bb26466f141506638b44c6e2936b5b99d281f748fb5
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,59 @@
|
|
|
1
|
-
## Rails 8.1.0
|
|
1
|
+
## Rails 8.1.0 (October 22, 2025) ##
|
|
2
|
+
|
|
3
|
+
* Suggest `bin/rails action_text:install` from Action Dispatch error page
|
|
4
|
+
|
|
5
|
+
*Sean Doyle*
|
|
6
|
+
|
|
7
|
+
* Remove deprecated `STATS_DIRECTORIES`.
|
|
8
|
+
|
|
9
|
+
*Rafael Mendonça França*
|
|
10
|
+
|
|
11
|
+
* Remove deprecated `bin/rake stats` command.
|
|
12
|
+
|
|
13
|
+
*Rafael Mendonça França*
|
|
14
|
+
|
|
15
|
+
* Remove deprecated `rails/console/methods.rb` file.
|
|
16
|
+
|
|
17
|
+
*Rafael Mendonça França*
|
|
18
|
+
|
|
19
|
+
* Don't generate system tests by default.
|
|
20
|
+
|
|
21
|
+
Rails scaffold generator will no longer generate system tests by default. To enable this pass `--system-tests=true` or generate them with `bin/rails generate system_test name_of_test`.
|
|
22
|
+
|
|
23
|
+
*Eileen M. Uchitelle*
|
|
24
|
+
|
|
25
|
+
* Optionally skip bundler-audit.
|
|
26
|
+
|
|
27
|
+
Skips adding the `bin/bundler-audit` & `config/bundler-audit.yml` if the gem is not installed when `bin/rails app:update` runs.
|
|
28
|
+
|
|
29
|
+
Passes an option to `--skip-bundler-audit` when new apps are generated & adds that same option to the `--minimal` generator flag.
|
|
30
|
+
|
|
31
|
+
*Jill Klang*
|
|
32
|
+
|
|
33
|
+
* Show engine routes in `/rails/info/routes` as well.
|
|
34
|
+
|
|
35
|
+
*Petrik de Heus*
|
|
36
|
+
|
|
37
|
+
* Exclude `asset_path` configuration from Kamal `deploy.yml` for API applications.
|
|
38
|
+
|
|
39
|
+
API applications don't serve assets, so the `asset_path` configuration in `deploy.yml`
|
|
40
|
+
is not needed and can cause 404 errors on in-flight requests. The asset_path is now
|
|
41
|
+
only included for regular Rails applications that serve assets.
|
|
42
|
+
|
|
43
|
+
*Saiqul Haq*
|
|
44
|
+
|
|
45
|
+
* Reverted the incorrect default `config.public_file_server.headers` config.
|
|
46
|
+
|
|
47
|
+
If you created a new application using Rails `8.1.0.beta1`, make sure to regenerate
|
|
48
|
+
`config/environments/production.rb`, or to manually edit the `config.public_file_server.headers`
|
|
49
|
+
configuration to just be:
|
|
50
|
+
|
|
51
|
+
```ruby
|
|
52
|
+
# Cache assets for far-future expiry since they are all digest stamped.
|
|
53
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
*Jean Boussier*
|
|
2
57
|
|
|
3
58
|
* Add command `rails credentials:fetch PATH` to get the value of a credential from the credentials file.
|
|
4
59
|
|
|
@@ -73,7 +73,7 @@ module Rails
|
|
|
73
73
|
|
|
74
74
|
initializer :initialize_event_reporter, group: :all do
|
|
75
75
|
Rails.event.raise_on_error = config.consider_all_requests_local
|
|
76
|
-
Rails.event.debug_mode =
|
|
76
|
+
Rails.event.debug_mode = Rails.env.development?
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
# Initialize cache early in the stack so railties can make use of it.
|
|
@@ -117,10 +117,6 @@ module Rails
|
|
|
117
117
|
action_controller.forgery_protection_origin_check = true
|
|
118
118
|
end
|
|
119
119
|
|
|
120
|
-
if respond_to?(:active_support)
|
|
121
|
-
active_support.to_time_preserves_timezone = :offset
|
|
122
|
-
end
|
|
123
|
-
|
|
124
120
|
if respond_to?(:active_record)
|
|
125
121
|
active_record.belongs_to_required_by_default = true
|
|
126
122
|
end
|
|
@@ -267,7 +263,7 @@ module Rails
|
|
|
267
263
|
end
|
|
268
264
|
|
|
269
265
|
if respond_to?(:action_controller)
|
|
270
|
-
action_controller.
|
|
266
|
+
action_controller.action_on_open_redirect = :raise
|
|
271
267
|
action_controller.wrap_parameters_by_default = true
|
|
272
268
|
end
|
|
273
269
|
when "7.1"
|
|
@@ -339,10 +335,6 @@ module Rails
|
|
|
339
335
|
when "8.0"
|
|
340
336
|
load_defaults "7.2"
|
|
341
337
|
|
|
342
|
-
if respond_to?(:active_support)
|
|
343
|
-
active_support.to_time_preserves_timezone = :zone
|
|
344
|
-
end
|
|
345
|
-
|
|
346
338
|
if respond_to?(:action_dispatch)
|
|
347
339
|
action_dispatch.strict_freshness = true
|
|
348
340
|
end
|
|
@@ -365,6 +357,10 @@ module Rails
|
|
|
365
357
|
active_record.raise_on_missing_required_finder_order_columns = true
|
|
366
358
|
end
|
|
367
359
|
|
|
360
|
+
if respond_to?(:active_support)
|
|
361
|
+
active_support.escape_js_separators_in_json = false
|
|
362
|
+
end
|
|
363
|
+
|
|
368
364
|
if respond_to?(:action_view)
|
|
369
365
|
action_view.render_tracker = :ruby
|
|
370
366
|
end
|
|
@@ -42,8 +42,11 @@ module Rails
|
|
|
42
42
|
|
|
43
43
|
HEADERS = { lines: " Lines", code_lines: " LOC", classes: "Classes", methods: "Methods" }
|
|
44
44
|
|
|
45
|
+
PATTERN = /^(?!\.).*?\.(rb|js|ts|css|scss|coffee|rake|erb)$/
|
|
46
|
+
|
|
45
47
|
class_attribute :directories, default: DIRECTORIES
|
|
46
48
|
class_attribute :test_types, default: TEST_TYPES
|
|
49
|
+
class_attribute :pattern, default: PATTERN
|
|
47
50
|
|
|
48
51
|
# Add directories to the output of the <tt>bin/rails stats</tt> command.
|
|
49
52
|
#
|
|
@@ -81,7 +84,7 @@ module Rails
|
|
|
81
84
|
Hash[@pairs.map { |pair| [pair.first, calculate_directory_statistics(pair.last)] }]
|
|
82
85
|
end
|
|
83
86
|
|
|
84
|
-
def calculate_directory_statistics(directory, pattern =
|
|
87
|
+
def calculate_directory_statistics(directory, pattern = self.class.pattern)
|
|
85
88
|
stats = Rails::CodeStatisticsCalculator.new
|
|
86
89
|
|
|
87
90
|
Dir.foreach(directory) do |file_name|
|
|
@@ -73,6 +73,7 @@ module Rails
|
|
|
73
73
|
skip_action_text: !defined?(ActionText::Engine),
|
|
74
74
|
skip_action_cable: !defined?(ActionCable::Engine),
|
|
75
75
|
skip_brakeman: skip_gem?("brakeman"),
|
|
76
|
+
skip_bundler_audit: skip_gem?("bundler-audit"),
|
|
76
77
|
skip_rubocop: skip_gem?("rubocop"),
|
|
77
78
|
skip_thruster: skip_gem?("thruster"),
|
|
78
79
|
skip_test: !defined?(Rails::TestUnitRailtie),
|
data/lib/rails/gem_version.rb
CHANGED
|
@@ -106,6 +106,9 @@ module Rails
|
|
|
106
106
|
class_option :skip_brakeman, type: :boolean, default: nil,
|
|
107
107
|
desc: "Skip brakeman setup"
|
|
108
108
|
|
|
109
|
+
class_option :skip_bundler_audit, type: :boolean, default: nil,
|
|
110
|
+
desc: "Skip bundler-audit setup"
|
|
111
|
+
|
|
109
112
|
class_option :skip_ci, type: :boolean, default: nil,
|
|
110
113
|
desc: "Skip GitHub CI files"
|
|
111
114
|
|
|
@@ -400,6 +403,10 @@ module Rails
|
|
|
400
403
|
options[:skip_brakeman]
|
|
401
404
|
end
|
|
402
405
|
|
|
406
|
+
def skip_bundler_audit?
|
|
407
|
+
options[:skip_bundler_audit]
|
|
408
|
+
end
|
|
409
|
+
|
|
403
410
|
def skip_ci?
|
|
404
411
|
options[:skip_ci]
|
|
405
412
|
end
|
|
@@ -657,6 +664,11 @@ module Rails
|
|
|
657
664
|
end
|
|
658
665
|
end
|
|
659
666
|
|
|
667
|
+
def rails_command(command, command_options = {})
|
|
668
|
+
command_options[:capture] = true if options[:quiet]
|
|
669
|
+
super
|
|
670
|
+
end
|
|
671
|
+
|
|
660
672
|
def bundle_install?
|
|
661
673
|
!(options[:skip_bundle] || options[:pretend])
|
|
662
674
|
end
|
|
@@ -109,7 +109,7 @@ module Rails
|
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
def bin
|
|
112
|
-
exclude_pattern = Regexp.union([(/thrust/ if skip_thruster?), (/rubocop/ if skip_rubocop?), (/brakeman/ if skip_brakeman?)].compact)
|
|
112
|
+
exclude_pattern = Regexp.union([(/thrust/ if skip_thruster?), (/rubocop/ if skip_rubocop?), (/brakeman/ if skip_brakeman?), (/bundler-audit/ if skip_bundler_audit?)].compact)
|
|
113
113
|
directory "bin", { exclude_pattern: exclude_pattern } do |content|
|
|
114
114
|
"#{shebang}\n" + content
|
|
115
115
|
end
|
|
@@ -127,8 +127,8 @@ module Rails
|
|
|
127
127
|
template "routes.rb" unless options[:update]
|
|
128
128
|
template "application.rb"
|
|
129
129
|
template "environment.rb"
|
|
130
|
-
template "bundler-audit.yml"
|
|
131
|
-
template "cable.yml" unless options[:update] ||
|
|
130
|
+
template "bundler-audit.yml" unless skip_bundler_audit?
|
|
131
|
+
template "cable.yml" unless options[:update] || skip_action_cable?
|
|
132
132
|
template "ci.rb"
|
|
133
133
|
template "puma.rb"
|
|
134
134
|
template "storage.yml" unless options[:update] || skip_active_storage?
|
|
@@ -153,7 +153,7 @@ module Rails
|
|
|
153
153
|
|
|
154
154
|
config
|
|
155
155
|
|
|
156
|
-
if !
|
|
156
|
+
if !skip_action_cable? && !action_cable_config_exist
|
|
157
157
|
template "config/cable.yml"
|
|
158
158
|
end
|
|
159
159
|
|
|
@@ -177,7 +177,7 @@ module Rails
|
|
|
177
177
|
remove_file "config/initializers/cors.rb"
|
|
178
178
|
end
|
|
179
179
|
|
|
180
|
-
if !bundle_audit_config_exist
|
|
180
|
+
if !skip_bundler_audit? && !bundle_audit_config_exist
|
|
181
181
|
template "config/bundler-audit.yml"
|
|
182
182
|
end
|
|
183
183
|
|
|
@@ -317,6 +317,7 @@ module Rails
|
|
|
317
317
|
:skip_active_storage,
|
|
318
318
|
:skip_bootsnap,
|
|
319
319
|
:skip_brakeman,
|
|
320
|
+
:skip_bundler_audit,
|
|
320
321
|
:skip_ci,
|
|
321
322
|
:skip_dev_gems,
|
|
322
323
|
:skip_docker,
|
|
@@ -65,7 +65,8 @@ COPY Gemfile Gemfile.lock vendor ./
|
|
|
65
65
|
|
|
66
66
|
RUN bundle install && \
|
|
67
67
|
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git<% if depend_on_bootsnap? -%> && \
|
|
68
|
-
|
|
68
|
+
# -j 1 disable parallel compilation to avoid a QEMU bug: https://github.com/rails/bootsnap/issues/495
|
|
69
|
+
bundle exec bootsnap precompile -j 1 --gemfile<% end %>
|
|
69
70
|
|
|
70
71
|
<% if using_node? -%>
|
|
71
72
|
# Install node modules
|
|
@@ -83,8 +84,9 @@ RUN bun install --frozen-lockfile
|
|
|
83
84
|
COPY . .
|
|
84
85
|
|
|
85
86
|
<% if depend_on_bootsnap? -%>
|
|
86
|
-
# Precompile bootsnap code for faster boot times
|
|
87
|
-
|
|
87
|
+
# Precompile bootsnap code for faster boot times.
|
|
88
|
+
# -j 1 disable parallel compilation to avoid a QEMU bug: https://github.com/rails/bootsnap/issues/495
|
|
89
|
+
RUN bundle exec bootsnap precompile -j 1 app/ lib/
|
|
88
90
|
|
|
89
91
|
<% end -%>
|
|
90
92
|
<% unless dockerfile_binfile_fixups.empty? -%>
|
|
@@ -42,7 +42,7 @@ gem "thruster", require: false
|
|
|
42
42
|
<% unless skip_active_storage? -%>
|
|
43
43
|
|
|
44
44
|
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
|
|
45
|
-
|
|
45
|
+
gem "image_processing", "~> 1.2"
|
|
46
46
|
<% end -%>
|
|
47
47
|
<%- if options.api? -%>
|
|
48
48
|
|
|
@@ -54,9 +54,11 @@ gem "thruster", require: false
|
|
|
54
54
|
group :development, :test do
|
|
55
55
|
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
|
|
56
56
|
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
|
|
57
|
+
<%- unless options.skip_bundler_audit? -%>
|
|
57
58
|
|
|
58
59
|
# Audits gems for known security defects (use config/bundler-audit.yml to ignore issues)
|
|
59
60
|
gem "bundler-audit", require: false
|
|
61
|
+
<%- end -%>
|
|
60
62
|
<%- unless options.skip_brakeman? -%>
|
|
61
63
|
|
|
62
64
|
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
|
|
@@ -6,7 +6,9 @@ CI.run do
|
|
|
6
6
|
step "Style: Ruby", "bin/rubocop"
|
|
7
7
|
<% end -%>
|
|
8
8
|
|
|
9
|
+
<% unless options.skip_bundler_audit? -%>
|
|
9
10
|
step "Security: Gem audit", "bin/bundler-audit"
|
|
11
|
+
<% end -%>
|
|
10
12
|
<% if using_node? -%>
|
|
11
13
|
step "Security: Yarn vulnerability audit", "yarn audit"
|
|
12
14
|
<% end -%>
|
|
@@ -22,7 +24,9 @@ CI.run do
|
|
|
22
24
|
step "Tests: Rails", "bin/rails test"
|
|
23
25
|
step "Tests: System", "bin/rails test:system"
|
|
24
26
|
<% end -%>
|
|
27
|
+
<% unless options.skip_active_record? -%>
|
|
25
28
|
step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
|
|
29
|
+
<% end -%>
|
|
26
30
|
|
|
27
31
|
# Optional: set a green GitHub commit status to unblock PR merge.
|
|
28
32
|
# Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Name of your application. Used to uniquely configure containers.
|
|
2
2
|
service: <%= app_name %>
|
|
3
3
|
|
|
4
|
-
# Name of the container image.
|
|
5
|
-
image:
|
|
4
|
+
# Name of the container image (use your-user/app-name on external registries).
|
|
5
|
+
image: <%= app_name %>
|
|
6
6
|
|
|
7
7
|
# Deploy to these servers.
|
|
8
8
|
servers:
|
|
@@ -17,19 +17,21 @@ servers:
|
|
|
17
17
|
# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer.
|
|
18
18
|
#
|
|
19
19
|
# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
|
|
20
|
-
proxy:
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
# proxy:
|
|
21
|
+
# ssl: true
|
|
22
|
+
# host: app.example.com
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# Where you keep your container images.
|
|
25
25
|
registry:
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
# Alternatives: hub.docker.com / registry.digitalocean.com / ghcr.io / ...
|
|
27
|
+
server: localhost:5555
|
|
28
|
+
|
|
29
|
+
# Needed for authenticated registries.
|
|
30
|
+
# username: your-user
|
|
29
31
|
|
|
30
32
|
# Always use an access token rather than real password when possible.
|
|
31
|
-
password:
|
|
32
|
-
|
|
33
|
+
# password:
|
|
34
|
+
# - KAMAL_REGISTRY_PASSWORD
|
|
33
35
|
|
|
34
36
|
# Inject ENV variables into containers (secrets come from .kamal/secrets).
|
|
35
37
|
env:
|
|
@@ -80,11 +82,14 @@ volumes:
|
|
|
80
82
|
- "<%= app_name %>_storage:/rails/storage"
|
|
81
83
|
|
|
82
84
|
<% end -%>
|
|
85
|
+
<% unless options.api? -%>
|
|
83
86
|
# Bridge fingerprinted assets, like JS and CSS, between versions to avoid
|
|
84
87
|
# hitting 404 on in-flight requests. Combines all files from new and old
|
|
85
88
|
# version inside the asset_path.
|
|
86
89
|
asset_path: /rails/public/assets
|
|
87
90
|
|
|
91
|
+
<% end -%>
|
|
92
|
+
|
|
88
93
|
# Configure the image builder.
|
|
89
94
|
builder:
|
|
90
95
|
arch: amd64
|
|
@@ -65,6 +65,9 @@ Rails.application.configure do
|
|
|
65
65
|
config.active_job.verbose_enqueue_logs = true
|
|
66
66
|
|
|
67
67
|
<%- end -%>
|
|
68
|
+
# Highlight code that triggered redirect in logs.
|
|
69
|
+
config.action_dispatch.verbose_redirect_logs = true
|
|
70
|
+
|
|
68
71
|
<%- unless options[:skip_asset_pipeline] -%>
|
|
69
72
|
# Suppress logger output for asset requests.
|
|
70
73
|
config.assets.quiet = true
|
|
@@ -17,20 +17,8 @@ Rails.application.configure do
|
|
|
17
17
|
config.action_controller.perform_caching = true
|
|
18
18
|
<%- end -%>
|
|
19
19
|
|
|
20
|
-
# Cache
|
|
21
|
-
|
|
22
|
-
config.public_file_server.headers = {
|
|
23
|
-
"cache-control" => lambda do |path, _|
|
|
24
|
-
if path.start_with?("/assets/")
|
|
25
|
-
# Files in /assets/ are expected to be fully immutable.
|
|
26
|
-
# If the content change the URL too.
|
|
27
|
-
"public, immutable, max-age=#{1.year.to_i}"
|
|
28
|
-
else
|
|
29
|
-
# For anything else we cache for 1 minute.
|
|
30
|
-
"public, max-age=#{1.minute.to_i}, stale-while-revalidate=#{5.minutes.to_i}"
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
}
|
|
20
|
+
# Cache assets for far-future expiry since they are all digest stamped.
|
|
21
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
|
|
34
22
|
|
|
35
23
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
36
24
|
# config.asset_host = "http://assets.example.com"
|
data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_8_1.rb.tt
CHANGED
|
@@ -27,6 +27,14 @@
|
|
|
27
27
|
#++
|
|
28
28
|
# Rails.configuration.action_controller.escape_json_responses = false
|
|
29
29
|
|
|
30
|
+
###
|
|
31
|
+
# Skips escaping LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) in JSON.
|
|
32
|
+
#
|
|
33
|
+
# Historically these characters were not valid inside JavaScript literal strings but that changed in ECMAScript 2019.
|
|
34
|
+
# As such it's no longer a concern in modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset.
|
|
35
|
+
#++
|
|
36
|
+
# Rails.configuration.active_support.escape_js_separators_in_json = false
|
|
37
|
+
|
|
30
38
|
###
|
|
31
39
|
# Raises an error when order dependent finder methods (e.g. `#first`, `#second`) are called without `order` values
|
|
32
40
|
# on the relation, and the model does not have any order columns (`implicit_order_column`, `query_constraints`, or
|
|
@@ -6,7 +6,7 @@ on:
|
|
|
6
6
|
branches: [ <%= user_default_branch %> ]
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
|
-
<%- unless skip_brakeman? -%>
|
|
9
|
+
<%- unless skip_brakeman? && skip_bundler_audit? -%>
|
|
10
10
|
scan_ruby:
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
|
|
@@ -18,12 +18,16 @@ jobs:
|
|
|
18
18
|
uses: ruby/setup-ruby@v1
|
|
19
19
|
with:
|
|
20
20
|
bundler-cache: true
|
|
21
|
+
<%- unless skip_brakeman? -%>
|
|
21
22
|
|
|
22
23
|
- name: Scan for common Rails security vulnerabilities using static analysis
|
|
23
24
|
run: bin/brakeman --no-pager
|
|
25
|
+
<% end -%>
|
|
26
|
+
<%- unless skip_bundler_audit? -%>
|
|
24
27
|
|
|
25
28
|
- name: Scan for known security vulnerabilities in gems used
|
|
26
29
|
run: bin/bundler-audit
|
|
30
|
+
<% end -%>
|
|
27
31
|
|
|
28
32
|
<% end -%>
|
|
29
33
|
<%- if using_importmap? -%>
|
|
@@ -142,7 +146,7 @@ jobs:
|
|
|
142
146
|
<%- end -%>
|
|
143
147
|
# RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
|
|
144
148
|
# REDIS_URL: redis://localhost:6379/0
|
|
145
|
-
run: bin/rails db:test:prepare test
|
|
149
|
+
run: bin/rails <%= "db:test:prepare " unless skip_active_record? %>test
|
|
146
150
|
<%- unless options[:api] || options[:skip_system_test] -%>
|
|
147
151
|
|
|
148
152
|
system-test:
|
|
@@ -215,7 +219,7 @@ jobs:
|
|
|
215
219
|
<%- end -%>
|
|
216
220
|
# RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
|
|
217
221
|
# REDIS_URL: redis://localhost:6379/0
|
|
218
|
-
run: bin/rails db:test:prepare test:system
|
|
222
|
+
run: bin/rails <%= "db:test:prepare " unless skip_active_record? %>test:system
|
|
219
223
|
|
|
220
224
|
- name: Keep screenshots from failed system tests
|
|
221
225
|
uses: actions/upload-artifact@v4
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# GITHUB_TOKEN=$(gh config get -h github.com oauth_token)
|
|
15
15
|
|
|
16
16
|
# Grab the registry password from ENV
|
|
17
|
-
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD
|
|
17
|
+
# KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD
|
|
18
18
|
|
|
19
19
|
# Improve security by using a password manager. Never check config/master.key into git!
|
|
20
20
|
RAILS_MASTER_KEY=$(cat config/master.key)
|
|
@@ -35,12 +35,35 @@
|
|
|
35
35
|
font-weight: 400;
|
|
36
36
|
letter-spacing: -0.0025em;
|
|
37
37
|
line-height: 1.4;
|
|
38
|
-
min-height:
|
|
38
|
+
min-height: 100dvh;
|
|
39
39
|
place-items: center;
|
|
40
40
|
text-rendering: optimizeLegibility;
|
|
41
41
|
-webkit-text-size-adjust: 100%;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
#error-description {
|
|
45
|
+
fill: #d30001;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#error-id {
|
|
49
|
+
fill: #f0eff0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media (prefers-color-scheme: dark) {
|
|
53
|
+
body {
|
|
54
|
+
background: #101010;
|
|
55
|
+
color: #e0e0e0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#error-description {
|
|
59
|
+
fill: #FF6161;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#error-id {
|
|
63
|
+
fill: #2c2c2c;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
44
67
|
a {
|
|
45
68
|
color: inherit;
|
|
46
69
|
font-weight: 700;
|
|
@@ -83,13 +106,11 @@
|
|
|
83
106
|
}
|
|
84
107
|
|
|
85
108
|
main article br {
|
|
86
|
-
|
|
87
109
|
display: none;
|
|
88
110
|
|
|
89
111
|
@media(min-width: 48em) {
|
|
90
112
|
display: inline;
|
|
91
113
|
}
|
|
92
|
-
|
|
93
114
|
}
|
|
94
115
|
|
|
95
116
|
</style>
|
|
@@ -102,7 +123,7 @@
|
|
|
102
123
|
|
|
103
124
|
<main>
|
|
104
125
|
<header>
|
|
105
|
-
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm140.456 133.2831c-40.823 0-64.884-35.146-64.884-85.7015 0-50.5554 24.061-85.700907 64.884-85.700907 40.822 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.062 85.7015-64.884 85.7015zm0-133.2831c-17.573 0-22.71 21.8984-22.71 47.5816 0 25.6835 5.137 47.5815 22.71 47.5815 17.302 0 22.709-21.898 22.709-47.5815 0-25.6832-5.407-47.5816-22.709-47.5816z"
|
|
126
|
+
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm140.456 133.2831c-40.823 0-64.884-35.146-64.884-85.7015 0-50.5554 24.061-85.700907 64.884-85.700907 40.822 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.062 85.7015-64.884 85.7015zm0-133.2831c-17.573 0-22.71 21.8984-22.71 47.5816 0 25.6835 5.137 47.5815 22.71 47.5815 17.302 0 22.709-21.898 22.709-47.5815 0-25.6832-5.407-47.5816-22.709-47.5816z" id="error-id"/><path d="m123.606 85.4445c3.212 1.0523 5.538 4.2089 5.538 8.0301 0 6.1472-4.209 9.5254-11.298 9.5254h-15.617v-34.0033h14.565c7.089 0 11.353 3.1566 11.353 9.2484 0 3.6551-2.049 6.3134-4.541 7.1994zm-12.904-2.9905h5.095c2.603 0 3.988-.9968 3.988-3.1013 0-2.1044-1.385-3.0459-3.988-3.0459h-5.095zm0 6.6456v6.5902h5.981c2.492 0 3.877-1.3291 3.877-3.2674 0-2.049-1.385-3.3228-3.877-3.3228zm43.786 13.9004h-8.362v-1.274c-.831.831-3.323 1.717-5.981 1.717-4.929 0-9.083-2.769-9.083-8.0301 0-4.818 4.154-7.9193 9.581-7.9193 2.049 0 4.486.6646 5.483 1.3845v-1.606c0-1.606-.942-2.9905-3.046-2.9905-1.606 0-2.548.7199-2.935 1.8275h-8.197c.72-4.8181 4.985-8.6393 11.409-8.6393 7.088 0 11.131 3.7659 11.131 10.2453zm-8.362-6.9779v-1.4399c-.554-1.0522-2.049-1.7167-3.655-1.7167-1.717 0-3.434.7199-3.434 2.3813 0 1.7168 1.717 2.4367 3.434 2.4367 1.606 0 3.101-.6645 3.655-1.6614zm27.996 6.9779v-1.994c-1.163 1.329-3.599 2.548-6.147 2.548-7.199 0-11.131-5.8151-11.131-13.0145s3.932-13.0143 11.131-13.0143c2.548 0 4.984 1.2184 6.147 2.5475v-13.0697h8.695v35.997zm0-9.1931v-6.5902c-.664-1.3291-2.159-2.326-3.821-2.326-2.99 0-4.763 2.4368-4.763 5.6488s1.773 5.5934 4.763 5.5934c1.717 0 3.157-.9415 3.821-2.326zm35.471-2.049h-3.101v11.2421h-8.806v-34.0033h15.285c7.31 0 12.35 4.1535 12.35 11.5744 0 5.1503-2.603 8.6947-6.757 10.2453l7.975 12.1836h-9.858zm-3.101-15.2849v8.1962h5.538c3.156 0 4.596-1.606 4.596-4.0981s-1.44-4.0981-4.596-4.0981zm36.957 17.8323h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm30.98 27.5234v-10.799c-1.163 1.329-3.6 2.548-6.147 2.548-7.2 0-11.132-5.9259-11.132-13.0145 0-7.144 3.932-13.0143 11.132-13.0143 2.547 0 4.984 1.2184 6.147 2.5475v-1.9937h8.695v33.726zm0-17.9981v-6.5902c-.665-1.3291-2.105-2.326-3.821-2.326-2.991 0-4.763 2.4368-4.763 5.6488s1.772 5.5934 4.763 5.5934c1.661 0 3.156-.9415 3.821-2.326zm36.789-15.7279v24.921h-8.695v-2.16c-1.329 1.551-3.821 2.714-6.646 2.714-5.482 0-8.75-3.5999-8.75-9.1379v-16.3371h8.64v14.288c0 2.1045.996 3.5997 3.212 3.5997 1.606 0 3.101-1.0522 3.544-2.769v-15.1187zm19.084 16.2263h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.963 5.095 11.963 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm13.428 11.0206h8.474c.387 1.3845 1.606 2.1598 3.156 2.1598 1.44 0 2.548-.5538 2.548-1.7168 0-.9414-.72-1.2737-1.939-1.5506l-4.873-.9969c-4.154-.886-6.867-2.8797-6.867-7.2547 0-5.3165 4.762-8.4178 10.633-8.4178 6.812 0 10.522 3.1567 11.297 8.0855h-8.03c-.277-1.0522-1.052-1.9937-3.046-1.9937-1.273 0-2.326.5538-2.326 1.6614 0 .7753.554 1.163 1.717 1.3845l4.929 1.163c4.541 1.0522 6.978 3.4335 6.978 7.4763 0 5.3168-4.818 8.2518-10.91 8.2518-6.369 0-10.965-2.88-11.741-8.2518zm27.538-.8861v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.205v6.7564h-5.205v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.993-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.871 0-9.193-2.769-9.193-9.0819z" id="error-description"/></svg>
|
|
106
127
|
</header>
|
|
107
128
|
<article>
|
|
108
129
|
<p><strong>The server cannot process the request due to a client error.</strong> Please check the request and try again. If you're the application owner check the logs for more information.</p>
|
|
@@ -35,12 +35,35 @@
|
|
|
35
35
|
font-weight: 400;
|
|
36
36
|
letter-spacing: -0.0025em;
|
|
37
37
|
line-height: 1.4;
|
|
38
|
-
min-height:
|
|
38
|
+
min-height: 100dvh;
|
|
39
39
|
place-items: center;
|
|
40
40
|
text-rendering: optimizeLegibility;
|
|
41
41
|
-webkit-text-size-adjust: 100%;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
#error-description {
|
|
45
|
+
fill: #d30001;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#error-id {
|
|
49
|
+
fill: #f0eff0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media (prefers-color-scheme: dark) {
|
|
53
|
+
body {
|
|
54
|
+
background: #101010;
|
|
55
|
+
color: #e0e0e0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#error-description {
|
|
59
|
+
fill: #FF6161;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#error-id {
|
|
63
|
+
fill: #2c2c2c;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
44
67
|
a {
|
|
45
68
|
color: inherit;
|
|
46
69
|
font-weight: 700;
|
|
@@ -83,13 +106,11 @@
|
|
|
83
106
|
}
|
|
84
107
|
|
|
85
108
|
main article br {
|
|
86
|
-
|
|
87
109
|
display: none;
|
|
88
110
|
|
|
89
111
|
@media(min-width: 48em) {
|
|
90
112
|
display: inline;
|
|
91
113
|
}
|
|
92
|
-
|
|
93
114
|
}
|
|
94
115
|
|
|
95
116
|
</style>
|
|
@@ -102,7 +123,7 @@
|
|
|
102
123
|
|
|
103
124
|
<main>
|
|
104
125
|
<header>
|
|
105
|
-
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm165.328-35.41581-45.689 100.02991h26.224v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.184v-31.901l50.285-103.27391z"
|
|
126
|
+
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm165.328-35.41581-45.689 100.02991h26.224v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.184v-31.901l50.285-103.27391z" id="error-id"/><path d="m157.758 68.9967v34.0033h-7.199l-14.233-19.8814v19.8814h-8.584v-34.0033h8.307l13.125 18.7184v-18.7184zm28.454 21.5428c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.528 0c0-3.4336-1.496-5.8703-4.209-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.209-2.3813 4.209-5.8149zm13.184 3.8766v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.205v6.7564h-5.205v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm37.027 8.5839h-8.806v-34.0033h23.924v7.6978h-15.118v6.7564h13.9v7.5316h-13.9zm41.876-12.4605c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.529 0c0-3.4336-1.495-5.8703-4.208-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.208-2.3813 4.208-5.8149zm35.337-12.4605v24.921h-8.695v-2.16c-1.329 1.551-3.821 2.714-6.646 2.714-5.482 0-8.75-3.5999-8.75-9.1379v-16.3371h8.64v14.288c0 2.1045.997 3.5997 3.212 3.5997 1.606 0 3.101-1.0522 3.544-2.769v-15.1187zm4.076 24.921v-24.921h8.694v2.1598c1.385-1.5506 3.822-2.7136 6.701-2.7136 5.538 0 8.806 3.5997 8.806 9.1377v16.3371h-8.639v-14.2327c0-2.049-1.053-3.5443-3.268-3.5443-1.717 0-3.156.9969-3.6 2.7136v15.0634zm44.113 0v-1.994c-1.163 1.329-3.6 2.548-6.147 2.548-7.2 0-11.132-5.8151-11.132-13.0145s3.932-13.0143 11.132-13.0143c2.547 0 4.984 1.2184 6.147 2.5475v-13.0697h8.695v35.997zm0-9.1931v-6.5902c-.665-1.3291-2.16-2.326-3.821-2.326-2.991 0-4.763 2.4368-4.763 5.6488s1.772 5.5934 4.763 5.5934c1.717 0 3.156-.9415 3.821-2.326z" id="error-description"/></svg>
|
|
106
127
|
</header>
|
|
107
128
|
<article>
|
|
108
129
|
<p><strong>The page you were looking for doesn't exist.</strong> You may have mistyped the address or the page may have moved. If you're the application owner check the logs for more information.</p>
|