Allow skipping master key

This commit is contained in:
David Heinemeier Hansson
2023-01-24 13:19:12 +01:00
parent 200f12a4a1
commit 08cac72475
5 changed files with 40 additions and 6 deletions

View File

@@ -98,6 +98,10 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
end
def rails_master_key_arg
[ "-e", redact("RAILS_MASTER_KEY=#{config.master_key}") ]
if master_key = config.master_key
[ "-e", redact("RAILS_MASTER_KEY=#{master_key}") ]
else
[]
end
end
end

View File

@@ -115,7 +115,9 @@ class Mrsk::Configuration
end
def master_key
ENV["RAILS_MASTER_KEY"] || File.read(Pathname.new(File.expand_path("config/master.key")))
unless raw_config.skip_master_key
ENV["RAILS_MASTER_KEY"] || File.read(Pathname.new(File.expand_path("config/master.key")))
end
end
def to_h