From 4e7383f118540ca723d0285121f82ddf5ae821d9 Mon Sep 17 00:00:00 2001 From: Edward Mead Date: Fri, 4 Sep 2020 20:18:02 +0900 Subject: [PATCH] Add bind url option --- docker-entrypoint.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index fb704b0..15655df 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -85,12 +85,19 @@ for l in /ldif/*; do esac done -if [ "$LDAPS" = true ]; then - echo "Starting LDAPS" - slapd -d "$LOG_LEVEL" -h "ldaps:///" +# default to listening on 389/636 if BIND_URL isn't specified +# https://www.openldap.org/doc/admin24/runningslapd.html +if [ -z "$BIND_URL" ]; then + if [ "$LDAPS" = true ]; then + echo "Starting LDAPS" + slapd -d "$LOG_LEVEL" -h "ldaps:///" + else + echo "Starting LDAP" + slapd -d "$LOG_LEVEL" -h "ldap:///" + fi else - echo "Starting LDAP" - slapd -d "$LOG_LEVEL" -h "ldap:///" + echo "Starting LDAP(S)" + slapd -d "$LOG_LEVEL" -h "$BIND_URL" fi # run command passed to docker run