Skip to content

Instantly share code, notes, and snippets.

@josedulanto
Created June 18, 2020 15:01
Show Gist options
  • Save josedulanto/401e29b5b371ad6c341b439c7cda4efc to your computer and use it in GitHub Desktop.
Save josedulanto/401e29b5b371ad6c341b439c7cda4efc to your computer and use it in GitHub Desktop.

Revisions

  1. josedulanto created this gist Jun 18, 2020.
    7 changes: 7 additions & 0 deletions routes.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # 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")