Merge pull request #94 from patbaumgartner/develop
Providing better env variables to customize users and groups DN
This commit is contained in:
commit
3c305f26fa
|
@ -8,6 +8,11 @@ LAM_SKIP_PRECONFIGURE=false
|
||||||
LDAP_DOMAIN=my-domain.com
|
LDAP_DOMAIN=my-domain.com
|
||||||
# LDAP base DN to overwrite value generated by LDAP_DOMAIN
|
# LDAP base DN to overwrite value generated by LDAP_DOMAIN
|
||||||
LDAP_BASE_DN=dc=my-domain,dc=com
|
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 URL
|
||||||
LDAP_SERVER=ldap://ldap:389
|
LDAP_SERVER=ldap://ldap:389
|
||||||
# LDAP admin user (set as login user for LAM)
|
# LDAP admin user (set as login user for LAM)
|
||||||
|
|
|
@ -32,8 +32,10 @@ if [ "$LAM_SKIP_PRECONFIGURE" != "true" ]; then
|
||||||
LDAP_SERVER="${LDAP_SERVER:-ldap://ldap:389}"
|
LDAP_SERVER="${LDAP_SERVER:-ldap://ldap:389}"
|
||||||
LDAP_DOMAIN="${LDAP_DOMAIN:-my-domain.com}"
|
LDAP_DOMAIN="${LDAP_DOMAIN:-my-domain.com}"
|
||||||
LDAP_BASE_DN="${LDAP_BASE_DN:-dc=${LDAP_DOMAIN//\./,dc=}}"
|
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}}"
|
LDAP_ADMIN_USER="${LDAP_USER:-cn=admin,${LDAP_BASE_DN}}"
|
||||||
|
|
||||||
sed -i -f- /etc/ldap-account-manager/config.cfg <<- EOF
|
sed -i -f- /etc/ldap-account-manager/config.cfg <<- EOF
|
||||||
s|^password:.*|password: ${LAM_PASSWORD_SSHA}|;
|
s|^password:.*|password: ${LAM_PASSWORD_SSHA}|;
|
||||||
EOF
|
EOF
|
||||||
|
@ -45,8 +47,8 @@ EOF
|
||||||
s|^Passwd:.*|Passwd: ${LAM_PASSWORD_SSHA}|;
|
s|^Passwd:.*|Passwd: ${LAM_PASSWORD_SSHA}|;
|
||||||
s|^treesuffix:.*|treesuffix: ${LDAP_BASE_DN}|;
|
s|^treesuffix:.*|treesuffix: ${LDAP_BASE_DN}|;
|
||||||
s|^defaultLanguage:.*|defaultLanguage: ${LAM_LANG}.utf8|;
|
s|^defaultLanguage:.*|defaultLanguage: ${LAM_LANG}.utf8|;
|
||||||
s|^.*suffix_user:.*|types: suffix_user: ${LDAP_BASE_DN}|;
|
s|^.*suffix_user:.*|types: suffix_user: ${LDAP_USERS_DN}|;
|
||||||
s|^.*suffix_group:.*|types: suffix_group: ${LDAP_BASE_DN}|;
|
s|^.*suffix_group:.*|types: suffix_group: ${LDAP_GROUPS_DN}|;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue