Skip to content

Commit 3aced04

Browse files
committed
enh(389ds): add ldap container with test data
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 5a0385a commit 3aced04

File tree

3 files changed

+107
-0
lines changed

3 files changed

+107
-0
lines changed

user_saml-dirsrv/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM quay.io/389ds/dirsrv:latest
2+
3+
ENV DS_DM_PASSWORD admin
4+
ENV DS_SUFFIX_NAME dc=idptestbed
5+
6+
ADD conf/* /var/opt/
7+
8+
RUN rm -Rf /data/*
9+
RUN /usr/libexec/dirsrv/dscontainer -r & \
10+
sleep 60; \
11+
WAIT_TIME=60; \
12+
while : ; do \
13+
if /usr/libexec/dirsrv/dscontainer -H; then \
14+
break; \
15+
fi; \
16+
sleep 5; \
17+
WAIT_TIME=$((WAIT_TIME + 5)); \
18+
if [ ${WAIT_TIME} -gt 180 ]; then \
19+
echo "dirsrv not ready – giving up checking after 3min"; \
20+
exit 3 ;\
21+
fi; \
22+
done; \
23+
dsconf localhost backend create --suffix dc=idptestbed --be-name ci_root; \
24+
mv /var/opt/98nextcloud-schema.ldif /etc/dirsrv/slapd-localhost/schema/; \
25+
dsconf localhost schema reload; \
26+
dsconf localhost backend import "dc=idptestbed" /var/opt/entries.ldif; \
27+
rm /var/opt/entries.ldif;
28+
29+
EXPOSE 3389
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
dn: cn=schema
2+
objectClass: top
3+
objectClass: ldapSubentry
4+
objectClass: subschema
5+
cn: schema
6+
aci: (target="ldap:///cn=schema")(targetattr !="aci")(version 3.0;acl "anonymous, no acis"; allow (read, search, compare) userdn = "ldap:///anyone";)
7+
modifiersName: cn=Directory Manager
8+
modifyTimestamp: 20230412120423Z
9+
objectClasses: ( 1.3.6.1.4.1.49213.1.2.1 NAME 'nextcloudUser' AUXILIARY MUST cn MAY (nextcloudEnabled $ nextcloudQuota ) X-ORIGIN 'user defined' )
10+
objectClasses: ( 1.3.6.1.4.1.49213.1.2.2 NAME 'nextcloudGroup' AUXILIARY MUST cn MAY nextcloudEnabled X-ORIGIN 'user defined' )
11+
attributeTypes: ( 1.3.6.1.4.1.49213.1.1.1 NAME 'nextcloudEnabled' DESC 'whether user or group should be available in Nextcloud' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'user defined' )
12+
attributeTypes: ( 1.3.6.1.4.1.49213.1.1.2 NAME 'nextcloudQuota' DESC 'defines how much disk space is available for the user (e.g. 2 GB)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'user defined' )
13+
nsSchemaCSN: 64369e47000000000000

user_saml-dirsrv/conf/entries.ldif

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
dn: dc=idptestbed
3+
objectClass: top
4+
objectClass: domain
5+
dc: idptestbed
6+
description: dc=idptestbed
7+
aci: (targetattr = *) (targetfilter = "(objectclass=*)") (version 3.0; acl "Any read"; allow (search, read, compare) (userdn = "ldap:///anyone" );)
8+
9+
dn: cn=admin,dc=idptestbed
10+
objectClass: simpleSecurityObject
11+
objectClass: organizationalRole
12+
cn: admin
13+
userPassword: password
14+
description: LDAP administrator
15+
16+
dn: ou=Groups,dc=idptestbed
17+
objectClass: top
18+
objectClass: organizationalunit
19+
ou: Groups
20+
21+
dn: ou=People,dc=idptestbed
22+
objectClass: top
23+
objectClass: organizationalunit
24+
ou: People
25+
26+
dn: uid=student1,ou=People,dc=idptestbed
27+
objectClass: organizationalPerson
28+
objectClass: person
29+
objectClass: top
30+
objectClass: inetOrgPerson
31+
objectClass: nextcloudUser
32+
givenName: Stud
33+
uid: student1
34+
sn: Ent
35+
cn: Stud Ent
36+
mail: student1@idptestbed.edu
37+
userPassword: password
38+
nextcloudQuota: 200 MB
39+
40+
dn: uid=student2,ou=People,dc=idptestbed
41+
objectClass: organizationalPerson
42+
objectClass: person
43+
objectClass: top
44+
objectClass: inetOrgPerson
45+
objectClass: nextcloudUser
46+
givenName: Stud
47+
uid: student2
48+
sn: Ent2
49+
cn: Stud Ent2
50+
mail: student2@idptestbed.edu
51+
userPassword: password
52+
nextcloudQuota: 1 GB
53+
54+
dn: uid=staff1,ou=People,dc=idptestbed
55+
objectClass: organizationalPerson
56+
objectClass: person
57+
objectClass: top
58+
objectClass: inetOrgPerson
59+
objectClass: nextcloudUser
60+
givenName: St
61+
uid: staff1
62+
sn: aff
63+
cn: St aff
64+
mail: staff1@idptestbed.edu
65+
userPassword: password

0 commit comments

Comments
 (0)