Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
- Add Logistics component with progress tracking - Add OrderDetail component for order information - Support data-driven steps and actions - Add blue color scale to widget SCSS - Fix node overflow and progress bar rendering issues - Add English translations for dashboard components Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
50 lines
1.5 KiB
Ruby
50 lines
1.5 KiB
Ruby
module Redis::Config
|
|
DEFAULT_SENTINEL_PORT ||= '26379'.freeze
|
|
class << self
|
|
def app
|
|
config
|
|
end
|
|
|
|
def config
|
|
@config ||= sentinel? ? sentinel_config : base_config
|
|
end
|
|
|
|
def base_config
|
|
{
|
|
url: ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379'),
|
|
password: ENV.fetch('REDIS_PASSWORD', nil).presence,
|
|
ssl_params: { verify_mode: Chatwoot.redis_ssl_verify_mode },
|
|
reconnect_attempts: 2,
|
|
timeout: 1
|
|
}
|
|
end
|
|
|
|
def sentinel?
|
|
ENV.fetch('REDIS_SENTINELS', nil).presence
|
|
end
|
|
|
|
def sentinel_url_config(sentinel_url)
|
|
host, port = sentinel_url.split(':').map(&:strip)
|
|
sentinel_url_config = { host: host, port: port || DEFAULT_SENTINEL_PORT }
|
|
password = ENV.fetch('REDIS_SENTINEL_PASSWORD', base_config[:password])
|
|
sentinel_url_config[:password] = password if password.present?
|
|
sentinel_url_config
|
|
end
|
|
|
|
def sentinel_config
|
|
redis_sentinels = ENV.fetch('REDIS_SENTINELS', nil)
|
|
|
|
# expected format for REDIS_SENTINELS url string is host1:port1, host2:port2
|
|
sentinels = redis_sentinels.split(',').map do |sentinel_url|
|
|
sentinel_url_config(sentinel_url)
|
|
end
|
|
|
|
# over-write redis url as redis://:<your-redis-password>@<master-name>/ when using sentinel
|
|
# more at https://github.com/redis/redis-rb/issues/531#issuecomment-263501322
|
|
master = "redis://#{ENV.fetch('REDIS_SENTINEL_MASTER_NAME', 'mymaster')}"
|
|
|
|
base_config.merge({ url: master, sentinels: sentinels })
|
|
end
|
|
end
|
|
end
|