Make Redis URL configurable

This commit is contained in:
Râu Cao 2023-03-28 12:21:54 +02:00
parent 42b9b27561
commit 6b7a80e23a
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
3 changed files with 14 additions and 0 deletions

View File

@ -7,6 +7,8 @@ SMTP_DOMAIN=example.com
SMTP_AUTH_METHOD=plain SMTP_AUTH_METHOD=plain
SMTP_ENABLE_STARTTLS=auto SMTP_ENABLE_STARTTLS=auto
REDIS_URL='redis://localhost:6379/1'
LDAP_HOST=localhost LDAP_HOST=localhost
LDAP_PORT=389 LDAP_PORT=389
LDAP_ADMIN_PASSWORD=passthebutter LDAP_ADMIN_PASSWORD=passthebutter

View File

@ -2,6 +2,13 @@
class Setting < RailsSettings::Base class Setting < RailsSettings::Base
cache_prefix { "v1" } cache_prefix { "v1" }
#
# Internal services
#
field :redis_url, type: :string, readonly: true,
default: ENV["REDIS_URL"] || "redis://localhost:6379/0"
# #
# Registrations # Registrations
# #

View File

@ -0,0 +1,5 @@
require_relative "../../app/models/setting"
Sidekiq.configure_server do |config|
config.redis = { url: Setting.redis_url }
end