Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit c5699c5

Browse files
committed
Bugfix "slapadd: (..) )attribute 'dc' cannot have multiple values"
1 parent 793b52a commit c5699c5

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ COPY ./docker/ /
2222

2323
# OpenLDAP
2424
ENV DOMAIN_NAME="local"
25+
ENV DOMAIN_NAME_DC="local"
2526
ENV LDAPCONF=/etc/openldap/slapd.conf
2627
ENV LDAP_CONF_DIR=/etc/openldap/slapd.d
2728
ENV LDAP_INIT_DIR=/var/lib/openldap/openldap-init

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Based on:
2020

2121
## Environment Variables you should set
2222

23-
- `DOMAIN_NAME` -- Domain name for LDAP suffix
23+
- `DOMAIN_NAME` -- Domain name for LDAP suffix (i.e.: `example.com`)
24+
- `DOMAIN_NAME_DC` -- [DomainComponent] for LDAP database (single word, no dots, i.e.: `example`)
2425
- `LDAP_ROOT_USERNAME` -- root/admin user name for [OpenLDAP]
2526
- `LDAP_ROOT_PASSWORD` -- password for [OpenLDAP] root/admin user \*
2627

@@ -75,6 +76,7 @@ Based on:
7576
MIT
7677

7778

79+
[DomainComponent]: https://ldapwiki.com/wiki/DomainComponent
7880
[LDIF]: https://www.openldap.org/software//man.cgi?query=LDIF&sektion=5&apropos=0&manpath=OpenLDAP+2.4-Release
7981
[OpenLDAP]: https://www.openldap.org/
8082
[nginx]: https://www.nginx.com/
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dn: ${LDAP_DN}
22
objectClass: dcObject
33
objectClass: organization
4-
${LDAP_DC_VERTICAL}
4+
dc: ${DOMAIN_NAME_DC}
55
o: ${DOMAIN_NAME}
66
description: Example directory

docker/docker-entrypoint.sh

-3
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,9 @@ readonly LDAP_DN="dc=${DOMAIN_NAME//\./,dc=}"
114114
readonly LDAP_ROOTDN="cn=${LDAP_ROOT_USERNAME},${LDAP_DN}"
115115
# shellcheck disable=SC2154
116116
readonly LDAP_ROOTPW="${LDAP_ROOT_PASSWORD}"
117-
# shellcheck disable=SC2001
118-
readonly LDAP_DC_VERTICAL=$(echo "${LDAP_DN//=/: }" | sed 's/,/\n/g')
119117
export LDAP_DN
120118
export LDAP_ROOTDN
121119
export LDAP_ROOTPW
122-
export LDAP_DC_VERTICAL
123120

124121
init_nginx
125122
init_openldap

0 commit comments

Comments
 (0)