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
ddc52042
Commit
ddc52042
authored
Feb 18, 2015
by
Christian Luginbühl
Browse files
Escaped characters in password hash, so sed doesn't crash anymore
parent
9d170851
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Dockerfile
Dockerfile
+1
-1
README.md
README.md
+1
-1
entrypoint.sh
entrypoint.sh
+3
-3
No files found.
Dockerfile
View file @
ddc52042
...
...
@@ -14,7 +14,7 @@ RUN apt-get update && \
EXPOSE
389
VOLUME
["/var/lib/ldap"]
VOLUME
["/var/lib/ldap"
, "/etc/ldap"
]
COPY
entrypoint.sh /entrypoint.sh
...
...
README.md
View file @
ddc52042
...
...
@@ -2,7 +2,7 @@ docker-openldap
===============
A Docker image running OpenLDAP on Debian stable ("wheezy" at the moment). The
Dockerfile is inspired by
the well written one from
Dockerfile is inspired by
[
cnry/openldap
](
https://registry.hub.docker.com/u/cnry/openldap/
)
, but as said
before, running a stable Debian and be a little less verbose, but more complete
in the configuration.
...
...
entrypoint.sh
View file @
ddc52042
...
...
@@ -22,8 +22,6 @@ if [[ ! -f /etc/ldap/docker-configured ]]; then
slapd slapd/no_configuration boolean false
slapd slapd/password1 password
$SLAPD_PASSWORD
slapd slapd/password2 password
$SLAPD_PASSWORD
slapd slapd/internal/adminpw string
$SLAPD_PASSWORD
slapd slapd/internal/generated_adminpw password
$SLAPD_PASSWORD
slapd shared/organization string
$SLAPD_ORGANIZATION
slapd slapd/domain string
$SLAPD_DOMAIN
slapd slapd/backend select hdb
...
...
@@ -49,8 +47,10 @@ EOF
if
[[
-n
"
$SLAPD_CONFIG_PASSWORD
"
]]
;
then
password_hash
=
`
slappasswd
-s
"
${
SLAPD_CONFIG_PASSWORD
}
"
`
sed_safe_password_hash
=
${
password_hash
/\//\\\/
}
slapcat
-n0
-F
/etc/ldap/slapd.d
-l
/tmp/config.ldif
sed
-i
"s/
\(
olcRootDN: cn=admin,cn=config
\)
/
\1\n
olcRootPW:
${
password_hash
}
/g"
/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
...
...
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