Compare commits
5 commits
develop
...
chore/5938
Author | SHA1 | Date | |
---|---|---|---|
|
d51d7cdc23 | ||
|
3817d297d5 | ||
|
27295fc47c | ||
|
e4b363e07f | ||
|
ddd79affec |
3 changed files with 12 additions and 11 deletions
|
@ -38,13 +38,4 @@ module Chatwoot
|
||||||
def self.config
|
def self.config
|
||||||
@config ||= Rails.configuration.x
|
@config ||= Rails.configuration.x
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.redis_ssl_verify_mode
|
|
||||||
# Introduced this method to fix the issue in heroku where redis connections fail for redis 6
|
|
||||||
# ref: https://github.com/chatwoot/chatwoot/issues/2420
|
|
||||||
#
|
|
||||||
# unless the redis verify mode is explicitly specified as none, we will fall back to the default 'verify peer'
|
|
||||||
# ref: https://www.rubydoc.info/stdlib/openssl/OpenSSL/SSL/SSLContext#DEFAULT_PARAMS-constant
|
|
||||||
ENV['REDIS_OPENSSL_VERIFY_MODE'] == 'none' ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ default: &default
|
||||||
url: <%= ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379') %>
|
url: <%= ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379') %>
|
||||||
password: <%= ENV.fetch('REDIS_PASSWORD', nil).presence %>
|
password: <%= ENV.fetch('REDIS_PASSWORD', nil).presence %>
|
||||||
ssl_params:
|
ssl_params:
|
||||||
verify_mode: <%= Chatwoot.redis_ssl_verify_mode %>
|
verify_mode: <%= Redis::Config.redis_ssl_verify_mode %>
|
||||||
channel_prefix: <%= "chatwoot_#{Rails.env}_action_cable" %>
|
channel_prefix: <%= "chatwoot_#{Rails.env}_action_cable" %>
|
||||||
|
|
||||||
development:
|
development:
|
||||||
|
|
|
@ -5,6 +5,16 @@ module Redis::Config
|
||||||
config
|
config
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def redis_ssl_verify_mode
|
||||||
|
# Introduced this method to fix the issue in heroku where redis connections fail for redis 6
|
||||||
|
# ref: https://github.com/chatwoot/chatwoot/issues/2420
|
||||||
|
#
|
||||||
|
# unless the redis verify mode is explicitly specified as none, we will fall back to the default 'verify peer'
|
||||||
|
# ref: https://www.rubydoc.info/stdlib/openssl/OpenSSL/SSL/SSLContext#DEFAULT_PARAMS-constant
|
||||||
|
# ENV['REDIS_OPENSSL_VERIFY_MODE'] == 'none' ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
|
||||||
|
ENV['REDIS_OPENSSL_VERIFY_MODE'] == 'none' ? 0 : 1
|
||||||
|
end
|
||||||
|
|
||||||
def config
|
def config
|
||||||
@config ||= sentinel? ? sentinel_config : base_config
|
@config ||= sentinel? ? sentinel_config : base_config
|
||||||
end
|
end
|
||||||
|
@ -13,7 +23,7 @@ module Redis::Config
|
||||||
{
|
{
|
||||||
url: ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379'),
|
url: ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379'),
|
||||||
password: ENV.fetch('REDIS_PASSWORD', nil).presence,
|
password: ENV.fetch('REDIS_PASSWORD', nil).presence,
|
||||||
ssl_params: { verify_mode: Chatwoot.redis_ssl_verify_mode },
|
ssl_params: { verify_mode: redis_ssl_verify_mode },
|
||||||
reconnect_attempts: 2,
|
reconnect_attempts: 2,
|
||||||
network_timeout: 5
|
network_timeout: 5
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue