Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created March 28, 2017 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typeoneerror/eeb3512d81d6357ce3f5e6ee8c7debae to your computer and use it in GitHub Desktop.
Save typeoneerror/eeb3512d81d6357ce3f5e6ee8c7debae to your computer and use it in GitHub Desktop.
require 'sidekiq/web'
redis_options = { url: ENV['REDIS_URL'] }
Sidekiq.configure_server do |config|
config.redis = redis_options
end
Sidekiq.configure_client do |config|
config.redis = redis_options
end
Sidekiq::Web.use(Rack::Auth::Basic) do |username, password|
sidekiq_username = Rails.application.secrets.sidekiq_username || 'admin'
[username, password] == [sidekiq_username, Rails.application.secrets.sidekiq_password]
end unless Rails.env.development?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment