diff --git a/pica-slapd/Dockerfile b/pica-slapd/Dockerfile deleted file mode 100644 index 5752f46f75f08917f5285628e84b8865daab1e4f..0000000000000000000000000000000000000000 --- a/pica-slapd/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM pica-debian -MAINTAINER picasoft kyane@kyane.fr - -ENV HOME /root - -# Disable SSH -RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh - -# Use baseimage-docker's init system. -CMD ["/etc/service/slapd/run"] - -# Configure apt -# RUN echo 'deb http://us.archive.ubuntu.com/ubuntu/ precise universe' >> /etc/apt/sources.list -RUN apt-get -y update - -# Install slapd -RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y slapd - -# Default configuration: can be overridden at the docker command line -ENV LDAP_ROOTPASS password -ENV LDAP_ORGANISATION Picasoft -ENV LDAP_DOMAIN picasoft.net - -EXPOSE 389 - -RUN mkdir -p /etc/service/slapd -ADD slapd.sh /etc/service/slapd/run -RUN chmod 755 /etc/service/slapd/run - -# To store the data outside the container, mount /var/lib/ldap as a data volume -VOLUME /var/lib/ldap - -RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - - diff --git a/pica-slapd/README.md b/pica-slapd/README.md deleted file mode 100644 index 3780609c08aa454ed1805c572a1907c3a8371146..0000000000000000000000000000000000000000 --- a/pica-slapd/README.md +++ /dev/null @@ -1,40 +0,0 @@ -## slapd - -A basic configuration of the OpenLDAP server, slapd, with support for data -volumes. - -This image will initialize a basic configuration of slapd. Most common schemas -are preloaded (all the schemas that come preloaded with the default Ubuntu -Precise install of slapd), but the only record added to the directory will be -the root organisational unit. - -You can (and should) configure the following by providing environment variables -to `docker run`: - -- `LDAP_DOMAIN` sets the LDAP root domain. (e.g. if you provide `foo.bar.com` - here, the root of your directory will be `dc=foo,dc=bar,dc=com`) -- `LDAP_ORGANISATION` sets the human-readable name for your organisation (e.g. - `Acme Widgets Inc.`) -- `LDAP_ROOTPASS` sets the LDAP admin user password (i.e. the password for - `cn=admin,dc=example,dc=com` if your domain was `example.com`) - -For example, to start a container running slapd for the `mycorp.com` domain, -with data stored in `/data/ldap` on the host, use the following: - - docker run -v /data/ldap:/var/lib/ldap \ - -e LDAP_DOMAIN=mycorp.com \ - -e LDAP_ORGANISATION="My Mega Corporation" \ - -e LDAP_ROOTPASS=s3cr3tpassw0rd \ - -d nickstenning/slapd - -You can find out which port the LDAP server is bound to on the host by running -`docker ps` (or `docker port <container_id> 389`). You could then load an LDIF -file (to set up your directory) like so: - - ldapadd -h localhost -p <host_port> -c -x -D cn=admin,dc=mycorp,dc=com -W -f -data.ldif - -**NB**: Please be aware that by default docker will make the LDAP port -accessible from anywhere if the host firewall is unconfigured. - - diff --git a/pica-slapd/docker-compose.yml b/pica-slapd/docker-compose.yml deleted file mode 100644 index 1bf6dbae9886a2189def375825f3a02730b413ac..0000000000000000000000000000000000000000 --- a/pica-slapd/docker-compose.yml +++ /dev/null @@ -1,9 +0,0 @@ -slapd: - image: nickstenning/slapd - volumes: - - /DATA/volumes/ldap/var_lib_ldap:/var/lib/ldap - - /DATA/volumes/ldap/etc_ldap_slapdd:/etc/ldap/slapd.d - environment: - - LDAP_DOMAIN=picasoft.net - - LDAP_ORGANISATION="Picasoft" - - LDAP_ROOTPASS=iMGr97fD4kz diff --git a/pica-slapd/slapd.sh b/pica-slapd/slapd.sh deleted file mode 100644 index cb756568bc771c34e8e6e6be80f54ee714941c0b..0000000000000000000000000000000000000000 --- a/pica-slapd/slapd.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -set -eu - -status () { - echo "---> ${@}" >&2 -} - -set -x -: LDAP_ROOTPASS=${LDAP_ROOTPASS} -: LDAP_DOMAIN=${LDAP_DOMAIN} -: LDAP_ORGANISATION=${LDAP_ORGANISATION} - -if [ ! -e /var/lib/ldap/docker_bootstrapped ]; then - status "configuring slapd for first run" - - cat <<EOF | debconf-set-selections -slapd slapd/internal/generated_adminpw password ${LDAP_ROOTPASS} -slapd slapd/internal/adminpw password ${LDAP_ROOTPASS} -slapd slapd/password2 password ${LDAP_ROOTPASS} -slapd slapd/password1 password ${LDAP_ROOTPASS} -slapd slapd/dump_database_destdir string /var/backups/slapd-VERSION -slapd slapd/domain string ${LDAP_DOMAIN} -slapd shared/organization string ${LDAP_ORGANISATION} -slapd slapd/backend string HDB -slapd slapd/purge_database boolean true -slapd slapd/move_old_database boolean true -slapd slapd/allow_ldap_v2 boolean false -slapd slapd/no_configuration boolean false -slapd slapd/dump_database select when needed -EOF - - dpkg-reconfigure -f noninteractive slapd - - touch /var/lib/ldap/docker_bootstrapped -else - status "found already-configured slapd" -fi - -status "starting slapd" -set -x -exec /usr/sbin/slapd -h "ldap:///" -u openldap -g openldap -d 0