Skip to content

Commit 2c073b2

Browse files
committed
Make it work with OpenLDAP 1.5.0
1 parent 4e534b3 commit 2c073b2

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

spec/acceptance/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '2'
2-
31
networks:
42
ldap-network:
53
internal: true

spec/acceptance/ldap-server/env/default.startup.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ LDAP_READONLY_USER_PASSWORD: readonly
2121
LDAP_RFC2307BIS_SCHEMA: false
2222

2323
# Backend
24-
LDAP_BACKEND: hdb
24+
LDAP_BACKEND: mdb
2525

2626
# Tls
2727
LDAP_TLS: true
2828
LDAP_TLS_CRT_FILENAME: ldap.crt
2929
LDAP_TLS_KEY_FILENAME: ldap.key
3030
LDAP_TLS_CA_CRT_FILENAME: ca.crt
31+
LDAP_TLS_DH_PARAM_FILENAME: dhparam.pem
3132

3233
LDAP_TLS_ENFORCE: true
3334
LDAP_TLS_CIPHER_SUITE: SECURE256:+SECURE128:-VERS-TLS-ALL:+VERS-TLS1.2:-RSA:-DHE-DSS:-CAMELLIA-128-CBC:-CAMELLIA-256-CBC

spec/acceptance/ldap-server/ldif/data/99-bind-account/emmy.ldif

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ objectClass: simpleSecurityObject
88
uid: emmy
99
userpassword: kittens
1010

11-
dn: olcDatabase={1}hdb,cn=config
11+
dn: olcDatabase={1}mdb,cn=config
1212
changetype: modify
1313
delete: olcAccess
1414
-

spec/acceptance/ldap-server/run-server.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,28 @@ cp /acceptance/ca/intermediate/certs/ca-chain.cert.pem /container/service/slapd/
3737
cp /acceptance/ldap-server/tls/dhparam.pem /container/service/slapd/assets/certs/dhparam.pem
3838
chown -R root:root /container/service/slapd/assets/certs
3939

40-
# Pre-install our configuration environment
41-
rm -f /container/environment/99-default/*.yaml
42-
cp /acceptance/ldap-server/env/*.yaml /container/environment/99-default
40+
# Pre-install our configuration environment.
41+
# Drop our overrides into a lexically earlier directory than the image's stock
42+
# /container/environment/99-default. osixia's run tool walks /container/environment
43+
# in sorted order and first-set-wins (see /container/tool/run), so values declared
44+
# here take precedence while everything we *don't* override (LDAP_PORT, LDAPS_PORT,
45+
# LDAP_NOFILE, DISABLE_CHOWN, etc.) is inherited from the image defaults.
46+
mkdir -p /container/environment/01-custom
47+
cp /acceptance/ldap-server/env/*.yaml /container/environment/01-custom/
4348

4449
# Pre-install our schema (after killing most of the defaults from the container)
4550
rm -f /container/service/slapd/assets/config/bootstrap/ldif/0[345]*.ldif
4651
rm -rf /container/service/slapd/assets/config/bootstrap/schema/mmc
47-
rm -f /etc/ldap/schema/*
52+
# Only remove stock *.ldif schemas; keep *.schema files because osixia/openldap:1.5.0's
53+
# bootstrap (slaptest) converts *.schema -> cn=config and needs core.schema to exist.
54+
rm -f /etc/ldap/schema/*.ldif
4855
cp /acceptance/ldap-server/schema/* /etc/ldap/schema/
4956
cp /acceptance/ldap-server/ldif/bootstrap/*.ldif /container/service/slapd/assets/config/bootstrap/ldif
5057

5158
# Launch openldap
52-
nohup /usr/bin/python -u /container/tool/run -l info &
59+
# /container/tool/run has its own `#!/usr/bin/python3 -u` shebang in osixia/openldap:1.5.0,
60+
# which no longer ships /usr/bin/python. Invoke it directly so we don't depend on Py2 paths.
61+
nohup /container/tool/run -l info &
5362
OPENLDAP_PID=$!
5463

5564
# Wait for the process to be running and connectable

0 commit comments

Comments
 (0)