From 939c848450e6a8d013b685567ca1545a331bb68e Mon Sep 17 00:00:00 2001 From: James Rose Date: Wed, 28 Sep 2022 14:13:36 +0100 Subject: [PATCH] Add Sidekiq web to project This is only accessible when you are logged in as a support user. It is accessible at /sidekiq --- config/initializers/sidekiq.rb | 2 ++ config/routes.rb | 3 +++ 2 files changed, 5 insertions(+) diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 4db5237e4..fa377de99 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,3 +1,5 @@ +require "sidekiq/web" + if Rails.env.staging? || Rails.env.production? redis_url = Configuration::PaasConfigurationService.new.redis_uris[:"dluhc-core-#{Rails.env}-redis"] diff --git a/config/routes.rb b/config/routes.rb index 0c4409713..8bd1502b5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,8 @@ # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html Rails.application.routes.draw do + mount_sidekiq = -> { mount Sidekiq::Web => "/sidekiq" } + authenticate(:user, :support?.to_proc, &mount_sidekiq) + devise_for :users, { path: :account, controllers: {