From 3124a4852c7d1e26325dfbaf111a71cbef8b7432 Mon Sep 17 00:00:00 2001 From: "Max H." <10329648+8ear@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:49:46 +0200 Subject: [PATCH] Update server-wrapper --- deployment/docker/server/server-wrapper | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deployment/docker/server/server-wrapper b/deployment/docker/server/server-wrapper index 75a3f224a..0cd01f1d9 100755 --- a/deployment/docker/server/server-wrapper +++ b/deployment/docker/server/server-wrapper @@ -45,9 +45,15 @@ file_env 'SEMAPHORE_ADMIN' 'admin' export SEMAPHORE_ADMIN_EMAIL="${SEMAPHORE_ADMIN_EMAIL:-admin@localhost}" export SEMAPHORE_ADMIN_NAME="${SEMAPHORE_ADMIN_NAME:-Semaphore Admin}" file_env 'SEMAPHORE_ADMIN_PASSWORD' 'semaphorepassword' +# In the documentation the ENV is 'SEMAPHORE_LDAP_ENABLE' therefore we allow both to set +[ -z "$SEMAPHORE_LDAP_ACTIVATED" ] && [ -n "$SEMAPHORE_LDAP_ENABLE" ] && SEMAPHORE_LDAP_ACTIVATED="${SEMAPHORE_LDAP_ENABLE}" export SEMAPHORE_LDAP_ACTIVATED="${SEMAPHORE_LDAP_ACTIVATED:-no}" +# In the documentation the ENV is 'SEMAPHORE_LDAP_SERVER' therefore we allow both to set +[ -z "$SEMAPHORE_LDAP_HOST" ] && [ -n "$SEMAPHORE_LDAP_SERVER" ] && export SEMAPHORE_LDAP_HOST="${SEMAPHORE_LDAP_SERVER}" export SEMAPHORE_LDAP_HOST="${SEMAPHORE_LDAP_HOST:-}" -export SEMAPHORE_LDAP_PORT="${SEMAPHORE_LDAP_PORT:-}" +export SEMAPHORE_LDAP_PORT="${SEMAPHORE_LDAP_PORT}" +# If LDAP port is not empty add it to 'SEMAPHORE_LDAP_HOST', but if empty use 'SEMAPHORE_LDAP_HOST' alone (for SEMAPHORE_LDAP_HOST='host:389') +[ -n "$SEMAPHORE_LDAP_PORT" ] && export SEMAPHORE_LDAP_HOST="${SEMAPHORE_LDAP_HOST}:${SEMAPHORE_LDAP_PORT}" export SEMAPHORE_LDAP_DN_BIND="${SEMAPHORE_LDAP_DN_BIND:-}" file_env 'SEMAPHORE_LDAP_PASSWORD' export SEMAPHORE_LDAP_DN_SEARCH="${SEMAPHORE_LDAP_DN_SEARCH:-}" @@ -151,7 +157,7 @@ EOF if [ "${SEMAPHORE_LDAP_ACTIVATED}" = "yes" ]; then cat << EOF >> "${SEMAPHORE_TMP_PATH}/config.stdin" -${SEMAPHORE_LDAP_HOST}:${SEMAPHORE_LDAP_PORT} +${SEMAPHORE_LDAP_HOST} ${SEMAPHORE_LDAP_NEEDTLS:-no} ${SEMAPHORE_LDAP_DN_BIND} ${SEMAPHORE_LDAP_PASSWORD}