File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed
Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,13 @@ FROM bitnami/openldap:2.6
33ARG TEMPLATE_PATH=./data-template-type1-static.ldif
44ARG CERTS_PATH=./tls/certs
55
6- ARG $ LDAP_ROOT=example.org
6+ ARG LDAP_ROOT=example.org
77
88ENV LDAP_ADMIN_PASSWORD="admin"
99ENV LDAP_ROOT=$LDAP_ROOT
1010ENV BITNAMI_DEBUG=true
11+ ENV LDAP_ADMIN_USER=admin
12+ ENV LDAP_ADMIN_PASSWORD=admin
1113
1214# TLS setup
1315ENV LDAP_ENABLE_TLS=yes
@@ -21,5 +23,15 @@ COPY $CERTS_PATH/tls.key /opt/bitnami/openldap/certs/openldap.key
2123COPY $CERTS_PATH/ca.crt /opt/bitnami/openldap/certs/openldapCA.crt
2224
2325# bootstrap setup
24- COPY $TEMPLATE_PATH /ldifs/50-bootstrap.ldif
25- COPY ./ldif/schema/bitnami/memberOf.ldif /schemas/memberOf.ldif
26+ COPY $TEMPLATE_PATH /ldifs/01-bootstrap.ldif
27+ COPY ./ldif/schema/bitnami/memberOf.ldif /schemas/60-memberOf.ldif
28+
29+ USER root
30+ RUN chown 1001:1001 \
31+ /opt/bitnami/openldap/certs/openldapCA.crt \
32+ /opt/bitnami/openldap/certs/openldap.key \
33+ /opt/bitnami/openldap/certs/openldap.crt \
34+ /ldifs/01-bootstrap.ldif \
35+ /schemas/60-memberOf.ldif \
36+ && chmod 400 /opt/bitnami/openldap/certs/openldap.key
37+ USER 1001
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ services:
3939 LDAP_USERS : ' readonly'
4040 LDAP_PASSWORDS : ' readonly'
4141 LDAP_CONFIG_ADMIN_ENABLED : " yes"
42+ BITNAMI_DEBUG : true
4243# LDAP_ENABLE_PROXYPROTO: "yes"
4344# LDAP_PROXYPROTO_PORT_NUMBER: 30389
4445# LDAP_PROXYPROTO_LDAPS_PORT_NUMBER: 30636
@@ -77,6 +78,7 @@ services:
7778 LDAP_TLS_CERT_FILE : /opt/bitnami/openldap/certs/openldap.crt
7879 LDAP_TLS_KEY_FILE : /opt/bitnami/openldap/certs/openldap.key
7980 LDAP_TLS_CA_FILE : /opt/bitnami/openldap/certs/openldapCA.crt
81+ BITNAMI_DEBUG : true
8082 # ######## LEGACY ############
8183 osixia_ldap1 :
8284 image : osixia/openldap:1.5.0
Original file line number Diff line number Diff line change 2828
2929# Create our SSL directory
3030# in case it doesn't exist
31- sudo rm certs -fr
31+ if [ $DO_CHANGEOWN == " yes" ]; then
32+ sudo rm certs -fr
33+ fi
3234mkdir -p " $SSL_DIR "
3335
3436# Generate our Private Key, CSR and Certificate
@@ -40,8 +42,8 @@ openssl x509 -req -days 1825 -in ${SSL_DIR}/cert.csr -CA ${SSL_DIR}/ca.crt -CAke
4042
4143# this is the user the container runs openldap as
4244if [ $DO_CHANGEOWN == " yes" ]; then
43- chown 1001:1001 $SSL_DIR /*
44- chmod 400 $SSL_DIR /tls.key
45+ sudo chown 1001:1001 $SSL_DIR /*
46+ sudo chmod 400 $SSL_DIR /tls.key
4547fi
4648
4749
You can’t perform that action at this time.
0 commit comments