Add some additional configs for easier testing

This commit is contained in:
ViViDboarder 2021-05-20 17:29:45 -07:00
parent 2f6ecc6860
commit adf460c05e
5 changed files with 71 additions and 3 deletions

View File

@ -49,6 +49,9 @@ check-version:
clean: clean:
rm -f ./target rm -f ./target
.PHONY: docker-build-all
docker-build-all: docker-build docker-build-alpine
.PHONY: docker-build .PHONY: docker-build
docker-build: docker-build:
docker build -f ./Dockerfile -t $(DOCKER_TAG) . docker build -f ./Dockerfile -t $(DOCKER_TAG) .

View File

@ -69,6 +69,10 @@ From there you can set up your test group and users.
docker-compose up ldap_sync 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 ## Future
* Any kind of proper logging * Any kind of proper logging

View File

@ -27,9 +27,6 @@ services:
ldap: ldap:
image: osixia/openldap image: osixia/openldap
ports:
- 389:389
- 636:636
volumes: volumes:
- /var/lib/ldap - /var/lib/ldap
- /etc/ldap/slapd.d - /etc/ldap/slapd.d

53
itest/50-seed-user.ldif Normal file
View File

@ -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

View File

@ -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