allow to use separate encryption key via env

This commit is contained in:
Pete Matsyburka
2024-02-18 12:32:08 +02:00
parent a728aa8689
commit 71c61fc4b3
+1 -1
View File
@@ -108,7 +108,7 @@ Rails.application.configure do
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
encryption_secret = Digest::SHA256.hexdigest(ENV['SECRET_KEY_BASE'].to_s)
encryption_secret = ENV['ENCRYPTION_SECRET'].presence || Digest::SHA256.hexdigest(ENV['SECRET_KEY_BASE'].to_s)
config.active_record.encryption = {
primary_key: encryption_secret.first(32),