From bd83e667cae86c8591c83b9937f5da97e09234a7 Mon Sep 17 00:00:00 2001 From: Sebastian van Hesteren Date: Tue, 6 Aug 2024 13:54:29 +0200 Subject: [PATCH] Return early if SECRET_KEY_BASE_DUMMY is set --- lib/eyaml/railtie.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eyaml/railtie.rb b/lib/eyaml/railtie.rb index eede2a2..ad1c670 100644 --- a/lib/eyaml/railtie.rb +++ b/lib/eyaml/railtie.rb @@ -12,6 +12,9 @@ class ConflictError < StandardError end config.before_configuration do + # Allow rails to run without loading the credentials + return if ENV["SECRET_KEY_BASE_DUMMY"] == "1" + if File.exist?(Rails.root.join("config", "master.key")) raise ConflictError, "A config/master.key has been found. The rails credentials lookup conflicts with eyaml. Please remove rails credentials management by removing the master.key file to keep using eyaml." end