diff --git a/Makefile b/Makefile index 17362da..1d0dd4d 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ itest-env: .PHONY: clean-itest clean-itest: - docker compose down -v + docker compose down -v --remove-orphans # Installs pre-commit hooks .PHONY: install-hooks diff --git a/docker-compose.yml b/docker-compose.yml index 1a54164..3b58b04 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,14 +26,17 @@ services: I_REALLY_WANT_VOLATILE_STORAGE: 'true' ldap: - image: osixia/openldap - volumes: - - /var/lib/ldap - - /etc/ldap/slapd.d + image: bitnami/openldap:latest environment: - LDAP_READONLY_USER: 'true' - LDAP_READONLY_USER_USERNAME: readonly - LDAP_READONLY_USER_PASSWORD: readonly + LDAP_PORT_NUMBER: 389 + LDAP_ROOT: dc=example,dc=org + LDAP_ADMIN_USERNAME: admin + LDAP_ADMIN_PASSWORD: adminpassword + + LDAP_SKIP_DEFAULT_TREE: yes + LDAP_CUSTOM_LDIF_DIR: /ldifs + volumes: + - ./itest/ldif:/ldifs ldap_admin: image: osixia/phpldapadmin diff --git a/example.config.toml b/example.config.toml index b420d36..c6d6590 100644 --- a/example.config.toml +++ b/example.config.toml @@ -2,7 +2,7 @@ vaultwarden_url = "http://vaultwarden:80" vaultwarden_admin_token = "admin" ldap_host = "ldap" ldap_bind_dn = "cn=admin,dc=example,dc=org" -ldap_bind_password = "admin" +ldap_bind_password = "adminpassword" ldap_search_base_dn = "dc=example,dc=org" ldap_search_filter = "(&(objectClass=*)(uid=*))" ldap_sync_interval_seconds = 10 diff --git a/itest/config.toml b/itest/config.toml index 8ba9da2..d86015b 100644 --- a/itest/config.toml +++ b/itest/config.toml @@ -1,8 +1,8 @@ vaultwarden_url = "http://vaultwarden:80" vaultwarden_admin_token = "admin" ldap_host = "ldap" -ldap_bind_dn = "cn=readonly,dc=example,dc=org" -ldap_bind_password = "readonly" +ldap_bind_dn = "cn=admin,dc=example,dc=org" +ldap_bind_password = "adminpassword" ldap_search_base_dn = "dc=example,dc=org" ldap_search_filter = "(&(objectClass=*)(uid=*))" ldap_sync_loop = false diff --git a/itest/docker-compose.itest-env.yml b/itest/docker-compose.itest-env.yml index 58f19b9..e788554 100644 --- a/itest/docker-compose.itest-env.yml +++ b/itest/docker-compose.itest-env.yml @@ -14,7 +14,4 @@ services: vaultwarden: {} - ldap: - command: ["--copy-service"] - volumes: - - ./itest/ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom + ldap: {} diff --git a/itest/docker-compose.itest.yml b/itest/docker-compose.itest.yml index 16de716..10b21ef 100644 --- a/itest/docker-compose.itest.yml +++ b/itest/docker-compose.itest.yml @@ -6,7 +6,4 @@ services: vaultwarden: {} - ldap: - command: ["--copy-service"] - volumes: - - ./itest/ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom + ldap: {} diff --git a/itest/ldif/50-seed-user.ldif b/itest/ldif/50-seed-user.ldif index 0fa5ae8..f6a996d 100644 --- a/itest/ldif/50-seed-user.ldif +++ b/itest/ldif/50-seed-user.ldif @@ -3,6 +3,12 @@ version: 1 +dn: dc=example,dc=org +dc: example +objectClass: dcObject +objectClass: organizationalUnit +ou: Example Org + # Entry 1: Users group dn: cn=Users,dc=example,dc=org cn: Users