mirror of
https://github.com/docusealco/docuseal.git
synced 2026-06-23 04:10:11 +00:00
15 lines
406 B
Ruby
15 lines
406 B
Ruby
# 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!
|