Created
June 18, 2020 15:01
-
-
Save josedulanto/401e29b5b371ad6c341b439c7cda4efc to your computer and use it in GitHub Desktop.
Adds Sidekiq web admin to Rails API only with basic auth and custom URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adds Sidekiq web admin to Rails API only with basic auth and custom URL | |
Sidekiq::Web.use(Rack::Auth::Basic) do |username, password| | |
username == Rails.application.credentials[Rails.env.to_sym][:sidekiqweb][:username] && | |
password == Rails.application.credentials[Rails.env.to_sym][:sidekiqweb][:password] | |
end | |
mount(Sidekiq::Web => "/#{Time.now.strftime("%Y%m%d")}sidekiqadmin") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment