Skip to content

Commit 32eb22c

Browse files
committed
Merge branch 'release-1.5.0' into stable
2 parents 7dac857 + 1ee0cf7 commit 32eb22c

32 files changed

+1220
-2322
lines changed

CHANGELOG.md

+25-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,30 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.5.0] - 2021-02-19
8+
50M+ docker pulls 🎉🎉🎉 thanks to all contributors 💕
9+
10+
### Added
11+
- Allowing own replication via LDAP_REPLICATION=own #535. Thanks to @sistason !
12+
- Seeding from internal path is now complete. #361. Thanks to @dbck !
13+
14+
### Changed
15+
- Update openldap 2.4.50 to 2.4.57
16+
- Upgrade baseimage to light-baseimage:1.3.2. Thanks to @heidemn !
17+
- Replace mail.schema for postfix-book.schema #450. Thanks to @vivacarvajalito !
18+
- Replace zarafa.schema for kopano.schema
19+
20+
### Removed
21+
- mmc schemas (dhcp.schema, dnszone.schema, mail.schema, mmc.schema, quota.schema) and radius.schema
22+
23+
### Fixed
24+
- Few small typos #536. Thanks to @timgates42 !
25+
- Out of date api in the using-secrets kubernetes yaml #527. Thanks to @joshuacox !
26+
- Custom ldap file and schema #481. Thanks to @Os-carsun !
27+
728
## [1.4.0] - 2020-06-15
829
30M+ docker pulls 🎉🎉🎉 thanks to all contributors 💕
30+
931
### Added
1032
- Allow setting ports on ldap and ldaps #403. Thanks to @chirauki !
1133
- Address firewall issues on RHEL in README #394. Thanks to @BirkhoffLee !
@@ -14,7 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1436
- Seeding from internal path. #361. Thanks to @dbck !
1537
- Enable openldap uid/gid to be specified at runtime #336. Thanks to @lj020326 !
1638

17-
### Changes
39+
### Changed
1840
- Update openldap 2.4.48 to 2.4.50
1941
- LDAP_TLS_PROTOCOL_MIN is deprecated #432. Thanks to @mettacrawler !
2042
- Better handling of environment variables checks #382. Thanks to @obourdon !
@@ -27,7 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2749
### Added
2850
- Multiarch support
2951

30-
### Changes
52+
### Changed
3153
- Update openldap 2.4.47 to 2.4.48 #247
3254
- Upgrade baseimage to light-baseimage:1.2.0 (debian buster)
3355

@@ -271,6 +293,7 @@ Environment variable LDAP_REPLICATION_HDB_SYNCPROV changed to LDAP_REPLICATION_D
271293
## [0.10.0] - 2015-03-03
272294
New version initial release, no changelog before this sorry.
273295

296+
[1.5.0]: https://github.com/osixia/docker-openldap/compare/v1.4.0...v1.5.0
274297
[1.4.0]: https://github.com/osixia/docker-openldap/compare/v1.3.0...v1.4.0
275298
[1.3.0]: https://github.com/osixia/docker-openldap/compare/v1.2.5...v1.3.0
276299
[1.2.5]: https://github.com/osixia/docker-openldap/compare/v1.2.4...v1.2.5

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = osixia/openldap
2-
VERSION = 1.4.0
2+
VERSION = 1.5.0
33

44
.PHONY: build build-nocache test tag-latest push push-latest release git-tag-version
55

README.md

+35-27
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Docker Stars](https://img.shields.io/docker/stars/osixia/openldap.svg)](https://hub.docker.com/r/osixia/openldap/)
55
[![Layers](https://images.microbadger.com/badges/image/osixia/openldap.svg)](https://hub.docker.com/r/osixia/openldap/)
66

7-
Latest release: 1.4.0 - [OpenLDAP 2.4.50](https://www.openldap.org/software/release/changes.html) - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
7+
Latest release: 1.5.0 - [OpenLDAP 2.4.57](https://www.openldap.org/software/release/changes.html) - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
88

99
**A docker image to run OpenLDAP.**
1010

@@ -39,7 +39,7 @@ Latest release: 1.4.0 - [OpenLDAP 2.4.50](https://www.openldap.org/software/rele
3939
- [Docker Secrets](#docker-secrets)
4040
- [Make your own image or extend this image](#make-your-own-image-or-extend-this-image)
4141
- [Advanced User Guide](#advanced-user-guide)
42-
- [Extend osixia/openldap:1.4.0 image](#extend-osixiaopenldap140-image)
42+
- [Extend osixia/openldap:1.5.0 image](#extend-osixiaopenldap150-image)
4343
- [Make your own openldap image](#make-your-own-openldap-image)
4444
- [Tests](#tests)
4545
- [Kubernetes](#kubernetes)
@@ -60,13 +60,13 @@ If you find this image useful here's how you can help:
6060
Run OpenLDAP docker image:
6161

6262
```sh
63-
docker run --name my-openldap-container --detach osixia/openldap:1.4.0
63+
docker run --name my-openldap-container --detach osixia/openldap:1.5.0
6464
```
6565

6666
Do not forget to add the port mapping for both port 389 and 636 if you wish to access the ldap server from another machine.
6767

6868
```sh
69-
docker run -p 389:389 -p 636:636 --name my-openldap-container --detach osixia/openldap:1.4.0
69+
docker run -p 389:389 -p 636:636 --name my-openldap-container --detach osixia/openldap:1.5.0
7070
```
7171

7272
Either command starts a new container with OpenLDAP running inside. Let's make the first search in our LDAP container:
@@ -109,7 +109,7 @@ docker run \
109109
--env LDAP_ORGANISATION="My Company" \
110110
--env LDAP_DOMAIN="my-company.com" \
111111
--env LDAP_ADMIN_PASSWORD="JonSn0w" \
112-
--detach osixia/openldap:1.4.0
112+
--detach osixia/openldap:1.5.0
113113
```
114114

115115
#### Data persistence
@@ -153,7 +153,7 @@ Do not edit slapd.conf it's not used. To modify your server configuration use ld
153153
#### Seed ldap database with ldif
154154

155155
This image can load ldif files at startup with either `ldapadd` or `ldapmodify`.
156-
Mount `.ldif` in `/container/service/slapd/assets/config/bootstrap/ldif` directory if you want to overwrite image default boostrap ldif files or in `/container/service/slapd/assets/config/bootstrap/ldif/custom` (recommended) to extend image config.
156+
Mount `.ldif` in `/container/service/slapd/assets/config/bootstrap/ldif` directory if you want to overwrite image default bootstrap ldif files or in `/container/service/slapd/assets/config/bootstrap/ldif/custom` (recommended) to extend image config.
157157

158158
Files containing `changeType:` attributes will be loaded with `ldapmodify`.
159159

@@ -174,24 +174,24 @@ argument to entrypoint if you don't want to overwrite them.
174174
# single file example:
175175
docker run \
176176
--volume ./bootstrap.ldif:/container/service/slapd/assets/config/bootstrap/ldif/50-bootstrap.ldif \
177-
osixia/openldap:1.4.0 --copy-service
177+
osixia/openldap:1.5.0 --copy-service
178178

179179
# directory example:
180180
docker run \
181181
--volume ./ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom \
182-
osixia/openldap:1.4.0 --copy-service
182+
osixia/openldap:1.5.0 --copy-service
183183
```
184184

185185
#### Seed from internal path
186186

187-
This image can load ldif and schema files at startup from an internal path. This is useful if a continuous integration service mounts automatically the working copy (sources) into a docker service, which has a relation to the ci job.
187+
This image can load ldif and schema files at startup from an internal path. Additionally, certificates can be copied from an internal path. This is useful if a continuous integration service mounts automatically the working copy (sources) into a docker service, which has a relation to the ci job.
188188

189189
For example: Gitlab is not capable of mounting custom paths into docker services of a ci job, but Gitlab automatically mounts the working copy in every service container. So the working copy (sources) are accessible under `/builds` in every services
190190
of a ci job. The path to the working copy can be obtained via `${CI_PROJECT_DIR}`. See also: https://docs.gitlab.com/runner/executors/docker.html#build-directory-in-service
191191

192192
This may also work with other CI services, if they automatically mount the working directory to the services of a ci job like Gitlab ci does.
193193

194-
In order to seed ldif or schema files from internal path you must set the specific environment variable `LDAP_SEED_INTERNAL_LDIF_PATH` and/or `LDAP_SEED_INTERNAL_SCHEMA_PATH`. If set this will copy any *.ldif or *.schema file into the default seeding
194+
In order to seed ldif or schema files from internal path you must set the specific environment variable `LDAP_SEED_INTERNAL_LDIF_PATH` and/or `LDAP_SEED_INTERNAL_SCHEMA_PATH`. If set this will copy any files in the specified directory into the default seeding
195195
directories of this image.
196196

197197
Example variables defined in gitlab-ci.yml:
@@ -202,6 +202,14 @@ variables:
202202
LDAP_SEED_INTERNAL_SCHEMA_PATH: "${CI_PROJECT_DIR}/docker/openldap/schema"
203203
```
204204
205+
Also, certificates can be used by the internal path. The file, specified in a variable, will be copied in the default certificate directory of this image. If desired, you can use these with the LDAP_TLS_CRT_FILENAME, LDAP_TLS_KEY_FILENAME, LDAP_TLS_CA_CRT_FILENAME and LDAP_TLS_DH_PARAM_FILENAME to set a different filename in the default certificate directory of the image.
206+
207+
variables:
208+
LDAP_SEED_INTERNAL_LDAP_TLS_CRT_FILE: "${CI_PROJECT_DIR}/docker/certificates/certs/cert.pem"
209+
LDAP_SEED_INTERNAL_LDAP_TLS_KEY_FILE: "${CI_PROJECT_DIR}/docker/certificates/certs/key.pem"
210+
LDAP_SEED_INTERNAL_LDAP_TLS_CA_CRT_FILE: "${CI_PROJECT_DIR}/docker/certificates/ca/ca.pem"
211+
LDAP_SEED_INTERNAL_LDAP_TLS_DH_PARAM_FILE: "${CI_PROJECT_DIR}/certificates/dhparam.pem"
212+
205213
### Use an existing ldap database
206214
207215
This can be achieved by mounting host directories as volume.
@@ -213,7 +221,7 @@ simply mount this directories as a volume to `/var/lib/ldap` and `/etc/ldap/slap
213221
docker run \
214222
--volume /data/slapd/database:/var/lib/ldap \
215223
--volume /data/slapd/config:/etc/ldap/slapd.d \
216-
--detach osixia/openldap:1.4.0
224+
--detach osixia/openldap:1.5.0
217225
```
218226

219227
You can also use data volume containers. Please refer to:
@@ -235,7 +243,7 @@ If you are looking for a simple solution to administrate your ldap server you ca
235243
By default, TLS is already configured and enabled, certificate is created using container hostname (it can be set by docker run --hostname option eg: ldap.example.org).
236244

237245
```sh
238-
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.4.0
246+
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.5.0
239247
```
240248

241249
#### Use your own certificate
@@ -249,25 +257,25 @@ docker run \
249257
--env LDAP_TLS_CRT_FILENAME=my-ldap.crt \
250258
--env LDAP_TLS_KEY_FILENAME=my-ldap.key \
251259
--env LDAP_TLS_CA_CRT_FILENAME=the-ca.crt \
252-
--detach osixia/openldap:1.4.0
260+
--detach osixia/openldap:1.5.0
253261
```
254262

255263
Other solutions are available please refer to the [Advanced User Guide](#advanced-user-guide)
256264

257265
#### Disable TLS
258266
Add --env LDAP_TLS=false to the run command:
259267

260-
docker run --env LDAP_TLS=false --detach osixia/openldap:1.4.0
268+
docker run --env LDAP_TLS=false --detach osixia/openldap:1.5.0
261269

262270
### Multi master replication
263271
Quick example, with the default config.
264272

265273
#Create the first ldap server, save the container id in LDAP_CID and get its IP:
266-
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.4.0)
274+
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.5.0)
267275
LDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP_CID)
268276

269277
#Create the second ldap server, save the container id in LDAP2_CID and get its IP:
270-
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.4.0)
278+
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.5.0)
271279
LDAP2_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP2_CID)
272280

273281
#Add the pair "ip hostname" to /etc/hosts on each containers,
@@ -303,7 +311,7 @@ You may have some problems with mounted files on some systems. The startup scrip
303311

304312
To fix that run the container with `--copy-service` argument :
305313

306-
docker run [your options] osixia/openldap:1.4.0 --copy-service
314+
docker run [your options] osixia/openldap:1.5.0 --copy-service
307315

308316
### Debug
309317

@@ -313,13 +321,13 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
313321
Example command to run the container in `debug` mode:
314322

315323
```sh
316-
docker run --detach osixia/openldap:1.4.0 --loglevel debug
324+
docker run --detach osixia/openldap:1.5.0 --loglevel debug
317325
```
318326

319327
See all command line options:
320328

321329
```sh
322-
docker run osixia/openldap:1.4.0 --help
330+
docker run osixia/openldap:1.5.0 --help
323331
```
324332

325333
## Environment Variables
@@ -372,7 +380,7 @@ TLS options:
372380
Help: https://www.openldap.org/doc/admin24/tls.html
373381

374382
Replication options:
375-
- **LDAP_REPLICATION**: Add openldap replication capabilities. Defaults to `false`
383+
- **LDAP_REPLICATION**: Add openldap replication capabilities. Possible values : `true`, `false`, `own`. Defaults to `false`. Setting this to `own` allow to provide own replication settings via custom bootstrap ldifs.
376384

377385
- **LDAP_REPLICATION_CONFIG_SYNCPROV**: olcSyncRepl options used for the config database. Without **rid** and **provider** which are automatically added based on LDAP_REPLICATION_HOSTS. Defaults to `binddn="cn=admin,cn=config" bindmethod=simple credentials=$LDAP_CONFIG_PASSWORD searchbase="cn=config" type=refreshAndPersist retry="60 +" timeout=1 starttls=critical`
378386

@@ -386,14 +394,14 @@ Replication options:
386394

387395
If you want to set this variable at docker run command add the tag `#PYTHON2BASH:` and convert the yaml in python:
388396

389-
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.4.0
397+
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.5.0
390398

391399
To convert yaml to python online: https://yaml-online-parser.appspot.com/
392400

393401
Other environment variables:
394402
- **KEEP_EXISTING_CONFIG**: Do not change the ldap config. Defaults to `false`
395403
- if set to *true* with an existing database, config will remain unchanged. Image tls and replication config will not be run. The container can be started with LDAP_ADMIN_PASSWORD and LDAP_CONFIG_PASSWORD empty or filled with fake data.
396-
- if set to *true* when bootstrapping a new database, bootstap ldif and schema will not be added and tls and replication config will not be run.
404+
- if set to *true* when bootstrapping a new database, bootstrap ldif and schema will not be added and tls and replication config will not be run.
397405

398406
- **LDAP_REMOVE_CONFIG_AFTER_SETUP**: delete config folder after setup. Defaults to `true`
399407
- **LDAP_SSL_HELPER_PREFIX**: ssl-helper environment variables prefix. Defaults to `ldap`, ssl-helper first search config from LDAP_SSL_HELPER_* variables, before SSL_HELPER_* variables.
@@ -413,7 +421,7 @@ docker run \
413421
--env LDAP_ORGANISATION="My company" \
414422
--env LDAP_DOMAIN="my-company.com" \
415423
--env LDAP_ADMIN_PASSWORD="JonSn0w" \
416-
--detach osixia/openldap:1.4.0
424+
--detach osixia/openldap:1.5.0
417425
```
418426

419427
Be aware that environment variable added in command line will be available at any time
@@ -427,7 +435,7 @@ For example if your environment files **my-env.yaml** and **my-env.startup.yaml*
427435
```sh
428436
docker run \
429437
--volume /data/ldap/environment:/container/environment/01-custom \
430-
--detach osixia/openldap:1.4.0
438+
--detach osixia/openldap:1.5.0
431439
```
432440

433441
Take care to link your environment files folder to `/container/environment/XX-somedir` (with XX < 99 so they will be processed before default environment files) and not directly to `/container/environment` because this directory contains predefined baseimage environment files to fix container environment (INITRD, LANG, LANGUAGE and LC_CTYPE).
@@ -437,7 +445,7 @@ Note: the container will try to delete the **\*.startup.yaml** file after the en
437445
```sh
438446
docker run \
439447
--volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
440-
--detach osixia/openldap:1.4.0
448+
--detach osixia/openldap:1.5.0
441449
```
442450

443451
#### Docker Secrets
@@ -463,14 +471,14 @@ This is the best solution if you have a private registry. Please refer to the [A
463471

464472
## Advanced User Guide
465473

466-
### Extend osixia/openldap:1.4.0 image
474+
### Extend osixia/openldap:1.5.0 image
467475

468476
If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image.
469477

470478
Dockerfile example:
471479

472480
```dockerfile
473-
FROM osixia/openldap:1.4.0
481+
FROM osixia/openldap:1.5.0
474482
LABEL maintainer="Your Name <[email protected]>"
475483
476484
ADD bootstrap /container/service/slapd/assets/config/bootstrap

example/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '2'
22
services:
33
openldap:
4-
image: osixia/openldap:1.4.0
4+
image: osixia/openldap:1.5.0
55
container_name: openldap
66
environment:
77
LDAP_LOG_LEVEL: "256"

example/extend-osixia-openldap/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM osixia/openldap:1.4.0
1+
FROM osixia/openldap:1.5.0
22
MAINTAINER Your Name <[email protected]>
33

44
ADD bootstrap /container/service/slapd/assets/config/bootstrap

example/kubernetes/simple/ldap-deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
spec:
1717
containers:
1818
- name: ldap
19-
image: osixia/openldap:1.4.0
19+
image: osixia/openldap:1.5.0
2020
volumeMounts:
2121
- name: ldap-data
2222
mountPath: /var/lib/ldap
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
ldap-secret.yaml
2+
ldap-deployment.yaml

example/kubernetes/using-secrets/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ ldap-secret.yaml: example
55
ENV_STARTUP_YAML=$(shell ${ENV_DIR}/file-to-base64.sh ${ENV_DIR}/my-env.startup.yaml) \
66
envsubst < ldap-secret.tpl > ldap-secret.yaml
77

8-
example: environment/my-env.startup.yaml environment/my-env.yaml
8+
example: environment/my-env.startup.yaml environment/my-env.yaml ldap-deployment.yaml
99

1010
environment/my-env.startup.yaml:
1111
cd environment ; cp my-env.startup.yaml.example my-env.startup.yaml
1212

1313
environment/my-env.yaml:
1414
cd environment ; cp my-env.yaml.example my-env.yaml
15+
16+
ldap-deployment.yaml:
17+
cp ldap-deployment.yaml.example ldap-deployment.yaml
+23-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1+
# Helm-chart
2+
3+
After setting the variables you can get strange variables like:
4+
5+
https://github.com/osixia/docker-openldap/issues/342
6+
7+
I have found that using this helm chart does not have those issues:
8+
9+
https://github.com/jp-gouin/helm-openldap.git
10+
111
# Generating ldap-secret.yaml
212

313
`make example`
414

5-
Then edit the yaml files in the environment directory to have the desired paraneters, and then make the secret file:
15+
Then edit the yaml files in the environment directory to have the desired parameters, and then make the secret file:
616

717
`make ldap-secret.yaml`
18+
19+
And deploy the secret you just made:
20+
21+
`kubectl apply -f ldap-secret.yaml`
22+
23+
Apply the deployment yaml for ldap in k8s:
24+
25+
`kubectl apply -f ldap-deployment.yaml`
26+
27+
Finally apply the service yaml for ldap in k8s:
28+
29+
`kubectl apply -f ldap-service.yaml`

example/kubernetes/using-secrets/gce-statefullset.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
spec:
1313
containers:
1414
- name: azaldap
15-
image: osixia/openldap:1.4.0
15+
image: osixia/openldap:1.5.0
1616
imagePullPolicy: IfNotPresent
1717
#command: ["/bin/bash","-c","while [ 1 = 1 ] ; do sleep 1; date; done"]
1818
ports:

0 commit comments

Comments
 (0)