about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander <devkral@web.de>2018-03-19 20:09:26 +0100
committerEugen Rochko <eugen@zeonfederated.com>2018-03-19 20:09:26 +0100
commit33ee347c995515946e0a045394fe693875ee1cdf (patch)
tree9e15e38f18be7e43c104d22c0c970123185f1c54
parent0306e3e9bebe0b0d9ad7e5fe328dd3677717b7e5 (diff)
rename pam email environment variable to something more understandable and default to LOCAL_DOMAIN (better fallback) (#6833)
-rw-r--r--.env.production.sample4
-rw-r--r--config/initializers/devise.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/.env.production.sample b/.env.production.sample
index 579ad667b..1e5ed9f3d 100644
--- a/.env.production.sample
+++ b/.env.production.sample
@@ -155,8 +155,8 @@ STREAMING_CLUSTER_NUM=1
 # The pam environment variable "email" is provided by:
 # https://github.com/devkral/pam_email_extractor
 # PAM_ENABLED=true
-# Fallback Suffix for email address generation (nil by default)
-# PAM_DEFAULT_SUFFIX=pam
+# Fallback email domain for email address generation (LOCAL_DOMAIN by default)
+# PAM_EMAIL_DOMAIN=example.com
 # Name of the pam service (pam "auth" section is evaluated)
 # PAM_DEFAULT_SERVICE=rpam
 # Name of the pam service used for checking if an user can register (pam "account" section is evaluated) (nil (disabled) by default)
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index df45dcd1f..97757d0fb 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -342,7 +342,7 @@ Devise.setup do |config|
     config.usernamefield          = nil
     config.emailfield             = 'email'
     config.check_at_sign          = true
-    config.pam_default_suffix     = ENV.fetch('PAM_DEFAULT_SUFFIX') { nil }
+    config.pam_default_suffix     = ENV.fetch('PAM_EMAIL_DOMAIN') { ENV['LOCAL_DOMAIN'] }
     config.pam_default_service    = ENV.fetch('PAM_DEFAULT_SERVICE') { 'rpam' }
     config.pam_controlled_service = ENV.fetch('PAM_CONTROLLED_SERVICE') { nil }
   end