Skip to content

Commit 5f04322

Browse files
committed
fixes #37
1 parent cda21b8 commit 5f04322

File tree

8 files changed

+13
-7
lines changed

8 files changed

+13
-7
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ This helps to keep your container configuration secret. If you don't care all en
233233
Required and used for new ldap server only:
234234
- **LDAP_ORGANISATION**: Organisation name. Defaults to `Example Inc.`
235235
- **LDAP_DOMAIN**: Ldap domain. Defaults to `example.org`
236+
- **LDAP_BASE_DN**: Ldap base DN. If empty automatically set from LDAP_DOMAIN value. Defaults to `(empty)`
236237
- **LDAP_ADMIN_PASSWORD** Ldap Admin password. Defaults to `admin`
237238
- **LDAP_CONFIG_PASSWORD** Ldap Config password. Defaults to `config`
238239

β€Žimage/environment/default.yaml.startupβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# Required and used for new ldap server only
1010
LDAP_ORGANISATION: Example Inc.
1111
LDAP_DOMAIN: example.org
12+
LDAP_BASE_DN: #if empty automatically set from LDAP_DOMAIN
13+
1214
LDAP_ADMIN_PASSWORD: admin
1315
LDAP_CONFIG_PASSWORD: config
1416

β€Žimage/service/slapd/startup.shβ€Ž

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ if [ ! -e "$FIRST_START_DONE" ]; then
2929
# Helpers
3030
#
3131
function get_ldap_base_dn() {
32-
LDAP_BASE_DN=""
33-
IFS='.' read -ra LDAP_BASE_DN_TABLE <<< "$LDAP_DOMAIN"
34-
for i in "${LDAP_BASE_DN_TABLE[@]}"; do
35-
EXT="dc=$i,"
36-
LDAP_BASE_DN=$LDAP_BASE_DN$EXT
37-
done
32+
# if LDAP_BASE_DN is empty set value from LDAP_DOMAIN
33+
if [ -z "$LDAP_BASE_DN" ]; then
34+
IFS='.' read -ra LDAP_BASE_DN_TABLE <<< "$LDAP_DOMAIN"
35+
for i in "${LDAP_BASE_DN_TABLE[@]}"; do
36+
EXT="dc=$i,"
37+
LDAP_BASE_DN=$LDAP_BASE_DN$EXT
38+
done
39+
40+
LDAP_BASE_DN=${LDAP_BASE_DN::-1}
41+
fi
3842

39-
LDAP_BASE_DN=${LDAP_BASE_DN::-1}
4043
}
4144

4245
function is_new_schema() {

β€Žtest/database/__db.001β€Ž

0 Bytes
Binary file not shown.

β€Žtest/database/__db.002β€Ž

0 Bytes
Binary file not shown.

β€Žtest/database/__db.003β€Ž

0 Bytes
Binary file not shown.

β€Žtest/database/alockβ€Ž

0 Bytes
Binary file not shown.

β€Žtest/database/log.0000000001β€Ž

0 Bytes
Binary file not shown.

0 commit comments

Comments
Β (0)