diff --git a/changelog/unreleased/deployment_example_replace_ldap_image.md b/changelog/unreleased/deployment_example_replace_ldap_image.md new file mode 100644 index 00000000000..82893542bca --- /dev/null +++ b/changelog/unreleased/deployment_example_replace_ldap_image.md @@ -0,0 +1,10 @@ +Bugfix: Replace obsolete docker image in the deployment example + +In the ocis_ldap deployment example, we were using the bitnami/openldap docker +image. This image isn't available any longer, so the example couldn't be +deployed as intended. + +We've replaced the docker image with the osixia/openldap image and we've +adjusted some of the configuration of the openldap image. + +https://github.com/owncloud/ocis/pull/11828 diff --git a/deployments/examples/ocis_ldap/config/ldap/docker-entrypoint-override.sh b/deployments/examples/ocis_ldap/config/ldap/docker-entrypoint-override.sh deleted file mode 100644 index 3d3f27333be..00000000000 --- a/deployments/examples/ocis_ldap/config/ldap/docker-entrypoint-override.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -printenv - -if [ ! -f /opt/bitnami/openldap/share/openldap.key ] -then - openssl req -x509 -newkey rsa:4096 -keyout /opt/bitnami/openldap/share/openldap.key -out /opt/bitnami/openldap/share/openldap.crt -sha256 -days 365 -batch -nodes -fi -# run original docker-entrypoint -/opt/bitnami/scripts/openldap/entrypoint.sh "$@" diff --git a/deployments/examples/ocis_ldap/config/ldap/ldif/04_internal.ldif b/deployments/examples/ocis_ldap/config/ldap/ldif/04_internal.ldif new file mode 100644 index 00000000000..907d2197687 --- /dev/null +++ b/deployments/examples/ocis_ldap/config/ldap/ldif/04_internal.ldif @@ -0,0 +1,8 @@ +# groupOfNames requires at least one member to be present +# The refint will use this dn if the last member of the group +# has been removed +dn: cn=nobody,dc=owncloud,dc=com +objectClass: top +objectClass: organizationalRole +description: to be used for refint in empty groups +cn: nobody diff --git a/deployments/examples/ocis_ldap/config/ldap/ldif/05_memberofconf.ldif b/deployments/examples/ocis_ldap/config/ldap/ldif/05_memberofconf.ldif new file mode 100644 index 00000000000..8ed186c8a5b --- /dev/null +++ b/deployments/examples/ocis_ldap/config/ldap/ldif/05_memberofconf.ldif @@ -0,0 +1,14 @@ +# configure memberof overlay to use groupOfNames and member attributes +dn: olcOverlay={0}memberof,olcDatabase={1}mdb,cn=config +changetype: modify +replace: olcMemberOfGroupOC +olcMemberOfGroupOC: groupOfNames +- +replace: olcMemberOfMemberAD +olcMemberOfMemberAD: member + +# configure refint overlay to use nobody if no member is present +dn: olcOverlay={1}refint,olcDatabase={1}mdb,cn=config +changetype: modify +replace: olcRefintNothing +olcRefintNothing: cn=nobody,dc=owncloud,dc=com diff --git a/deployments/examples/ocis_ldap/config/ldap/ldif/10_base.ldif b/deployments/examples/ocis_ldap/config/ldap/ldif/10_base.ldif index 8459afb3b23..f480116ab6d 100644 --- a/deployments/examples/ocis_ldap/config/ldap/ldif/10_base.ldif +++ b/deployments/examples/ocis_ldap/config/ldap/ldif/10_base.ldif @@ -1,8 +1,9 @@ -dn: dc=owncloud,dc=com -objectClass: organization -objectClass: dcObject -dc: owncloud -o: ownCloud +# the owncloud organization is already setup by osixia configuration +#dn: dc=owncloud,dc=com +#objectClass: organization +#objectClass: dcObject +#dc: owncloud +#o: ownCloud dn: ou=users,dc=owncloud,dc=com objectClass: organizationalUnit diff --git a/deployments/examples/ocis_ldap/docker-compose.yml b/deployments/examples/ocis_ldap/docker-compose.yml index e7af07ec5e0..a036742266a 100644 --- a/deployments/examples/ocis_ldap/docker-compose.yml +++ b/deployments/examples/ocis_ldap/docker-compose.yml @@ -60,7 +60,7 @@ services: command: [ "-c", "ocis init || true; exec ocis server" ] environment: # users/groups from ldap - OCIS_LDAP_URI: ldaps://ldap-server:1636 + OCIS_LDAP_URI: ldaps://ldap-server:636 OCIS_LDAP_INSECURE: "true" OCIS_LDAP_BIND_DN: "cn=admin,dc=owncloud,dc=com" OCIS_LDAP_BIND_PASSWORD: ${LDAP_ADMIN_PASSWORD:-admin} @@ -106,28 +106,27 @@ services: restart: always ldap-server: - image: bitnami/openldap:2.6 + image: osixia/openldap:1.5.0 networks: ocis-net: - entrypoint: ["/bin/sh", "/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh", "/opt/bitnami/scripts/openldap/run.sh" ] environment: - BITNAMI_DEBUG: true LDAP_TLS_VERIFY_CLIENT: never - LDAP_ENABLE_TLS: "yes" - LDAP_TLS_CA_FILE: /opt/bitnami/openldap/share/openldap.crt - LDAP_TLS_CERT_FILE: /opt/bitnami/openldap/share/openldap.crt - LDAP_TLS_KEY_FILE: /opt/bitnami/openldap/share/openldap.key + LDAP_TLS: true + LDAP_ORGANISATION: owncloud + LDAP_DOMAIN: owncloud.com LDAP_ROOT: "dc=owncloud,dc=com" LDAP_ADMIN_PASSWORD: ${LDAP_ADMIN_PASSWORD:-admin} + LDAP_SEED_INTERNAL_LDIF_PATH: /ldifs + LDAP_SEED_INTERNAL_SCHEMA_PATH: /schemas ports: - - "127.0.0.1:389:1389" - - "127.0.0.1:636:1636" + - "127.0.0.1:389:389" + - "127.0.0.1:636:636" volumes: - ./config/ldap/ldif:/ldifs - ./config/ldap/schemas:/schemas - - ./config/ldap/docker-entrypoint-override.sh:/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh - - ldap-certs:/opt/bitnami/openldap/share - - ldap-data:/bitnami/openldap + - ldap-certs:/container/service/slapd/assets/certs + - ldap-data:/var/lib/ldap + - ldap-config:/etc/ldap/slapd.d logging: driver: ${LOG_DRIVER:-local} restart: always @@ -137,7 +136,7 @@ services: networks: ocis-net: environment: - PHPLDAPADMIN_LDAP_HOSTS: "#PYTHON2BASH:[{'ldap-server': [{'server': [{'port': 1389}]}]}]" + PHPLDAPADMIN_LDAP_HOSTS: "#PYTHON2BASH:[{'ldap-server': [{'server': [{'port': 389}]}]}]" PHPLDAPADMIN_HTTPS: "false" labels: - "traefik.enable=true" @@ -156,6 +155,7 @@ volumes: ocis-config: ocis-data: ldap-data: + ldap-config: networks: