Improve usage examples

This commit is contained in:
paul 2019-04-18 20:59:51 +02:00
parent 243276702f
commit c79c8bffd7
5 changed files with 29 additions and 15 deletions

View file

@ -7,13 +7,21 @@ image.
### Building slapd ### Building slapd
``` ```
docker build -t zombi/slapd . docker build -t zombi/ldap .
``` ```
### Running slapd ### Running slapd
Copy over example configuration
```bash
cp docker-compose.yml{.example,}
``` ```
docker run -d --name ldap -v /data/ldap:/data -p 389:389 zombi/slapd
run the service
```
docker-compose up -d
``` ```
### Backing up data ### Backing up data

View file

@ -1,9 +1,13 @@
version: '2' version: "2.4"
networks: networks:
net: net:
driver: bridge driver: bridge
volumes:
data:
conf:
services: services:
slapd: slapd:
image: zombi/ldap:latest image: zombi/ldap:latest
@ -13,5 +17,5 @@ services:
- "DATADIR=/data" - "DATADIR=/data"
- "CONFDIR=/conf" - "CONFDIR=/conf"
volumes: volumes:
- ./data/ldap/config:/conf - conf:/etc/ldap/slapd.d
- ./data/ldap/data:/data - data:/var/lib/ldap

View file

@ -1,9 +0,0 @@
dn: cn=ldapPublicKey,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: ldapPublicKey
olcAttributeTypes: ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey'
DESC 'MANDATORY: OpenSSH Public key' EQUALITY octetStringMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
olcObjectClasses: ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey'
SUP top AUXILIARY DESC 'MANDATORY: OpenSSH LPK objectclass'
MUST ( sshPublicKey $ uid ) )

View file

@ -33,7 +33,7 @@ olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,c
# Allow unauthenticated read access for schema and base DN autodiscovery # Allow unauthenticated read access for schema and base DN autodiscovery
olcAccess: {1}to dn.exact="" by * read olcAccess: {1}to dn.exact="" by * read
olcAccess: {2}to dn.base="cn=Subschema" by * read olcAccess: {2}to dn.base="cn=Subschema" by * read
# Define CRYPT as preferred algorighm for password hashing # Define CRYPT as preferred algorithm for password hashing
olcPasswordHash: {CRYPT} olcPasswordHash: {CRYPT}
# Config db settings # Config db settings
@ -60,6 +60,17 @@ include: file:///etc/ldap/schema/ppolicy.ldif
# misc adds support for local mail users and aliases # misc adds support for local mail users and aliases
include: file:///etc/ldap/schema/misc.ldif include: file:///etc/ldap/schema/misc.ldif
# schema support for storing user public keys
dn: cn=ldapPublicKey,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: ldapPublicKey
olcAttributeTypes: ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey'
DESC 'MANDATORY: OpenSSH Public key' EQUALITY octetStringMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
olcObjectClasses: ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey'
SUP top AUXILIARY DESC 'MANDATORY: OpenSSH LPK objectclass'
MUST ( sshPublicKey $ uid ) )
# Load module # Load module
dn: cn=module{0},cn=config dn: cn=module{0},cn=config
objectClass: olcModuleList objectClass: olcModuleList