From b91333ff122dc9a78bfb1e650a55535d3e3a2bc4 Mon Sep 17 00:00:00 2001 From: Patrick Baumgartner Date: Sat, 23 May 2020 14:00:02 +0200 Subject: [PATCH] Allowing to have a DN for users and groups Users and groups are usually not in the same DN/OU, therefore we need the possibility to adjust them as well via environment variables and still keeping backward compatibility. --- lam-packaging/docker/start.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lam-packaging/docker/start.sh b/lam-packaging/docker/start.sh index 8c4cf85d..3fd63b7a 100755 --- a/lam-packaging/docker/start.sh +++ b/lam-packaging/docker/start.sh @@ -32,8 +32,10 @@ if [ "$LAM_SKIP_PRECONFIGURE" != "true" ]; then LDAP_SERVER="${LDAP_SERVER:-ldap://ldap:389}" LDAP_DOMAIN="${LDAP_DOMAIN:-my-domain.com}" LDAP_BASE_DN="${LDAP_BASE_DN:-dc=${LDAP_DOMAIN//\./,dc=}}" + LDAP_USER_DN="${LDAP_USER_DN:-dc=${LDAP_DOMAIN//\./,dc=}}" + LDAP_GROUP_DN="${LDAP_GROUP_DN:-dc=${LDAP_DOMAIN//\./,dc=}}" LDAP_ADMIN_USER="${LDAP_USER:-cn=admin,${LDAP_BASE_DN}}" - + sed -i -f- /etc/ldap-account-manager/config.cfg <<- EOF s|^password:.*|password: ${LAM_PASSWORD_SSHA}|; EOF @@ -45,8 +47,8 @@ EOF s|^Passwd:.*|Passwd: ${LAM_PASSWORD_SSHA}|; s|^treesuffix:.*|treesuffix: ${LDAP_BASE_DN}|; s|^defaultLanguage:.*|defaultLanguage: ${LAM_LANG}.utf8|; - s|^.*suffix_user:.*|types: suffix_user: ${LDAP_BASE_DN}|; - s|^.*suffix_group:.*|types: suffix_group: ${LDAP_BASE_DN}|; + s|^.*suffix_user:.*|types: suffix_user: ${LDAP_USER_DN}|; + s|^.*suffix_group:.*|types: suffix_group: ${LDAP_GROUP_DN}|; EOF fi