Add Sidekiq, configure admin access to Web UI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Basti 2021-02-02 11:44:17 +01:00
parent 4526c941b8
commit 35e2c8cd30
Signed by untrusted user: basti
GPG Key ID: 9F88009D31D99C72
5 changed files with 44 additions and 0 deletions

View File

@ -21,15 +21,22 @@ gem 'jbuilder', '~> 2.7'
# Reduces boot times through caching; required in config/boot.rb # Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false gem 'bootsnap', '>= 1.4.2', require: false
# Configuration
gem 'dotenv-rails' gem 'dotenv-rails'
# Authentication
gem 'warden' gem 'warden'
gem 'devise' gem 'devise'
gem 'devise_ldap_authenticatable' gem 'devise_ldap_authenticatable'
gem 'net-ldap' gem 'net-ldap'
# HTTP requests
gem 'faraday' gem 'faraday'
# Background/scheduled jobs
gem 'sidekiq'
gem 'sidekiq-scheduler'
group :development, :test do group :development, :test do
# Use sqlite3 as the database for Active Record # Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4' gem 'sqlite3', '~> 1.4'

View File

@ -73,6 +73,7 @@ GEM
regexp_parser (~> 1.5) regexp_parser (~> 1.5)
xpath (~> 3.2) xpath (~> 3.2)
concurrent-ruby (1.1.7) concurrent-ruby (1.1.7)
connection_pool (2.2.3)
crack (0.4.3) crack (0.4.3)
safe_yaml (~> 1.0.0) safe_yaml (~> 1.0.0)
crass (1.0.6) crass (1.0.6)
@ -91,7 +92,10 @@ GEM
dotenv-rails (2.7.2) dotenv-rails (2.7.2)
dotenv (= 2.7.2) dotenv (= 2.7.2)
railties (>= 3.2, < 6.1) railties (>= 3.2, < 6.1)
e2mmap (0.1.0)
erubi (1.9.0) erubi (1.9.0)
et-orbi (1.2.4)
tzinfo
factory_bot (6.1.0) factory_bot (6.1.0)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
factory_bot_rails (6.1.0) factory_bot_rails (6.1.0)
@ -100,6 +104,9 @@ GEM
faraday (0.17.0) faraday (0.17.0)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
ffi (1.13.1) ffi (1.13.1)
fugit (1.4.2)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.4)
globalid (0.4.2) globalid (0.4.2)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
hashdiff (0.4.0) hashdiff (0.4.0)
@ -141,6 +148,7 @@ GEM
public_suffix (4.0.6) public_suffix (4.0.6)
puma (4.3.6) puma (4.3.6)
nio4r (~> 2.0) nio4r (~> 2.0)
raabro (1.4.0)
rack (2.2.3) rack (2.2.3)
rack-proxy (0.6.5) rack-proxy (0.6.5)
rack rack
@ -176,6 +184,7 @@ GEM
rb-fsevent (0.10.4) rb-fsevent (0.10.4)
rb-inotify (0.10.1) rb-inotify (0.10.1)
ffi (~> 1.0) ffi (~> 1.0)
redis (4.2.5)
regexp_parser (1.8.2) regexp_parser (1.8.2)
responders (3.0.1) responders (3.0.1)
actionpack (>= 5.0) actionpack (>= 5.0)
@ -197,6 +206,8 @@ GEM
rspec-mocks (~> 3.9) rspec-mocks (~> 3.9)
rspec-support (~> 3.9) rspec-support (~> 3.9)
rspec-support (3.10.0) rspec-support (3.10.0)
rufus-scheduler (3.7.0)
fugit (~> 1.1, >= 1.1.6)
safe_yaml (1.0.5) safe_yaml (1.0.5)
sass-rails (6.0.0) sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1) sassc-rails (~> 2.1, >= 2.1.1)
@ -208,6 +219,17 @@ GEM
sprockets (> 3.0) sprockets (> 3.0)
sprockets-rails sprockets-rails
tilt tilt
sidekiq (6.1.3)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
sidekiq-scheduler (3.0.1)
e2mmap
redis (>= 3, < 5)
rufus-scheduler (~> 3.2)
sidekiq (>= 3)
thwait
tilt (>= 1.4.0)
spring (2.1.1) spring (2.1.1)
spring-watcher-listen (2.0.1) spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0) listen (>= 2.7, < 4.0)
@ -222,6 +244,8 @@ GEM
sqlite3 (1.4.2) sqlite3 (1.4.2)
thor (1.0.1) thor (1.0.1)
thread_safe (0.3.6) thread_safe (0.3.6)
thwait (0.2.0)
e2mmap
tilt (2.0.10) tilt (2.0.10)
turbolinks (5.2.1) turbolinks (5.2.1)
turbolinks-source (~> 5.2) turbolinks-source (~> 5.2)
@ -274,6 +298,8 @@ DEPENDENCIES
rails (~> 6.0.3, >= 6.0.3.4) rails (~> 6.0.3, >= 6.0.3.4)
rspec-rails rspec-rails
sass-rails (>= 6) sass-rails (>= 6)
sidekiq
sidekiq-scheduler
spring spring
spring-watcher-listen (~> 2.0.0) spring-watcher-listen (~> 2.0.0)
sqlite3 (~> 1.4) sqlite3 (~> 1.4)

View File

@ -39,5 +39,7 @@ module Akkounts
g.fixture_replacement :factory_bot, suffix_factory: 'factory', dir: 'spec/factories' g.fixture_replacement :factory_bot, suffix_factory: 'factory', dir: 'spec/factories'
g.stylesheets false g.stylesheets false
end end
config.active_job.queue_adapter = :sidekiq
end end
end end

View File

@ -1,3 +1,5 @@
require 'sidekiq/web'
Rails.application.routes.draw do Rails.application.routes.draw do
resources :donations resources :donations
devise_for :users devise_for :users
@ -23,6 +25,10 @@ Rails.application.routes.draw do
resources :donations resources :donations
end end
authenticate :user, ->(user) { user.is_admin? } do
mount Sidekiq::Web => '/sidekiq'
end
# Letter Opener (open "sent" emails in dev and staging) # Letter Opener (open "sent" emails in dev and staging)
if Rails.env.match(/staging|development/) if Rails.env.match(/staging|development/)
mount LetterOpenerWeb::Engine, at: "letter_opener" mount LetterOpenerWeb::Engine, at: "letter_opener"

3
config/sidekiq.yml Normal file
View File

@ -0,0 +1,3 @@
:concurrency: 2
:queues:
- default