Merge pull request #94 from patbaumgartner/develop

Providing better env variables to customize users and groups DN
This commit is contained in:
gruberroland 2020-05-24 08:33:15 +02:00 committed by GitHub
commit 3c305f26fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -8,6 +8,11 @@ LAM_SKIP_PRECONFIGURE=false
LDAP_DOMAIN=my-domain.com
# LDAP base DN to overwrite value generated by LDAP_DOMAIN
LDAP_BASE_DN=dc=my-domain,dc=com
# LDAP users DN to overwrite value provided by LDAP_BASE_DN
LDAP_USERS_DN=ou=people,dc=my-domain,dc=com
# LDAP groups DN to overwrite value provided by LDAP_BASE_DN
LDAP_GROUPS_DN=ou=groups,dc=my-domain,dc=com
# LDAP server URL
LDAP_SERVER=ldap://ldap:389
# LDAP admin user (set as login user for LAM)

View File

@ -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_USERS_DN="${LDAP_USERS_DN:-${LDAP_BASE_DN}}"
LDAP_GROUPS_DN="${LDAP_GROUPS_DN:-${LDAP_BASE_DN}}"
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_USERS_DN}|;
s|^.*suffix_group:.*|types: suffix_group: ${LDAP_GROUPS_DN}|;
EOF
fi