Redact build args (since they are often tokens)
This commit is contained in:
@@ -8,7 +8,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
"-d",
|
||||
"--restart unless-stopped",
|
||||
"--name", config.service_with_version,
|
||||
"-e", redact("RAILS_MASTER_KEY=#{config.master_key}"),
|
||||
"-e", Mrsk::Utils.redact("RAILS_MASTER_KEY=#{config.master_key}"),
|
||||
*config.env_args,
|
||||
*role.label_args,
|
||||
config.absolute_image,
|
||||
@@ -34,7 +34,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
def exec(*command, interactive: false)
|
||||
docker :exec,
|
||||
("-it" if interactive),
|
||||
"-e", redact("RAILS_MASTER_KEY=#{config.master_key}"),
|
||||
"-e", Mrsk::Utils.redact("RAILS_MASTER_KEY=#{config.master_key}"),
|
||||
*config.env_args,
|
||||
config.service_with_version,
|
||||
*command
|
||||
|
||||
@@ -18,10 +18,5 @@ module Mrsk::Commands
|
||||
def docker(*args)
|
||||
args.compact.unshift :docker
|
||||
end
|
||||
|
||||
# Copied from SSHKit::Backend::Abstract#redact to be available inside Commands classes
|
||||
def redact(arg) # Used in execute_command to hide redact() args a user passes in
|
||||
arg.to_s.extend(SSHKit::Redaction) # to_s due to our inability to extend Integer, etc
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ class Mrsk::Commands::Builder::Base < Mrsk::Commands::Base
|
||||
end
|
||||
|
||||
def build_args
|
||||
argumentize "--build-arg", args
|
||||
argumentize "--build-arg", args, redacted: true
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user