ofreax 9 lat temu
rodzic
commit
5f043222f8

+ 1 - 0
README.md

@@ -233,6 +233,7 @@ This helps to keep your container configuration secret. If you don't care all en
 Required and used for new ldap server only:
 - **LDAP_ORGANISATION**: Organisation name. Defaults to `Example Inc.`
 - **LDAP_DOMAIN**: Ldap domain. Defaults to `example.org`
+- **LDAP_BASE_DN**: Ldap base DN. If empty automatically set from LDAP_DOMAIN value. Defaults to `(empty)`
 - **LDAP_ADMIN_PASSWORD** Ldap Admin password. Defaults to `admin`
 - **LDAP_CONFIG_PASSWORD** Ldap Config password. Defaults to `config`
 

+ 2 - 0
image/environment/default.yaml.startup

@@ -9,6 +9,8 @@
 # Required and used for new ldap server only
 LDAP_ORGANISATION: Example Inc.
 LDAP_DOMAIN: example.org
+LDAP_BASE_DN: #if empty automatically set from LDAP_DOMAIN
+
 LDAP_ADMIN_PASSWORD: admin
 LDAP_CONFIG_PASSWORD: config
 

+ 10 - 7
image/service/slapd/startup.sh

@@ -29,14 +29,17 @@ if [ ! -e "$FIRST_START_DONE" ]; then
   # Helpers
   #
   function get_ldap_base_dn() {
-    LDAP_BASE_DN=""
-    IFS='.' read -ra LDAP_BASE_DN_TABLE <<< "$LDAP_DOMAIN"
-    for i in "${LDAP_BASE_DN_TABLE[@]}"; do
-      EXT="dc=$i,"
-      LDAP_BASE_DN=$LDAP_BASE_DN$EXT
-    done
+    # if LDAP_BASE_DN is empty set value from LDAP_DOMAIN
+    if [ -z "$LDAP_BASE_DN" ]; then
+      IFS='.' read -ra LDAP_BASE_DN_TABLE <<< "$LDAP_DOMAIN"
+      for i in "${LDAP_BASE_DN_TABLE[@]}"; do
+        EXT="dc=$i,"
+        LDAP_BASE_DN=$LDAP_BASE_DN$EXT
+      done
+
+      LDAP_BASE_DN=${LDAP_BASE_DN::-1}
+    fi
 
-    LDAP_BASE_DN=${LDAP_BASE_DN::-1}
   }
 
   function is_new_schema() {

BIN
test/database/__db.001


BIN
test/database/__db.002


BIN
test/database/__db.003


BIN
test/database/alock


BIN
test/database/log.0000000001