|
@@ -1,7 +1,9 @@
|
|
#!/bin/sh
|
|
#!/bin/sh
|
|
|
|
|
|
-# Log everything to this log file
|
|
|
|
-#exec &> $ENTRYLOG
|
|
|
|
|
|
+# Log everything to this log file. Use LOG env var or default /var/log/ldap.log
|
|
|
|
+ENTRYLOG=${LOG:-/var/log/ldap.log}
|
|
|
|
+echo Logfile: $ENTRYLOG
|
|
|
|
+exec &> $ENTRYLOG
|
|
|
|
|
|
# Inspired by https://github.com/acobaugh/openldap-alpine
|
|
# Inspired by https://github.com/acobaugh/openldap-alpine
|
|
|
|
|
|
@@ -21,30 +23,18 @@ if [ ! -d '/etc/openldap/slapd.d/cn=config' ]; then
|
|
echo $SLAPD_CONFIG_ROOTPW > /etc/openldap/slapd.d/slapd_config_rootpw
|
|
echo $SLAPD_CONFIG_ROOTPW > /etc/openldap/slapd.d/slapd_config_rootpw
|
|
chmod 400 /etc/openldap/slapd.d/slapd_config_rootpw
|
|
chmod 400 /etc/openldap/slapd.d/slapd_config_rootpw
|
|
|
|
|
|
- # Check if all certificates and keys are present
|
|
|
|
- # if [ ! -f ${SSL_PATH}/slurm.ch-rootCA.crt ] || \
|
|
|
|
- # [ ! -f ${SSL_PATH}/ldap.slurm.ch.crt ] || \
|
|
|
|
- # [ ! -f ${SSL_PATH}/ldap.slurm.ch.key ]; then
|
|
|
|
- # echo "Not all certificates and keys found for TLS."
|
|
|
|
- # exit 1
|
|
|
|
- # fi
|
|
|
|
-
|
|
|
|
# Use the original slapd.conf file
|
|
# Use the original slapd.conf file
|
|
cp /etc/openldap/slapd.conf /tmp/slapd.conf
|
|
cp /etc/openldap/slapd.conf /tmp/slapd.conf
|
|
|
|
|
|
# Set the correct suffix
|
|
# Set the correct suffix
|
|
- #sed -i -e "s/dc=my-domain,dc=com/${SUFFIX}/g" /tmp/slapd.conf
|
|
|
|
- #sed -i -e "/core.schema/a include\t\t/etc/openldap/schema/cosine.schema" /tmp/slapd.conf
|
|
|
|
- #sed -i -e "/cosine.schema/a include\t\t/etc/openldap/schema/inetorgperson.schema" /tmp/slapd.conf
|
|
|
|
|
|
+ sed -i -e "s/dc=my-domain,dc=com/${SUFFIX}/g" /tmp/slapd.conf
|
|
|
|
+
|
|
|
|
+ # Add more schemas
|
|
|
|
+ sed -i -e "/core.schema/a include\t\t/etc/openldap/schema/cosine.schema" /tmp/slapd.conf
|
|
|
|
+ sed -i -e "/cosine.schema/a include\t\t/etc/openldap/schema/inetorgperson.schema" /tmp/slapd.conf
|
|
|
|
|
|
- # Add configuration for TLS and set root password for config database.
|
|
|
|
cat <<-EOF >> /tmp/slapd.conf
|
|
cat <<-EOF >> /tmp/slapd.conf
|
|
|
|
|
|
- #TLSCACertificateFile ${SSL_PATH}/slurm.ch-rootCA.crt
|
|
|
|
- #TLSCertificateFile ${SSL_PATH}/ldap.slurm.ch.crt
|
|
|
|
- #TLSCertificateKeyFile ${SSL_PATH}/ldap.slurm.ch.key
|
|
|
|
- #TLSCipherSuite HIGH:-SSLv2:-SSLv3
|
|
|
|
-
|
|
|
|
#######################################################################
|
|
#######################################################################
|
|
# Dynamic config
|
|
# Dynamic config
|
|
#######################################################################
|
|
#######################################################################
|