You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My initializer: config/initializers/solid_cache.rb
# frozen_string_literal: true
ActiveSupport.on_load(:solid_cache_entry) do
encrypts :value
end
I'm using the rails-settings-cached gem which creates a table with a :value column.
I have a setting called domain that I use in my from address in my mailer:
app/mailers/user_mailer.rb
class UserMailer < ApplicationMailer
default from: "no-reply@#{Setting.domain}"
def invite
# do work
end
end
The app failed to boot up because it was loading the domain setting from the Setting table and trying to decrypt my plaintext setting.
I removed the line from the mailer and it booted up and started getting ActiveRecord::Encryption::Errors::Decryption: ActiveRecord::Encryption::Errors::Decryption errors wherever I called the cache method in my views.
I removed the initializer and it went back to working albeit with the cache now running in plaintext.
Nothing I'm caching at the moment is sensitive. It's mostly just to speed up the website. However, if I end up needing it encrypted, I'd like it to work.
The text was updated successfully, but these errors were encountered:
bruno@SurfaceBruno:~/solid_cache_encrypt$ bin/rails db
SQLite version 3.37.2 2022-01-06 13:25:41
Enter ".help"for usage hints.
sqlite>select* from settings;
1|cache_store|solid_cache|2023-12-20 10:49:15.694176|2023-12-20 10:49:15.694176
sqlite>
I'm wondering if it's because I already had values in settings and solid cache. I talked to someone who mentioned that I should try again with optional encryption turned on so it can read values that already exist in clear. I just haven't had a moment to see if that works.
My initializer: config/initializers/solid_cache.rb
I'm using the
rails-settings-cached
gem which creates a table with a :value column.I have a setting called
domain
that I use in my from address in my mailer:app/mailers/user_mailer.rb
The app failed to boot up because it was loading the domain setting from the Setting table and trying to decrypt my plaintext setting.
I removed the line from the mailer and it booted up and started getting
ActiveRecord::Encryption::Errors::Decryption: ActiveRecord::Encryption::Errors::Decryption
errors wherever I called thecache
method in my views.I removed the initializer and it went back to working albeit with the cache now running in plaintext.
Nothing I'm caching at the moment is sensitive. It's mostly just to speed up the website. However, if I end up needing it encrypted, I'd like it to work.
The text was updated successfully, but these errors were encountered: