Skip to content

Commit d8bf971

Browse files
authored
Fix connection pool for Redis cache store (#1187)
* Fix connection pool for Redis cache store * fix lint
1 parent a302c11 commit d8bf971

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ gem 'net-smtp', '~> 0.5.1'
2222
gem 'omniauth', '~> 2.1.4'
2323
gem 'omniauth-identity', '~> 3.1', '>= 3.1.5'
2424
gem 'omniauth-oauth2', '~> 1.9.0'
25-
gem 'omniauth-rails_csrf_protection', '~> 2.0', '>= 2.0.1'
2625
gem 'paper_trail', '~> 17.0.0'
2726
gem 'paranoia', '~> 3.1.0'
2827
gem 'pg', '~> 1.6.2'

config/application.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ class Application < Rails::Application
3030

3131
config.cache_store = :redis_cache_store, {
3232
url: Rails.application.config_for(:cable)['url'],
33-
pool_size: ENV.fetch('RAILS_MAX_THREADS', 5).to_i,
34-
pool_timeout: 5
33+
pool: { size: ENV.fetch('RAILS_MAX_THREADS', 5).to_i, timeout: 5 }
3534
}
3635
config.active_job.queue_adapter = :sidekiq
3736

config/initializers/devise.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
# ==> OmniAuth
1313
require_dependency Rails.root.join('config', 'initializers', 'omniauth_strategies', 'amber_oauth2.rb')
1414

15+
# CSRF protection (built-in solution for CVE-2015-9284)
16+
OmniAuth.config.request_validation_phase = OmniAuth::AuthenticityTokenProtection.new(key: :_csrf_token)
17+
1518
config.omniauth :amber_oauth2, Rails.application.config.x.amber_client_id,
1619
Rails.application.config.x.amber_client_secret
1720
config.omniauth :identity, model: SofiaAccount, fields: %i[username user_id],

config/initializers/sidekiq.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
if redis_url
44
Sidekiq.configure_server do |config|
5-
config.redis = {
5+
config.redis = {
66
url: redis_url,
77
pool_timeout: 5
88
}
99
end
1010

1111
Sidekiq.configure_client do |config|
12-
config.redis = {
12+
config.redis = {
1313
url: redis_url,
1414
pool_timeout: 5
1515
}

0 commit comments

Comments
 (0)