Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM mwaeckerlin/base
MAINTAINER mwaeckerlin
ARG backend="mdb"
ARG overlays=""
ARG overlays="openldap-overlay-ppolicy"
ENV DOMAIN ""
ENV PASSWORD ""
ENV DEBUG 1
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ Environment Variables:
Specifies the debug level, defaults to 0 (no debug output)
- `INDEXES` (optional)
A list of indexes that the LDAP server should maintain, separated by spaces, e.g.: ` index uid eq index cn eq`.
- `PASSWORD_HASH` (optional)
A password hashing scheme for the openldap server when storing passwords (see [the docs](https://openldap.org/doc/admin24/security.html#Password%20Storage) for more info). Options are:
* `SSHA`
* `CRYPT`
* `MD5`
* `SMD5`
* `SHA`

Ports:
- 389 (LDAP and LDAP+startTLS)
Expand Down
16 changes: 16 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ memberof-memberof-ad memberOf
memberof-refint true
EOF
fi
if test -n "${PASSWORD_HASH}"; then
case "${PASSWORD_HASH}" in
SSHA|CRYPT|MD5|SMD5|SHA)
echo "include /etc/openldap/schema/ppolicy.schema" >> /etc/ldap/slapd.conf
cat >> /etc/ldap/slapd.conf <<EOF
moduleload ppolicy
overlay ppolicy
ppolicy_hash_cleartext
password-hash {${PASSWORD_HASH}}
EOF
;;
*)
error "PASSWORD_HASH not one of 'SSHA, CRYPT, MD5, SMD5, SHA'"
;;
esac
fi
for schema in $SCHEMAS; do
echo "include /etc/openldap/schema/${schema}.schema" >> /etc/ldap/slapd.conf
done
Expand Down