https://github.com/eugenmayer/docker-image-ldapexample
A openldap server with a pre-defined example layout for auth and groups with memberOf. Use it for test-setups
https://github.com/eugenmayer/docker-image-ldapexample
ldap openldap-server testing
Last synced: about 2 months ago
JSON representation
A openldap server with a pre-defined example layout for auth and groups with memberOf. Use it for test-setups
- Host: GitHub
- URL: https://github.com/eugenmayer/docker-image-ldapexample
- Owner: EugenMayer
- Created: 2017-09-16T18:14:55.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2025-02-11T14:00:13.000Z (5 months ago)
- Last Synced: 2025-05-07T22:45:38.886Z (about 2 months ago)
- Topics: ldap, openldap-server, testing
- Language: Shell
- Homepage:
- Size: 211 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
[](https://github.com/EugenMayer/docker-image-ldapexample/actions/workflows/build_bitnami.yml)
## WAT
If you need to test-drive your ldap authentication or need a test-server to test your ldap against, this docker-image could be of use. It does come with pre-deployed users and groups, so you can test authentication and filters right away.
## start
Just run
```bash
./start.sh#or
sudo ./tls/generate-tls.sh ldap yes
docker-compose up -d
```You can also run the prebuild images without any mounts
```bash
docker run -p 389:389 ghcr.io/eugenmayer/ldaptestserver:bitnami-type1
#or
docker run -p 389:389 ghcr.io/eugenmayer/ldaptestserver:bitnami-type2
```See the connection details under layout.
## Database layout
Using `docker-compose.yml`, you will have 2 servers started as an example, with 2 slightly different layouts, based on `data-template-type1.ldif` and `data-template-type2.ldif`
Server 1 has the port `10389` and the default domain example.org
- admin user: `cn=admin,dc=example,dc=org`
- admin password: `admin`Server 2 has the port `20389` and the default domain example.org
- admin user: `cn=admin,dc=kontextwork-test,dc=de`
- admin password: `admin`When you see the Users / Groups below, you need to replace the `` with the domain, so either `dc=example,dc=org` or`dc=kontextwork-test,dc=de`
### Type 1 Template
BaseDN is `dc=example,dc=org`.
## Users
- uid=user1id,ou=accounts,ou=base1,,
- uid=user2id,ou=accounts,ou=base1,
- uid=included1id,ou=accounts,ou=base2,
- uid=readonlyid,ou=other accounts,ou=base1,
- uid=userExcludedeid,ou=accounts,ou=base1,Passwords do match the the `uid`, so `user1` for the user `uid=user1,ou=accounts,` and so on.
## Groups
We have two groups
- cn=myservice,ou=groups,ou=base1,
- cn=specialservice,ou=groups,ou=base1,first one with the following members
- uid=user1id,ou=accounts,ou=base1,,
- uid=user2id,ou=accounts,ou=base1,
- uid=included1id,ou=accounts,ou=base2,and second one with
- uid=user1id,ou=accounts,ou=base1,,### Type 2 Template
`` is `dc=kontextwork-test,dc=de`.
#### Users
- uid=included1id,ou=accounts,ou=base1,
- uid=included2id,ou=accounts,ou=base1,
- uid=included3id,ou=accounts,ou=base1,
- uid=readonlyid,ou=other accounts,ou=base1,
- uid=includedMissingMailid,ou=accounts,ou=base1
- uid=excluded1id,ou=accounts,ou=base1,
- uid=excluded2id,ou=accounts,ou=base1,
- uid=included1id,ou=accounts,ou=base2,Passwords do match the the `uid`, so `included1` for the user `uid=included1,ou=accounts,` and so on.
#### Groups
We have groups
- cn=myservice,ou=groupsou=base1,,
- cn=otherservice,ou=groups,ou=base1,
- cn=groupwithinvalid,ou=groups,ou=base1,
- cn=differentservice,ou=groups,ou=base1,
- cn=groupofgroups,ou=groups,ou=base1,with the following members
myservice
- uid=included1id,ou=accounts,ou=base1,
- uid=included2id,ou=accounts,ou=base1,
- uid=included3id,ou=accounts,ou=base1,
- uid=includedMissingMailid,ou=accounts,ou=base1otherservice
- uid=included1id,ou=accounts,ou=base1,differentservice
- uid=included2id,ou=accounts,ou=base1,groupofgroups
- cn=otherservice,ou=groups,ou=base1,
- cn=differentservice,ou=groups,ou=base1,groupwithinvalid
- uid=includedMissingMailid,ou=accounts,ou=base1,## Build
You can build your images using your custom templates, custom password or LDAP_DOMAIN. See the `Dockerfile` included here
and just make it your own, if you like. Also see the templates and see how you can adopt or modify them to your liking.**Important:** If you rely on `memberOf` you should ensure that your users are created before your groups in the ldif,
or memberOf will not work!## Credits
Now-days credits to the once again great docker image of Bitnami [bitnami/openldap](https://hub.docker.com/r/bitnami/openldap) (and in the past, thanks to [osixia/docker-openldap](https://github.com/osixia/docker-openldap))