Skip to content

Commit 9c99a0d

Browse files
committed
Drop Rails.application.secrets in favor of credentials/ENV
Rails 7.2 removes Rails.application.secrets entirely. Anything that relied on config/secrets.yml stops working at the bump. Currently the file only carries secret_key_base, which Rails resolves through this chain (in order): 1. Rails.application.credentials.secret_key_base 2. ENV["SECRET_KEY_BASE"] 3. tmp/local_secret.txt (dev/test auto-generated) Production already uses ENV["SECRET_KEY_BASE"] (unchanged). Dev/test fall through to tmp/local_secret.txt automatically, so deleting secrets.yml is safe. Also drops config.read_encrypted_secrets = true from production.rb, which is a no-op in 7.2 and only ever applied to the legacy secrets.yml.enc workflow. Ref: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#rails-application-secrets-removal
1 parent 9e52608 commit 9c99a0d

2 files changed

Lines changed: 0 additions & 37 deletions

File tree

config/environments/production.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
config.consider_all_requests_local = false
1515
config.action_controller.perform_caching = true
1616

17-
# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
18-
# Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
19-
# `config/secrets.yml.key`.
20-
config.read_encrypted_secrets = true
21-
2217
# Disable serving static files from the `/public` folder by default since
2318
# Apache or NGINX already handles this.
2419
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?

config/secrets.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)