Skip to content

Conversation

@bshand
Copy link
Contributor

@bshand bshand commented Dec 1, 2025

Rails has deprecated the use of config/secrets.yml as a store for e.g. secret key base. This had a knock on effect of being a breaking change for asset precompilation when running deployments - secret key base was expected to be supplied either through environment variable or encrypted credentials file.

https://api.rubyonrails.org/v7.2/classes/Rails/Application.html#method-i-secret_key_base

We look for it first in ENV["SECRET_KEY_BASE"], then in credentials.secret_key_base. For most applications, the correct place to store it is in the encrypted credentials file.

Generating a random secret_key_base and storing it in tmp/local_secret.txt can also be triggered by setting ENV["SECRET_KEY_BASE_DUMMY"]. This is useful when precompiling assets for production as part of a build step that otherwise does not need access to the production secrets.

The integration test failures are a longstanding issue of brittle tests, unrelated to this commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant