You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can be achieved by mounting host directories as volume.
75
+
This can be achieved by mounting host directories as volume.
78
76
Assuming you have a LDAP database on your docker host in the directory `/data/slapd/database`
79
77
and the corresponding LDAP config files on your docker host in the directory `/data/slapd/config`
80
78
simply mount this directories as a volume to `/var/lib/ldap` and `/etc/ldap/slapd.d`:
81
79
82
-
docker run -v /data/slapd/database:/var/lib/ldap \
80
+
docker run -h ldap.example.org -v /data/slapd/database:/var/lib/ldap \
83
81
-v /data/slapd/config:/etc/ldap/slapd.d
84
82
-d osixia/openldap
85
83
@@ -89,36 +87,86 @@ You can also use data volume containers. Please refer to :
89
87
### Using TLS
90
88
91
89
#### Use autogenerated certificate
92
-
By default TLS is enable, a certificate is created for the CN (common name) ldap.example.org. To work properly on your server adjust SERVER_NAME environment variable to match the ldap server CN.
90
+
By default TLS is enable, a certificate is created with the container hostname (set by -h option eg: ldap.example.org).
93
91
94
-
docker run -e SERVER_NAME=ldap.my-compagny.com -d osixia/openldap
92
+
docker run -h ldap.example.org -e SERVER_NAME=ldap.my-compagny.com -d osixia/openldap
95
93
96
94
#### Use your own certificate
97
95
98
96
Add your custom certificate, private key and CA certificate in the directory **image/service/slapd/assets/ssl** adjust filename in **image/env.yml** and rebuild the image ([see manual build](#manual-build)).
99
97
100
-
Or you can set your custom certificate at run time, by mouting your a directory containing thoses files to **/osixia/slapd/ssl** and adjust there name with the following environment variables :
98
+
Or you can set your custom certificate at run time, by mouting a directory containing thoses files to **/osixia/slapd/assets/ssl** and adjust there name with the following environment variables :
101
99
102
-
docker run -v /path/to/certifates:/osixia/slapd/ssl \
100
+
docker run -h ldap.example.org -v /path/to/certifates:/osixia/slapd/assets/ssl \
103
101
-e SSL_CRT_FILENAME=my-ldap.crt \
104
102
-e SSL_KEY_FILENAME=my-ldap.key \
105
103
-e SSL_CA_CRT_FILENAME=the-ca.crt \
106
104
-d osixia/openldap
107
-
105
+
108
106
#### Disable TLS
109
107
Add -e USE_TLS=false to the run command :
110
108
111
-
docker run -e USE_TLS=false -d osixia/openldap
109
+
docker run -h ldap.example.org -e USE_TLS=false -d osixia/openldap
110
+
111
+
### Multi master replication
112
+
Quick example, with the default config.
113
+
114
+
Create the first ldap server, save the container id in LDAP_CID and get its IP:
115
+
116
+
LDAP_CID=$(docker run -h ldap.example.org -e USE_REPLICATION=true -d osixia/openldap)
Environement variables defaults are set in **image/env.yml**. You can modify environment variable values directly in this file and rebuild the image ([see manual build](#manual-build)) or you can override those values at run time with -e argument. See example below.
164
+
Environement variables defaults are set in **image/env.yml**. You can modify environment variable values directly in this file and rebuild the image ([see manual build](#manual-build)). You can also override those values at run time with -e argument or by setting your own env.yml file as a docker volume to `/etc/env.yml`. See examples below.
165
+
166
+
General container configuration :
167
+
-**LDAP_LOG_LEVEL**: Slap log level. defaults to `-1`. See table 5.1 in http://www.openldap.org/doc/admin24/slapdconf2.html for the available log levels.
120
168
121
-
Required for new ldap server :
169
+
Required and used for new ldap server only :
122
170
-**LDAP_ORGANISATION**: Organisation name. Defaults to `Example Inc.`
123
171
-**LDAP_DOMAIN**: Ldap domain. Defaults to `example.org`
124
172
-**LDAP_ADMIN_PASSWORD** Admin password. Defaults to `admin`
@@ -128,15 +176,25 @@ TLS options :
128
176
-**SSL_CRT_FILENAME**: Ldap ssl certificate filename. Defaults to `ldap.crt`
129
177
-**SSL_KEY_FILENAME**: Ldap ssl certificate private key filename. Defaults to `ldap.key`
130
178
-**SSL_CA_CRT_FILENAME**: Ldap ssl CA certificate filename. Defaults to `ca.crt`
131
-
-**SERVER_NAME**: Use by autogenerated certificate: Server CN. Defaults to `ldap.example.org`
179
+
180
+
Replication options :
181
+
-**USE_REPLICATION**: Add openldap replication capabilities. Defaults to `false`
182
+
-**REPLICATION_CONFIG_SYNCPROV**: olcSyncRepl options used for the config database. Without **rid** and **provider** which are automaticaly added based on REPLICATION_HOSTS. Defaults to `binddn="cn=admin,cn=config" bindmethod=simple credentials=$LDAP_CONFIG_PASSWORD searchbase="cn=config" type=refreshAndPersist retry="5 5 300 5" timeout=1 starttls=critical`
183
+
-**REPLICATION_HDB_SYNCPROV**: olcSyncRepl options used for the HDB database. Without **rid** and **provider** which are automaticaly added based on REPLICATION_HOSTS. Defaults to `binddn="cn=admin,$BASE_DN" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase="$BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="5 5 300 5" timeout=1 starttls=critical`
184
+
-**REPLICATION_HOSTS**: list of replication hosts, must contains the current container hostname set by -h on docker run command. Defaults to `['ldap://ldap.example.org', 'ldap://ldap2.example.org']`
132
185
133
186
### Set environment variables at run time :
134
187
135
188
Environment variable can be set directly by adding the -e argument in the command line, for example :
136
-
137
-
docker run -e LDAP_ORGANISATION="My Compagny" -e LDAP_DOMAIN="my-compagny.com" \
189
+
190
+
docker run -h ldap.example.org -e LDAP_ORGANISATION="My Compagny" -e LDAP_DOMAIN="my-compagny.com" \
0 commit comments