diff --git a/.env.production.sample b/.env.production.sample index 388794f45..df3aa41c9 100644 --- a/.env.production.sample +++ b/.env.production.sample @@ -28,6 +28,9 @@ DB_PORT=5432 ES_ENABLED=true ES_HOST=localhost ES_PORT=9200 +# Authentication for ES (optional) +ES_USER=elastic +ES_PASS=password # Secrets # ------- diff --git a/config/initializers/chewy.rb b/config/initializers/chewy.rb index e099b45cf..fbbcbbcde 100644 --- a/config/initializers/chewy.rb +++ b/config/initializers/chewy.rb @@ -1,6 +1,8 @@ enabled = ENV['ES_ENABLED'] == 'true' host = ENV.fetch('ES_HOST') { 'localhost' } port = ENV.fetch('ES_PORT') { 9200 } +user = ENV.fetch('ES_USER') { nil } +password = ENV.fetch('ES_PASS') { nil } fallback_prefix = ENV.fetch('REDIS_NAMESPACE') { nil } prefix = ENV.fetch('ES_PREFIX') { fallback_prefix } @@ -9,6 +11,8 @@ Chewy.settings = { prefix: prefix, enabled: enabled, journal: false, + user: user, + password: password, sidekiq: { queue: 'pull' }, }