Emi Matchu
5b016673d7
There's a bit happening behind the scenes of this change. Previously, we kept a `SECRET_TOKEN` environment variable in `production.env`, and used a `secret_token.rb` initializer to wire it up as the `secret_key_base`. In this change, we move to Rails's new-ish (two years old :p) encrypted credentials system. Now, we set a `RAILS_MASTER_KEY` environment variable in the deployed `production.env` instead (and in our local `.env.production` in the project root for managing it), and we can run `rails credentials:edit` to open the encrypted file in a text editor. Inside, the content is just: ```yml secret_key_base: "<OUR_SECRET_KEY>" ``` This indirection doesn't exactly do much for us functionally; it's just the more standard way of achieving what our `secret_token.rb` situation was achieving. We could also migrate other secrets into there, and I just might! That would simplify duplication between `/deploy/files/production.env` and `/.env.production`, at any rate! The main notable one is `MATCHU_EMAIL_PASSWORD` for sending auth emails from `matchu@openneo.net` (and there's also a Stripe token that we don't actually use in the app these days, those codepaths are old bones). Oh and there's also the `IMPRESS_2020_SUPPORT_SECRET`! Anyway, the motivation for this was to remove the warning when starting the app that Devise is trying to use the deprecated `Rails.application.secrets` method. I was expecting to have to do [the workaround shared here](https://github.com/heartcombo/devise/issues/5644#issuecomment-1804626431), but it turns out whatever default behavior Devise does under the hood is happy enough with our new decision to use the credentials file, and the deprecation warning is gone! Ok neat! |
||
---|---|---|
.. | ||
application_controller_renderer.rb | ||
asset_hosts.rb | ||
assets.rb | ||
attack.rb | ||
backtrace_silencers.rb | ||
content_security_policy.rb | ||
cookies_serializer.rb | ||
devise.rb | ||
filter_parameter_logging.rb | ||
impress_2020.rb | ||
inflections.rb | ||
locale_meta.rb | ||
mime_types.rb | ||
permissions_policy.rb | ||
rspec_generator.rb | ||
sentry.rb | ||
session_store.rb | ||
stripe.rb | ||
wrap_parameters.rb |