From 71c61fc4b39a72be99c93d6a5c92a508172ac687 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Sun, 18 Feb 2024 12:32:08 +0200 Subject: [PATCH] allow to use separate encryption key via env --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 4a577e81..4ca0ee80 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -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),