Fix empty ENV variables not using default nil value (#27400)

This commit is contained in:
Renaud Chaput 2023-10-13 19:00:53 +02:00 committed by GitHub
parent 82beeb2f7e
commit e0da64bb4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -3,9 +3,9 @@
enabled = ENV['ES_ENABLED'] == 'true' enabled = ENV['ES_ENABLED'] == 'true'
host = ENV.fetch('ES_HOST') { 'localhost' } host = ENV.fetch('ES_HOST') { 'localhost' }
port = ENV.fetch('ES_PORT') { 9200 } port = ENV.fetch('ES_PORT') { 9200 }
user = ENV.fetch('ES_USER') { nil } user = ENV.fetch('ES_USER', nil).presence
password = ENV.fetch('ES_PASS') { nil } password = ENV.fetch('ES_PASS', nil).presence
fallback_prefix = ENV.fetch('REDIS_NAMESPACE') { nil } fallback_prefix = ENV.fetch('REDIS_NAMESPACE', nil).presence
prefix = ENV.fetch('ES_PREFIX') { fallback_prefix } prefix = ENV.fetch('ES_PREFIX') { fallback_prefix }
Chewy.settings = { Chewy.settings = {

View file

@ -394,7 +394,7 @@ Devise.setup do |config|
config.check_at_sign = true config.check_at_sign = true
config.pam_default_suffix = ENV.fetch('PAM_EMAIL_DOMAIN') { ENV['LOCAL_DOMAIN'] } config.pam_default_suffix = ENV.fetch('PAM_EMAIL_DOMAIN') { ENV['LOCAL_DOMAIN'] }
config.pam_default_service = ENV.fetch('PAM_DEFAULT_SERVICE') { 'rpam' } config.pam_default_service = ENV.fetch('PAM_DEFAULT_SERVICE') { 'rpam' }
config.pam_controlled_service = ENV.fetch('PAM_CONTROLLED_SERVICE') { nil } config.pam_controlled_service = ENV.fetch('PAM_CONTROLLED_SERVICE', nil).presence
end end
if ENV['LDAP_ENABLED'] == 'true' if ENV['LDAP_ENABLED'] == 'true'