Skip to content

Commit

Permalink
Add some additional configs for easier testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ViViDboarder committed May 21, 2021
1 parent 2f6ecc6 commit adf460c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ check-version:
clean:
rm -f ./target

.PHONY: docker-build-all
docker-build-all: docker-build docker-build-alpine

.PHONY: docker-build
docker-build:
docker build -f ./Dockerfile -t $(DOCKER_TAG) .
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ From there you can set up your test group and users.
docker-compose up ldap_sync
```

Alternately, you can bootstrap some of this by running:

docker-compose -f docker-compose.yml -f itest/docker-compose.itest.yml up

## Future

* Any kind of proper logging
Expand Down
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ services:

ldap:
image: osixia/openldap
ports:
- 389:389
- 636:636
volumes:
- /var/lib/ldap
- /etc/ldap/slapd.d
Expand Down
53 changes: 53 additions & 0 deletions itest/50-seed-user.ldif
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# LDIF Export for cn=Users,dc=example,dc=org
# Server: ldap (ldap)
# Search Scope: sub
# Search Filter: (objectClass=*)
# Total Entries: 2
#
# Generated by phpLDAPadmin (http://phpldapadmin.sourceforge.net) on May 4, 2021 6:06 pm
# Version: 1.2.5

version: 1

# Entry 1: cn=Users,dc=example,dc=org
dn: cn=Users,dc=example,dc=org
cn: Users
gidnumber: 500
objectclass: posixGroup
objectclass: top

# Entry 2: cn=Someone,cn=Users,dc=example,dc=org
dn: cn=Someone,cn=Users,dc=example,dc=org
cn: Someone
gidnumber: 500
homedirectory: /home/users/someone
mail: test@example.com
objectclass: inetOrgPerson
objectclass: posixAccount
objectclass: top
sn: Someone
uid: someone
uidnumber: 1000

# Entry 3: cn=SomeoneNoEmail,cn=Users,dc=example,dc=org
dn: cn=SomeoneNoEmail,cn=Users,dc=example,dc=org
cn: SomeoneNoEmail
gidnumber: 500
homedirectory: /home/users/someonenoemail
objectclass: inetOrgPerson
objectclass: posixAccount
objectclass: top
sn: SomeoneNoEmail
uid: someonenoemail
uidnumber: 1001

# Entry 4: cn=SomeoneNoEmailNoUid,cn=Users,dc=example,dc=org
# dn: cn=SomeoneNoEmailNoUid,cn=Users,dc=example,dc=org
# cn: SomeoneNoEmailNoUid
# gidnumber: 500
# homedirectory: /home/users/someonenoemailnoUid
# objectclass: inetOrgPerson
# objectclass: posixAccount
# objectclass: top
# sn: SomeoneNoEmail
# uidnumber: 1002
11 changes: 11 additions & 0 deletions itest/docker-compose.itest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: '3'
services:
ldap_sync:

vaultwarden:

ldap:
command: ["--copy-service"]
volumes:
- ./itest/50-seed-user.ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom/50-seed-user.ldif

0 comments on commit adf460c

Please sign in to comment.