From 3cdf2241ea32d9872f0660378729670dfb2b254a Mon Sep 17 00:00:00 2001 From: Jonas Resch <32968142+jonas-resch@users.noreply.github.com> Date: Sun, 28 Sep 2025 14:02:06 +0200 Subject: [PATCH] example_configs: Improve bootstrap.sh and documentation for use with Kubernetes (#1245) --- example_configs/bootstrap/bootstrap.md | 31 ++++---------------------- scripts/bootstrap.sh | 4 ++-- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/example_configs/bootstrap/bootstrap.md b/example_configs/bootstrap/bootstrap.md index 503b623..74fa724 100644 --- a/example_configs/bootstrap/bootstrap.md +++ b/example_configs/bootstrap/bootstrap.md @@ -246,14 +246,14 @@ spec: restartPolicy: OnFailure containers: - name: lldap-bootstrap - image: lldap/lldap:v0.5.0 + image: lldap/lldap:latest command: - - /bootstrap/bootstrap.sh + - /app/bootstrap.sh env: - name: LLDAP_URL - value: "http://lldap:8080" + value: "http://lldap:17170" - name: LLDAP_ADMIN_USERNAME valueFrom: { secretKeyRef: { name: lldap-admin-user, key: username } } @@ -265,11 +265,6 @@ spec: value: "true" volumeMounts: - - name: bootstrap - mountPath: /bootstrap/bootstrap.sh - readOnly: true - subPath: bootstrap.sh - - name: user-configs mountPath: /bootstrap/user-configs readOnly: true @@ -279,27 +274,9 @@ spec: readOnly: true volumes: - - name: bootstrap - configMap: - name: bootstrap - defaultMode: 0555 - items: - - key: bootstrap.sh - path: bootstrap.sh - - name: user-configs projected: sources: - - secret: - name: lldap-admin-user - items: - - key: user-config.json - path: admin-config.json - - secret: - name: lldap-password-manager-user - items: - - key: user-config.json - path: password-manager-config.json - secret: name: lldap-bootstrap-configs items: @@ -314,4 +291,4 @@ spec: items: - key: group-configs.json path: group-configs.json -``` +``` \ No newline at end of file diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 260ca16..61048cb 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -710,9 +710,9 @@ main() { redundant_users="$(printf '%s' "$redundant_users" | jq --compact-output --arg id "$id" '. - [$id]')" if [[ "$password_file" != 'null' ]] && [[ "$password_file" != '""' ]]; then - LLDAP_USER_PASSWORD="$(cat $password_file)" "$LLDAP_SET_PASSWORD_PATH" --base-url "$LLDAP_URL" --token "$TOKEN" --username "$id" + "$LLDAP_SET_PASSWORD_PATH" --base-url "$LLDAP_URL" --token "$TOKEN" --username "$id" --password "$(cat $password_file)" elif [[ "$password" != 'null' ]] && [[ "$password" != '""' ]]; then - LLDAP_USER_PASSWORD="$password" "$LLDAP_SET_PASSWORD_PATH" --base-url "$LLDAP_URL" --token "$TOKEN" --username "$id" + "$LLDAP_SET_PASSWORD_PATH" --base-url "$LLDAP_URL" --token "$TOKEN" --username "$id" --password "$password" fi # Process custom attributes