phi/openldap/Makefile

39 lines
753 B
Makefile
Raw Normal View History

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 \
-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:
2017-12-23 16:03:20 +01:00
LDAPTLS_REQCERT=never sh
2017-12-16 23:03:03 +01:00
.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=*)'