Stop treating RAILS_MASTER_KEY as special

This commit is contained in:
David Heinemeier Hansson
2023-02-04 15:26:59 +01:00
parent 64a5a790a7
commit cf9a402ad8
5 changed files with 5 additions and 42 deletions

View File

@@ -6,7 +6,6 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
"-d",
"--restart unless-stopped",
"--name", service_with_version,
*rails_master_key_arg,
*role.env_args,
*config.volume_args,
*role.label_args,
@@ -56,7 +55,6 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
docker :run,
("-it" if interactive),
"--rm",
*rails_master_key_arg,
*config.env_args,
*config.volume_args,
config.absolute_image,
@@ -130,12 +128,4 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
def service_filter
[ "--filter", "label=service=#{config.service}" ]
end
def rails_master_key_arg
if master_key = config.master_key
[ "-e", redact("RAILS_MASTER_KEY=#{master_key}") ]
else
[]
end
end
end

View File

@@ -110,12 +110,6 @@ class Mrsk::Configuration
{ user: ssh_user, auth_methods: [ "publickey" ] }
end
def 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 valid?
ensure_required_keys_present && ensure_env_available