Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP docker image: Optionally merge vendor data with content of directories or ZIPs specified by ENV #2519

Closed
gunterze opened this issue Apr 3, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@gunterze
Copy link
Member

gunterze commented Apr 3, 2020

Environment Variables

EXT_VENDOR_DATA_PATH

Space separated paths to directories or ZIP files merged with default vendor data, effective on first LDAP startup, invoke of update-data <version> or replace-vendor-data.

@gunterze gunterze added the enhancement New feature or request label Apr 3, 2020
@gunterze gunterze added this to the 5.22.1 milestone Apr 3, 2020
@gunterze gunterze self-assigned this Apr 3, 2020
@gunterze gunterze changed the title LDAP docker image: Optionally merge vendor data with content of ZIP specified by ENV LDAP docker image: Optionally merge vendor data with content of directories or ZIPs specified by ENV Apr 8, 2020
gunterze added a commit to dcm4che-dockerfiles/slapd that referenced this issue Apr 8, 2020
gunterze added a commit to dcm4che-dockerfiles/slapd-dcm4chee that referenced this issue Apr 8, 2020
gunterze added a commit to dcm4che-dockerfiles/slapd-dcm4chee that referenced this issue Apr 9, 2020
@gunterze gunterze closed this as completed Apr 9, 2020
@petrkalina petrkalina reopened this Feb 19, 2021
@petrkalina
Copy link
Collaborator

petrkalina commented Feb 19, 2021

  • invoke replace-vendor-data
  • change the data in the target folder
  • invoke replace-vendor-data again

.. the second replacement does not take place..

.. so this is rather effective "on first invocation of replace-vendor-data after re-creation of the container" i.e. as per

#!/bin/sh

if [ ! -f /etc/openldap/data/vendor-data.zip ]; then
  cp /etc/openldap/data/vendor-data-orig.zip /etc/openldap/data/vendor-data.zip
  if [ -n "$EXT_VENDOR_DATA_PATH" ]; then
    for f in $EXT_VENDOR_DATA_PATH; do
      if [ ! -d $f ]; then
        mkdir /tmp/$f
        unzip $f -d /tmp/$f
        cd /tmp/$f
      else
        cd $f;
      fi
      zip -r /etc/openldap/data/vendor-data.zip .
    done
  fi
fi

which is only effective if no previous replace-vendor-data took place..

@gunterze
Copy link
Member Author

This behavior is indented to avoid re-generation of /etc/openldap/data/vendor-data.zip on each invocation of merge-vendor-data.sh, which is not only invoked by replace-vendor-data.

You have to recreate the container for re-generation of /etc/openldap/data/vendor-data.zip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants