Upload files to "/"
This commit is contained in:
parent
cd57216148
commit
dd670713e6
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
#set -euo pipefail
|
||||||
|
|
||||||
# Fix permissions
|
# Fix permissions
|
||||||
chown -R openldap:openldap /var/lib/ldap /etc/ldap/slapd.d /etc/ldap/certs 2>/dev/null || true
|
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
|
gecos: Marisa Kirisame
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
echo "--> Adding base structure"
|
echo "--> Adding base structure"
|
||||||
ldapadd -c -x -D "cn=admin,dc=example,dc=com" -w admin -f /tmp/base.ldif || true
|
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
|
# Set a hardcoded password for Marisa to enable tests on the user
|
||||||
echo "--> Setting Marisa password to 'MarisaNewPass2025'"
|
#echo "--> Setting Marisa password to 'MarisaNewPass2025'"
|
||||||
slappasswd -h '{SSHA}' -s MarisaNewPass2025 | \
|
#slappasswd -h '{SSHA}' -s MarisaNewPass2025 | \
|
||||||
ldapmodify -Y EXTERNAL -H ldapi:/// >/dev/null 2>&1 || true
|
#ldapmodify -Y EXTERNAL -H ldapi:/// >/dev/null 2>&1 || true
|
||||||
|
|
||||||
#──────────────────────────────────────────────────────────────
|
#──────────────────────────────────────────────────────────────
|
||||||
# TLS BLOCK
|
# TLS BLOCK
|
||||||
@ -146,6 +155,16 @@ else
|
|||||||
export LDAPTLS_CACERT=/etc/ldap/certs/ca-cert.pem
|
export LDAPTLS_CACERT=/etc/ldap/certs/ca-cert.pem
|
||||||
fi
|
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 temporary slapd
|
||||||
kill $SLAPD_PID 2>/dev/null || true
|
kill $SLAPD_PID 2>/dev/null || true
|
||||||
wait $SLAPD_PID 2>/dev/null || true
|
wait $SLAPD_PID 2>/dev/null || true
|
||||||
@ -157,7 +176,7 @@ SLAPD_PID=$!
|
|||||||
|
|
||||||
# Start Apache in background
|
# Start Apache in background
|
||||||
echo "--> Starting Apache + PHP (background)"
|
echo "--> Starting Apache + PHP (background)"
|
||||||
apache2ctl -D FOREGROUND > /var/log/apache2/docker.log 2>&1 &
|
/usr/sbin/apache2ctl -D FOREGROUND &
|
||||||
APACHE_PID=$!
|
APACHE_PID=$!
|
||||||
|
|
||||||
# Victory message
|
# 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
|
# Give you your interactive shell — forever
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user