Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ RUN apt-get update \
# ADD bootstrap files
ADD ./bootstrap /bootstrap

ARG CERT_SAN

# Initialize LDAP with data
RUN /bin/bash /bootstrap/slapd-init.sh

Expand Down
3 changes: 3 additions & 0 deletions bootstrap/slapd-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ readonly LDAP_SECRET=GoodNewsEveryone
readonly LDAP_SSL_KEY="/etc/ldap/ssl/ldap.key"
readonly LDAP_SSL_CERT="/etc/ldap/ssl/ldap.crt"

readonly CERT_SAN="${CERT_SAN:-DNS:${LDAP_DOMAIN}}"


reconfigure_slapd() {
echo "Reconfigure slapd..."
Expand All @@ -38,6 +40,7 @@ EOL
make_snakeoil_certificate() {
echo "Make snakeoil certificate for ${LDAP_DOMAIN}..."
openssl req -subj "/CN=${LDAP_DOMAIN}" \
-addext "subjectAltName = ${CERT_SAN}" \
-new \
-newkey rsa:2048 \
-days 365 \
Expand Down