Back-end components after component sharing - LDAP warehouse docker-openlda
background
Recently, we are exploring various common components and tools on the front-end, back-end, and system side, and reorganize some of the common components to form a standardized component topic, which will later include some commonly used components in various languages. Welcome everyone to continue to pay attention.
Component Basic Information
- Component: docker-openldap
- Open source agreement: MIT license
content
What we share in this section is the LDAP warehouse docker-openldap , which allows us to quickly install ldap for use.
The specific installation is as follows:
1. docker installation
docker run --name my-openldap-container --detach osixia/openldap:1.5.0
Create new ldap server
docker run \
--env LDAP_ORGANISATION="My Company" \
--env LDAP_DOMAIN="my-company.com" \
--env LDAP_ADMIN_PASSWORD="JonSn0w" \
--detach osixia/openldap:1.5.0
For new ldap servers only:
LDAP_ORGANISATION : Organization name. The default is
Example Inc.
LDAP_DOMAIN : LDAP domain. The default is
example.org
LDAP_BASE_DN : LDAP base DN. If empty, automatically set from LDAP_DOMAIN value. The default is
(empty)
LDAP_ADMIN_PASSWORD LDAP administrator password. The default is
admin
LDAP_CONFIG_PASSWORD Ldap configuration password. The default is
config
-
LDAP_READONLY_USER adds a read-only user. The default is
false
NOTE: Read- only users do have write access to their own passwords.
LDAP_READONLY_USER_USERNAME Read-only username. The default is
readonly
LDAP_READONLY_USER_PASSWORD只读用户密码。默认为
readonly
LDAP_RFC2307BIS_SCHEMA使用 rfc2307bis 模式而不是 nis 模式。默认为
false
后端:
-
LDAP_BACKEND:LDAP 后端。默认为
mdb
(以前在 v1.1.10 之前的映像版本中为 hdb)
TLS 选项:
LDAP_TLS:添加 openldap TLS 功能。设置为 true 后无法删除。默认为
true
.LDAP_TLS_CRT_FILENAME:Ldap ssl 证书文件名。默认为
ldap.crt
LDAP_TLS_KEY_FILENAME:Ldap ssl 证书私钥文件名。默认为
ldap.key
LDAP_TLS_DH_PARAM_FILENAME:Ldap ssl 证书 dh 参数文件。默认为
dhparam.pem
LDAP_TLS_CA_CRT_FILENAME:Ldap ssl CA 证书文件名。默认为
ca.crt
LDAP_TLS_ENFORCE:强制执行 TLS,但 ldapi 连接除外。设置为 true 后无法禁用。默认为
false
.LDAP_TLS_CIPHER_SUITE:TLS 密码套件。默认为
SECURE256:+SECURE128:-VERS-TLS-ALL:+VERS-TLS1.2:-RSA:-DHE-DSS:-CAMELLIA-128-CBC:-CAMELLIA-256-CBC
,基于 Red Hat 的TLS 强化指南-
LDAP_TLS_VERIFY_CLIENT:TLS 验证客户端。默认为
demand
复制选项:
LDAP_REPLICATION:添加 openldap 复制功能。可能的值:
true
,false
,own
. 默认为false
. 将此设置为own
允许通过自定义引导 ldifs 提供自己的复制设置。LDAP_REPLICATION_CONFIG_SYNCPROV:用于配置数据库的 olcSyncRepl 选项。没有根据 LDAP_REPLICATION_HOSTS 自动添加的rid和provider 。默认为
binddn="cn=admin,cn=config" bindmethod=simple credentials=$LDAP_CONFIG_PASSWORD searchbase="cn=config" type=refreshAndPersist retry="60 +" timeout=1 starttls=critical
LDAP_REPLICATION_DB_SYNCPROV:用于数据库的 olcSyncRepl 选项。没有根据 LDAP_REPLICATION_HOSTS 自动添加的rid和provider 。默认为
binddn="cn=admin,$LDAP_BASE_DN" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase="$LDAP_BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="60 +" timeout=1 starttls=critical
-
LDAP_REPLICATION_HOSTS:复制主机列表,必须包含由 --hostname 在 docker run 命令上设置的当前容器主机名。默认为:
- ldap://ldap.example.org - ldap://ldap2.example.org
如果要在 docker run 命令中设置此变量,请添加标签
#PYTHON2BASH:
并在 python 中转换 yaml:docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.5.0
在线将 yaml 转换为 python:https ://yaml-online-parser.appspot.com/
其他环境变量:
-
KEEP_EXISTING_CONFIG:不要更改 ldap 配置。默认为
false
- 如果在现有数据库中设置为true ,则配置将保持不变。映像 tls 和复制配置将不会运行。容器可以在 LDAP_ADMIN_PASSWORD 和 LDAP_CONFIG_PASSWORD 为空或填充虚假数据的情况下启动。
- 如果在引导新数据库时设置为true,则不会添加引导 ldif 和模式,并且不会运行 tls 和复制配置。
LDAP_REMOVE_CONFIG_AFTER_SETUP:设置后删除配置文件夹。默认为
true
LDAP_SSL_HELPER_PREFIX:ssl-helper 环境变量前缀。默认为
ldap
, ssl-helper 首先从 LDAP_SSL_HELPER_* 变量中搜索配置,在 SSL_HELPER_* 变量之前。HOSTNAME:设置正在运行的 openldap 服务器的主机名。默认为 docker 创建的任何内容。
DISABLE_CHOWN:不执行任何 chown 来修复文件所有权。默认为
false
LDAP_OPENLDAP_UID:运行时 docker 用户 uid 以运行容器
LDAP_OPENLDAP_GID:运行时 docker 用户 gid 来运行容器
具体使用方式可以参见该文档
本文声明:
This work is licensed by CN Hua Shao under the Creative Commons Attribution-Noncommercial 4.0 International License.