mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
406 B
15 lines
406 B
# frozen_string_literal: true
|
|
|
|
require 'sidekiq/web' if defined?(Puma)
|
|
|
|
if !ENV['SIDEKIQ_BASIC_AUTH_PASSWORD'].to_s.empty? && defined?(Sidekiq::Web)
|
|
Sidekiq::Web.use(Rack::Auth::Basic) do |_, password|
|
|
ActiveSupport::SecurityUtils.secure_compare(
|
|
Digest::SHA256.hexdigest(password),
|
|
Digest::SHA256.hexdigest(ENV.fetch('SIDEKIQ_BASIC_AUTH_PASSWORD'))
|
|
)
|
|
end
|
|
end
|
|
|
|
Sidekiq.strict_args!
|