From dd670713e6efc1fc3b62b3fa89c5f605da3baa40 Mon Sep 17 00:00:00 2001 From: Marisa Date: Tue, 2 Dec 2025 12:29:44 -0500 Subject: [PATCH] Upload files to "/" --- entrypoint.sh | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6d61d24..0ef6ab3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -euo pipefail +#set -euo pipefail # Fix permissions chown -R openldap:openldap /var/lib/ldap /etc/ldap/slapd.d /etc/ldap/certs 2>/dev/null || true @@ -75,13 +75,22 @@ homeDirectory: /home/marisa gecos: Marisa Kirisame EOF + echo "--> Adding base structure" ldapadd -c -x -D "cn=admin,dc=example,dc=com" -w admin -f /tmp/base.ldif || true +#ADMIN_DN="cn=admin,${LDAP_BASE_DN}" +#ADMIN_PW="admin" +#slappasswd -h '{SSHA}' -s MarisaNewPass2025 | \ +#ldapmodify -x -D "$ADMIN_DN" -w "$ADMIN_PW" >/dev/null 2>&1 +#if [ $? -ne 0 ]; then +# echo "--> CRITICAL ERROR: Failed to set Marisa's password with Admin credentials. Check ACLs or admin password." +#fi + # Set a hardcoded password for Marisa to enable tests on the user -echo "--> Setting Marisa password to 'MarisaNewPass2025'" -slappasswd -h '{SSHA}' -s MarisaNewPass2025 | \ -ldapmodify -Y EXTERNAL -H ldapi:/// >/dev/null 2>&1 || true +#echo "--> Setting Marisa password to 'MarisaNewPass2025'" +#slappasswd -h '{SSHA}' -s MarisaNewPass2025 | \ +#ldapmodify -Y EXTERNAL -H ldapi:/// >/dev/null 2>&1 || true #────────────────────────────────────────────────────────────── # TLS BLOCK @@ -146,6 +155,16 @@ else export LDAPTLS_CACERT=/etc/ldap/certs/ca-cert.pem fi +# Set a hardcoded password for Marisa to enable tests on the user +echo "--> Setting Marisa password to 'MarisaNewPass2025' using Admin Bind" + +# Define your Admin DN and Password from the Dockerfile +ADMIN_DN="cn=admin,${LDAP_BASE_DN}" +ADMIN_PW="admin" + +slappasswd -h '{SSHA}' -s MarisaNewPass2025 | \ +ldapmodify -x -D "$ADMIN_DN" -w "$ADMIN_PW" >/dev/null 2>&1 + # Kill temporary slapd kill $SLAPD_PID 2>/dev/null || true wait $SLAPD_PID 2>/dev/null || true @@ -157,7 +176,7 @@ SLAPD_PID=$! # Start Apache in background echo "--> Starting Apache + PHP (background)" -apache2ctl -D FOREGROUND > /var/log/apache2/docker.log 2>&1 & +/usr/sbin/apache2ctl -D FOREGROUND & APACHE_PID=$! # Victory message @@ -172,3 +191,4 @@ trap 'echo "Stopping services..."; kill $SLAPD_PID $APACHE_PID 2>/dev/null; wait # Give you your interactive shell — forever exec "$@" +