Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
libre
docker-openldap
Commits
d7beb4a7
Commit
d7beb4a7
authored
Feb 19, 2015
by
Christian Luginbühl
Browse files
Added possibility to load additional schemas
parent
59c1d03b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
README.md
README.md
+10
-0
entrypoint.sh
entrypoint.sh
+9
-3
No files found.
README.md
View file @
d7beb4a7
...
...
@@ -61,6 +61,16 @@ allows password protected access to the `dn=config` branch. This helps to
reconfigure the server without interruption (read the
[
official documentation
](
http://www.openldap.org/doc/admin24/guide.html#Configuring%20slapd
)
).
One can load additional schemas provided in the
`slapd`
package that are not
installed using the
SLAPD_ADDITIONAL_SCHEMAS
environment variable with comma-separated enties. As of writing these
instructions, there are the following additional schemas available:
`collective`
,
`corba`
,
`duaconf`
,
`dyngroup`
,
`java`
,
`misc`
,
`openldap`
,
`pmi`
and
`ppolicy`
.
After the first start of the image (and the initial configuration), these
envirnonment variables are not evaluated anymore.
...
...
entrypoint.sh
View file @
d7beb4a7
...
...
@@ -50,19 +50,25 @@ EOF
sed
-i
"s/^#BASE.*/
${
base_string
}
/g"
/etc/ldap/ldap.conf
if
[[
-n
"
$SLAPD_CONFIG_PASSWORD
"
]]
;
then
if
[[
-n
"
$SLAPD_CONFIG_PASSWORD
"
]]
;
then
password_hash
=
`
slappasswd
-s
"
${
SLAPD_CONFIG_PASSWORD
}
"
`
sed_safe_password_hash
=
${
password_hash
//\//\\\/
}
echo
$sed_safe_password_hash
slapcat
-n0
-F
/etc/ldap/slapd.d
-l
/tmp/config.ldif
sed
-i
"s/
\(
olcRootDN: cn=admin,cn=config
\)
/
\1\n
olcRootPW:
${
sed_safe_password_hash
}
/g"
/tmp/config.ldif
rm
-rf
/etc/ldap/slapd.d/
*
slapadd
-n0
-F
/etc/ldap/slapd.d
-l
/tmp/config.ldif
>
/dev/null 2>&1
fi
if
[[
-n
"
$SLAPD_ADDITIONAL_SCHEMAS
"
]]
;
then
IFS
=
","
;
declare
-a
schemas
=(
$SLAPD_ADDITIONAL_SCHEMAS
)
for
schema
in
"
${
schemas
[@]
}
"
;
do
slapadd
-n0
-F
/etc/ldap/slapd.d
-l
"/etc/ldap/schema/
${
schema
}
.ldif"
>
/dev/null 2>&1
done
fi
mv
/etc/ldap /var/lib/ldap/config
ln
-s
/var/lib/ldap/config /etc/ldap
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment