Write hashed passwords into the templates

for security reasons

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-03-15 12:21:26 +01:00
parent b574af5b79
commit 53dd372dfd
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -4,6 +4,10 @@ set -euxo pipefail
export SLAPD_CONFDIR=/etc/openldap/slapd.d export SLAPD_CONFDIR=/etc/openldap/slapd.d
export SLAPD_DATADIR=/var/lib/openldap/openldap-data 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 # Generate SLAPD_SUFFIX from given domain
IFS="." IFS="."
declare -a dc_parts=(${SLAPD_DOMAIN:-example.com}) declare -a dc_parts=(${SLAPD_DOMAIN:-example.com})