diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index a6ae3b6..b7b3b4d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -4,6 +4,10 @@ set -euxo pipefail export SLAPD_CONFDIR=/etc/openldap/slapd.d export SLAPD_DATADIR=/var/lib/openldap/openldap-data +# Hash passwords +[ -n "${SLAPD_PASSWORD}" ] && export SLAPD_PASSWORD=$(slappasswd -h '{SSHA}' -s "${SLAPD_PASSWORD}" -n) +[ -n "${SLAPD_CONFIG_PASSWORD}" ] && export SLAPD_CONFIG_PASSWORD=$(slappasswd -h '{SSHA}' -s "${SLAPD_CONFIG_PASSWORD}" -n) + # Generate SLAPD_SUFFIX from given domain IFS="." declare -a dc_parts=(${SLAPD_DOMAIN:-example.com})