Refactor LDAP config
* Move credentials to ENV vars in prod * Use same configs in dev and prod * Make UID attribute and admin DN configurable
This commit is contained in:
@@ -28,11 +28,11 @@ authorizations: &AUTHORIZATIONS
|
||||
development:
|
||||
host: <%= ENV["LDAP_HOST"] || "localhost" %>
|
||||
port: <%= ENV["LDAP_PORT"] || "389" %>
|
||||
attribute: cn
|
||||
base: <%= ENV["LDAP_BASE"] || "ou=kosmos.org,cn=users,dc=kosmos,dc=org" %>
|
||||
admin_user: "cn=Directory Manager"
|
||||
admin_password: <%= ENV["LDAP_ADMIN_PASSWORD"] %>
|
||||
ssl: <%= ENV["LDAP_USE_TLS"] || "false" %>
|
||||
attribute: <%= ENV["LDAP_UID_ATTR"] || "cn" %>
|
||||
base: <%= ENV["LDAP_BASE"] || "ou=kosmos.org,cn=users,dc=kosmos,dc=org" %>
|
||||
admin_user: <%= ENV["LDAP_ADMIN_USER"] || "cn=Directory Manager" %>
|
||||
admin_password: <%= ENV["LDAP_ADMIN_PASSWORD"] %>
|
||||
# <<: *AUTHORIZATIONS
|
||||
|
||||
test:
|
||||
@@ -46,11 +46,11 @@ test:
|
||||
# <<: *AUTHORIZATIONS
|
||||
|
||||
production:
|
||||
host: ldap.kosmos.local
|
||||
port: 389
|
||||
attribute: cn
|
||||
base: ou=kosmos.org,cn=users,dc=kosmos,dc=org
|
||||
admin_user: <%= Rails.application.credentials.ldap[:username] rescue nil %>
|
||||
admin_password: <%= Rails.application.credentials.ldap[:password] rescue nil %>
|
||||
# ssl: false
|
||||
host: <%= ENV["LDAP_HOST"] || "localhost" %>
|
||||
port: <%= ENV["LDAP_PORT"] || "389" %>
|
||||
ssl: <%= ENV["LDAP_USE_TLS"] || "false" %>
|
||||
attribute: <%= ENV["LDAP_UID_ATTR"] || "cn" %>
|
||||
base: <%= ENV["LDAP_BASE"] || "ou=kosmos.org,cn=users,dc=kosmos,dc=org" %>
|
||||
admin_user: <%= ENV["LDAP_ADMIN_USER"] || "cn=Directory Manager" %>
|
||||
admin_password: <%= ENV["LDAP_ADMIN_PASSWORD"] %>
|
||||
# <<: *AUTHORIZATIONS
|
||||
|
||||
Reference in New Issue
Block a user