updated script in primary repo
This commit is contained in:
parent
2beba0b496
commit
6266e34200
@ -64,4 +64,10 @@ ANONYMOUS_BINDING=yes
|
|||||||
# The container will generate Diffie-Hellman parameters automatically the first
|
# The container will generate Diffie-Hellman parameters automatically the first
|
||||||
# time it's launched with TLS certificates defined.
|
# time it's launched with TLS certificates defined.
|
||||||
|
|
||||||
|
### Custom LDIFs
|
||||||
|
# Path to any custom LDIFs you want applied to the container. Leave this line/
|
||||||
|
# variable commented-out if you don't have any LDIFs to apply.
|
||||||
|
# MY_LDIF=/path/to/my/LDIFs
|
||||||
|
|
||||||
|
|
||||||
#EOF
|
#EOF
|
127
ab-openldap.sh
127
ab-openldap.sh
@ -174,24 +174,52 @@ elif [ -z "$TLS_CERT" ]; then
|
|||||||
if [ $shell = true ]; then
|
if [ $shell = true ]; then
|
||||||
# exec shell
|
# exec shell
|
||||||
printf "${cyan}\nRunning SHELL on %s...${norm}\n" "$container_name"
|
printf "${cyan}\nRunning SHELL on %s...${norm}\n" "$container_name"
|
||||||
docker run --rm -it --name ${container_name} \
|
if [ -d "$MY_LDIF" ]; then
|
||||||
--env-file ab-openldap.params \
|
# bind-mount custom LDIFs if specified
|
||||||
-p 389:389 -p 636:636 \
|
docker run --rm -it --name ${container_name} \
|
||||||
docker.asifbacchus.app/ldap/ab-openldap:latest /bin/sh
|
--env-file ab-openldap.params \
|
||||||
|
-v "$MY_LDIF":/etc/openldap/customLDIF \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest /bin/sh
|
||||||
|
else
|
||||||
|
docker run --rm -it --name ${container_name} \
|
||||||
|
--env-file ab-openldap.params \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest /bin/sh
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# exec normally
|
# exec normally
|
||||||
printf "${cyan}\nRunning OPENLDAP on %s...${norm}\n" "$container_name"
|
printf "${cyan}\nRunning OPENLDAP on %s...${norm}\n" "$container_name"
|
||||||
if [ "$remove" -eq 1 ]; then
|
if [ "$remove" -eq 1 ]; then
|
||||||
docker run --rm -d --name ${container_name} \
|
if [ -d "$MY_LDIF" ]; then
|
||||||
--env-file ab-openldap.params \
|
# bind-mount custom LDIFs if specified
|
||||||
-p 389:389 -p 636:636 \
|
docker run --rm -d --name ${container_name} \
|
||||||
docker.asifbacchus.app/ldap/ab-openldap:latest
|
--env-file ab-openldap.params \
|
||||||
|
-v "$MY_LDIF":/etc/openldap/customLDIF \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest
|
||||||
|
else
|
||||||
|
docker run --rm -d --name ${container_name} \
|
||||||
|
--env-file ab-openldap.params \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
docker run -d --name ${container_name} \
|
if [ -d "$MY_LDIF" ]; then
|
||||||
|
# bind-mount custom LDIFs if specified
|
||||||
|
docker run -d --name ${container_name} \
|
||||||
|
--env-file ab-openldap.params \
|
||||||
|
-v "$MY_LDIF":/etc/openldap/customLDIF \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
--restart unless-stopped \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest
|
||||||
|
else
|
||||||
|
docker run -d --name ${container_name} \
|
||||||
--env-file ab-openldap.params \
|
--env-file ab-openldap.params \
|
||||||
-p 389:389 -p 636:636 \
|
-p 389:389 -p 636:636 \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
docker.asifbacchus.app/ldap/ab-openldap:latest
|
docker.asifbacchus.app/ldap/ab-openldap:latest
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# run with TLS
|
# run with TLS
|
||||||
@ -199,33 +227,70 @@ elif [ "$TLS_CERT" ] && [ "$TLS_KEY" ] && [ "$TLS_CHAIN" ]; then
|
|||||||
if [ $shell = true ]; then
|
if [ $shell = true ]; then
|
||||||
# exec shell
|
# exec shell
|
||||||
printf "${cyan}\nRunning SHELL on %s (TLS)...${norm}\n" "$container_name"
|
printf "${cyan}\nRunning SHELL on %s (TLS)...${norm}\n" "$container_name"
|
||||||
docker run --rm -it --name ${container_name} \
|
if [ -d "$MY_LDIF" ]; then
|
||||||
--env-file ab-openldap.params \
|
# bind-mount custom LDIFs if specified
|
||||||
-v "$TLS_CERT":/certs/fullchain.pem:ro \
|
docker run --rm -it --name ${container_name} \
|
||||||
-v "$TLS_KEY":/certs/privkey.pem:ro \
|
--env-file ab-openldap.params \
|
||||||
-v "$TLS_CHAIN":/certs/chain.pem:ro \
|
-v "$MY_LDIF":/etc/openldap/customLDIF \
|
||||||
-p 389:389 -p 636:636 \
|
-v "$TLS_CERT":/certs/fullchain.pem:ro \
|
||||||
docker.asifbacchus.app/ldap/ab-openldap:latest /bin/sh
|
-v "$TLS_KEY":/certs/privkey.pem:ro \
|
||||||
|
-v "$TLS_CHAIN":/certs/chain.pem:ro \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest /bin/sh
|
||||||
|
else
|
||||||
|
docker run --rm -it --name ${container_name} \
|
||||||
|
--env-file ab-openldap.params \
|
||||||
|
-v "$TLS_CERT":/certs/fullchain.pem:ro \
|
||||||
|
-v "$TLS_KEY":/certs/privkey.pem:ro \
|
||||||
|
-v "$TLS_CHAIN":/certs/chain.pem:ro \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest /bin/sh
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# exec normally
|
# exec normally
|
||||||
printf "${cyan}\nRunning OPENLDAP on %s (TLS)...${norm}\n" "$container_name"
|
printf "${cyan}\nRunning OPENLDAP on %s (TLS)...${norm}\n" "$container_name"
|
||||||
if [ "$remove" -eq 1 ]; then
|
if [ "$remove" -eq 1 ]; then
|
||||||
docker run --rm -d --name ${container_name} \
|
if [ -d "$MY_LDIF" ]; then
|
||||||
--env-file ab-openldap.params \
|
# bind-mount custom LDIFs if specified
|
||||||
-v "$TLS_CERT":/certs/fullchain.pem:ro \
|
docker run --rm -d --name ${container_name} \
|
||||||
-v "$TLS_KEY":/certs/privkey.pem:ro \
|
--env-file ab-openldap.params \
|
||||||
-v "$TLS_CHAIN":/certs/chain.pem:ro \
|
-v "$MY_LDIF":/etc/openldap/customLDIF \
|
||||||
-p 389:389 -p 636:636 \
|
-v "$TLS_CERT":/certs/fullchain.pem:ro \
|
||||||
docker.asifbacchus.app/ldap/ab-openldap:latest
|
-v "$TLS_KEY":/certs/privkey.pem:ro \
|
||||||
|
-v "$TLS_CHAIN":/certs/chain.pem:ro \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest
|
||||||
|
else
|
||||||
|
docker run --rm -d --name ${container_name} \
|
||||||
|
--env-file ab-openldap.params \
|
||||||
|
-v "$TLS_CERT":/certs/fullchain.pem:ro \
|
||||||
|
-v "$TLS_KEY":/certs/privkey.pem:ro \
|
||||||
|
-v "$TLS_CHAIN":/certs/chain.pem:ro \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
docker run -d --name ${container_name} \
|
if [ -d "$MY_LDIF" ]; then
|
||||||
--env-file ab-openldap.params \
|
# bind-mount custom LDIFs if specified
|
||||||
-v "$TLS_CERT":/certs/fullchain.pem:ro \
|
docker run -d --name ${container_name} \
|
||||||
-v "$TLS_KEY":/certs/privkey.pem:ro \
|
--env-file ab-openldap.params \
|
||||||
-v "$TLS_CHAIN":/certs/chain.pem:ro \
|
-v "$MY_LDIF":/etc/openldap/customLDIF \
|
||||||
-p 389:389 -p 636:636 \
|
-v "$TLS_CERT":/certs/fullchain.pem:ro \
|
||||||
--restart unless-stopped \
|
-v "$TLS_KEY":/certs/privkey.pem:ro \
|
||||||
docker.asifbacchus.app/ldap/ab-openldap:latest
|
-v "$TLS_CHAIN":/certs/chain.pem:ro \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
--restart unless-stopped \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest
|
||||||
|
else
|
||||||
|
docker run -d --name ${container_name} \
|
||||||
|
--env-file ab-openldap.params \
|
||||||
|
-v "$TLS_CERT":/certs/fullchain.pem:ro \
|
||||||
|
-v "$TLS_KEY":/certs/privkey.pem:ro \
|
||||||
|
-v "$TLS_CHAIN":/certs/chain.pem:ro \
|
||||||
|
-p 389:389 -p 636:636 \
|
||||||
|
--restart unless-stopped \
|
||||||
|
docker.asifbacchus.app/ldap/ab-openldap:latest
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user