mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Don't log Redis AUTH requirepass.
This commit is contained in:
parent
5f6ef51251
commit
7bde88f398
1 changed files with 9 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
require 'connection_pool'
|
||||
require 'redis'
|
||||
require 'uri'
|
||||
|
||||
module Sidekiq
|
||||
class RedisConnection
|
||||
|
@ -53,10 +54,16 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def log_info(options)
|
||||
# Don't log Redis AUTH password
|
||||
scrubbed_options = options.dup
|
||||
if scrubbed_options[:url] && (uri = URI.parse(scrubbed_options[:url])) && uri.password
|
||||
uri.password = "REDACTED"
|
||||
scrubbed_options[:url] = uri.to_s
|
||||
end
|
||||
if Sidekiq.server?
|
||||
Sidekiq.logger.info("Booting Sidekiq #{Sidekiq::VERSION} with redis options #{options}")
|
||||
Sidekiq.logger.info("Booting Sidekiq #{Sidekiq::VERSION} with redis options #{scrubbed_options}")
|
||||
else
|
||||
Sidekiq.logger.info("#{Sidekiq::NAME} client with redis options #{options}")
|
||||
Sidekiq.logger.info("#{Sidekiq::NAME} client with redis options #{scrubbed_options}")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue