Add accesslog, make debug value configurable

This commit is contained in:
Deon George 2023-05-20 10:37:22 +10:00
parent 1df1e8d5cd
commit 50029a4c28
3 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,7 @@ FROM alpine
# Change to http respositories, so they we can cache the install packages # Change to http respositories, so they we can cache the install packages
RUN if [ -n ${HTTP_PROXY} ] ; then sed -i -e s'/https/http/' /etc/apk/repositories; fi RUN if [ -n ${HTTP_PROXY} ] ; then sed -i -e s'/https/http/' /etc/apk/repositories; fi
RUN apk add --no-cache bash openldap openldap-back-mdb openldap-clients openldap-overlay-syncprov RUN apk add --no-cache bash openldap openldap-back-mdb openldap-clients openldap-overlay-syncprov openldap-overlay-accesslog
ADD acl*.ldif samba.ldif wurley.ldif /etc/openldap/schema/ ADD acl*.ldif samba.ldif wurley.ldif /etc/openldap/schema/
ADD certinfo.ldif syncprov*ldif /etc/openldap/ ADD certinfo.ldif syncprov*ldif /etc/openldap/

3
init
View File

@ -3,6 +3,7 @@ set -e
NAME="OPENLDAP" NAME="OPENLDAP"
SLAPD_CONFIG=${SLAPD_CONFIG:-"/etc/openldap/slapd.d/cn=config"} SLAPD_CONFIG=${SLAPD_CONFIG:-"/etc/openldap/slapd.d/cn=config"}
SLAPD_DEBUG=${SLAPD_DEBUG:-0}
function stop { function stop {
echo "Stopping ${NAME}" echo "Stopping ${NAME}"
@ -21,7 +22,7 @@ trap 'stop' SIGTERM
if [ -z "$@" ]; then if [ -z "$@" ]; then
SLAPD_URLS="ldapi:/// ldap:/// ldaps:///" SLAPD_URLS="ldapi:/// ldap:/// ldaps:///"
SLAPD_OPTIONS="-d 256" SLAPD_OPTIONS="-d ${SLAPD_DEBUG}"
# If /etc/openldap is an external mount point # If /etc/openldap is an external mount point
if mp ${SLAPD_CONFIG}; then if mp ${SLAPD_CONFIG}; then

View File

@ -2,3 +2,4 @@ dn: cn=module{0},cn=config
changetype: modify changetype: modify
add: olcModuleLoad add: olcModuleLoad
olcModuleLoad: syncprov.so olcModuleLoad: syncprov.so
olcModuleLoad: accesslog.so