Skip to content

Commit

Permalink
Use devise authentication for Sidekiq dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNaessens committed May 19, 2024
1 parent 539e8ce commit 1f6fe99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 2 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

# Sidekiq UI
require 'sidekiq/web'
Sidekiq::Web.use(Rack::Auth::Basic) do |username, password|
username == Rails.application.secrets.sidekiq[:basic_auth][:username] && password == Rails.application.secrets.sidekiq[:basic_auth][:password]
authenticate :user, -> (user) { user.admin? } do
mount Sidekiq::Web => '/sidekiq'
end
mount Sidekiq::Web => '/sidekiq'

# PG Hero
authenticate :user, -> (user) { user.admin? } do
Expand Down
8 changes: 0 additions & 8 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ development:
omniauth_client_id: 'tomtest'
omniauth_client_secret: 'blargh'
dsa_key: '#development#'
sidekiq:
basic_auth:
username: dhh
password: zeusisdemax

test:
secret_key_base: 24f28e9f092ff3849df2fcfaf5a0a56a18f098f314a369ea619171a0d47eaea9f0458c25572c52b4cc8c4823d75e2ea5f6477dfcc1e7b5ea46d4ca2be22cfb84
Expand All @@ -28,7 +24,3 @@ production:
omniauth_client_id: <%= ENV["OMNIAUTH_CLIENT_ID"] %>
omniauth_client_secret: <%= ENV["OMNIAUTH_CLIENT_SECRET"] %>
dsa_key: <%= ENV["DSA_KEY"] %>
sidekiq:
basic_auth:
username: <%= ENV["SIDEKIQ_USERNAME"] %>
password: <%= ENV["SIDEKIQ_PASSWORD"] %>

0 comments on commit 1f6fe99

Please sign in to comment.