- run: |
apt-get install -qq -y --no-install-recommends \
libboost-all-dev \
+ libkrb5-3 \
+ libldap-2.4-2 \
liblmdb0 \
libpq5 \
libssl1.1 \
g++ \
git \
libboost-all-dev \
+ libkrb5-dev \
+ libldap2-dev \
liblmdb-dev \
libpq-dev \
libsqlite3-dev \
CXXFLAGS="-O1 -Werror=vla" \
./configure \
--disable-lua-records \
- --with-modules='bind lmdb gmysql gsqlite3 gpgsql godbc random' \
+ --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc random' \
--enable-tools \
--with-lmdb=/usr \
--prefix=/opt/pdns-auth
- auth-regress:
context: gpgsql-nsec3-narrow
+ test-auth-regress-ldap:
+ docker:
+ - image: debian:stretch
+ environment:
+ LDAPHOST: ldap://ldapserver/
+ - image: powerdns/ldap-regress:1.2.4-0 # OpenLDAP 2.4.47
+ name: ldapserver
+ command: '--loglevel debug'
+ environment:
+ LDAP_LOG_LEVEL: 0
+ steps:
+ - auth-regress-setup
+ - run: DEBIAN_FRONTEND=noninteractive apt-get install -qq -y ldap-utils
+ - auth-regress:
+ context: ldap-tree
+ doroot: false
+ - auth-regress:
+ context: ldap-simple
+ doroot: false
+ - auth-regress:
+ context: ldap-strict
+ doroot: false
+
test-auth-regress-lmdb:
docker:
- image: debian:stretch
- test-auth-regress-lmdb:
requires:
- build-auth
+ - test-auth-regress-ldap:
+ requires:
+ - build-auth
- build-recursor
- test-recursor-regression:
--- /dev/null
+ARG VERSION
+FROM osixia/openldap:$VERSION
+ADD bootstrap /container/service/slapd/assets/config/bootstrap
+RUN rm -rf /container/service/slapd/assets/config/bootstrap/schema/mmc
+RUN mkdir -p /var/lib/ldap-powerdns
+RUN chown openldap:openldap /var/lib/ldap-powerdns
--- /dev/null
+NAME = powerdns/ldap-regress
+VERSION = 1.2.4
+REVISION = 0
+
+.PHONY: all build build-nocache dep
+
+all: build
+
+dep:
+ mkdir -p bootstrap/schema
+ cp ../../../modules/ldapbackend/*.schema bootstrap/schema
+
+build: dep
+ docker build --build-arg VERSION=$(VERSION) -t $(NAME):$(VERSION)-$(REVISION) --rm .
+
+build-nocache: dep
+ docker build --build-arg VERSION=$(VERSION) -t $(NAME):$(VERSION)-$(REVISION) --no-cache --rm .
+
+push: build
+ docker push powerdns/ldap-regress:$(VERSION)-$(REVISION)
\ No newline at end of file
-dn: olcDatabase=hdb,cn=config
+dn: olcDatabase=mdb,cn=config
objectClass: olcDatabaseConfig
-objectClass: olcHdbConfig
-olcDatabase: hdb
-olcDbDirectory: /var/lib/ldap/powerdns
+objectClass: olcMdbConfig
+olcDatabase: mdb
+olcDbDirectory: /var/lib/ldap-powerdns
olcSuffix: o=power
olcLastMod: TRUE
olcRootDN: uid=testuser,o=power
olcDbCheckpoint: 512 30
-olcDbConfig: {0}set_cachesize 0 2097152 0
-olcDbConfig: {1}set_lk_max_objects 1500
-olcDbConfig: {2}set_lk_max_locks 1500
-olcDbConfig: {3}set_lk_max_lockers 1500
olcDbIndex: objectClass eq
olcDbIndex: associatedDomain eq
olcRootPW: secret
+olcDbMaxSize: 1073741824
dn: o=power
objectClass: organization
[ -z "$LDAPPASSWD" ] && LDAPPASSWD='secret'
[ -z "$LDAPBASEDN" ] && LDAPBASEDN='ou=dns,o=power'
[ -z "$LDAPRELATTR" ] && LDAPRELATTR='ou: dns'
+ [ -z "$LDAPHOST" ] && LDAPHOST='ldap://127.0.0.1:389/'
layout=${context:5}
- ldapdelete -D $LDAPUSER -w $LDAPPASSWD -r $LDAPBASEDN || true
- ldapadd -D $LDAPUSER -w $LDAPPASSWD << __EOF__
+ ldapdelete -D $LDAPUSER -w $LDAPPASSWD -r $LDAPBASEDN -H $LDAPHOST || true
+ ldapadd -D $LDAPUSER -w $LDAPPASSWD -H $LDAPHOST << __EOF__
dn: $LDAPBASEDN
objectClass: organizationalUnit
$LDAPRELATTR
__EOF__
- $ZONE2LDAP --dnsttl=yes --basedn=$LDAPBASEDN --layout=$layout --named-conf=named.conf | ldapmodify -D $LDAPUSER -w $LDAPPASSWD -c > /dev/null || true
+ $ZONE2LDAP --dnsttl=yes --basedn=$LDAPBASEDN --layout=$layout --named-conf=named.conf | ldapmodify -D $LDAPUSER -w $LDAPPASSWD -H $LDAPHOST -c > /dev/null || true
cat > pdns-ldap.conf << __EOF__
module-dir=./modules
ldap-binddn=$LDAPUSER
ldap-secret=$LDAPPASSWD
ldap-method=$layout
+ldap-host=$LDAPHOST
__EOF__
$RUNWRAPPER $PDNS --daemon=no --local-address=$address --local-port=$port --config-dir=. \