2017-12-16 23:03:03 +01:00
|
|
|
.PHONY: all
|
|
|
|
all: build run
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build: gen-cert
|
|
|
|
docker build --no-cache -t unit/slapd .
|
|
|
|
|
|
|
|
.PHONY: gen-cert
|
|
|
|
gen-cert:
|
|
|
|
openssl req \
|
|
|
|
-x509 -nodes -days 365 -sha256 \
|
2017-12-18 20:28:54 +01:00
|
|
|
-subj '/C=IT/ST=Lombardia/L=Milano/CN=localhost' \
|
2017-12-16 23:03:03 +01:00
|
|
|
-newkey rsa:2048 -keyout key.pem -out cert.pem
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f key.pem cert.pem
|
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
run:
|
|
|
|
docker run -p 389:389 --rm unit/slapd
|
|
|
|
|
|
|
|
.PHONY: shell
|
|
|
|
shell:
|
|
|
|
LDAPTLS_REQCERT=never zsh
|
|
|
|
|
|
|
|
.PHONY: populate
|
|
|
|
populate:
|
|
|
|
ldapmodify -ZZ -H ldap://127.0.0.1 \
|
|
|
|
-x -D "cn=root,dc=unit,dc=macaomilano,dc=org" -w root \
|
|
|
|
-a -f init.ldif
|
|
|
|
|
|
|
|
.PHONY: inspect
|
|
|
|
inspect:
|
2017-12-21 13:44:54 +01:00
|
|
|
ldapsearch -ZZ -H ldap://127.0.0.1 \
|
2017-12-16 23:03:03 +01:00
|
|
|
-x -D "cn=root,dc=unit,dc=macaomilano,dc=org" -w root \
|
|
|
|
-b "dc=unit,dc=macaomilano,dc=org" \
|
|
|
|
'(objectclass=*)'
|