35 Commits

Author SHA1 Message Date
endial 6a4aef871e docs: 更新说明文档 2023-09-25 14:25:29 +08:00
endial 34f690393e feat: 更新脚本中处理命令 2023-09-25 12:32:07 +08:00
endial cbacbbd3f0 feat: 更新默认路径的用户组配置 2023-09-25 12:30:30 +08:00
endial 07e6e1e7ef fix: 更新应用验证指令 2023-09-18 09:39:44 +08:00
endial c0b4614cad fix: 更新应用验证指令 2023-09-18 09:24:38 +08:00
endial ccae24f68c feat: 根据新模板更新脚本文件 2023-09-16 10:20:05 +08:00
endial cf70d38535 feat: 更新overrides脚本中配置文件路径定义方式 2023-09-15 18:50:30 +08:00
endial 464690ce57 fix: 更新脚本解决使用 main 作为主分支时无法生成 latest 标签的问题 2023-09-15 18:45:04 +08:00
endial f54d307229 feat: 更新compose样例文件 2023-09-14 17:55:53 +08:00
endial 54baafdb3d feat: 更新CI/CD命令 2023-09-14 17:48:35 +08:00
endial 876cb7a573 feat: 更新Dockerfile忽略配置 2023-09-14 17:47:31 +08:00
endial 06e06c37dd feat: 删除不再使用的管理脚本 2023-08-28 12:09:45 +08:00
endial a314f6f001 feat: 优化CI/CD配置中资源清理,调整使用-VV命令解决测试失败问题 2023-08-28 11:40:23 +08:00
endial f241b1bfc6 feat: 优化CI/CD配置中资源清理 2023-08-28 11:35:47 +08:00
endial 7a0a82adce fix: 规避slapd服务一直返回状态值为1的问题 2023-08-16 12:00:14 +08:00
endial 56e620103f fix: 规避slapd服务一直返回状态值为1的问题 2023-08-16 11:52:24 +08:00
endial e080ae89e7 fix: 规避slapd服务一直返回状态值为1的问题 2023-08-16 11:47:13 +08:00
endial d9dc2c0c60 feat: 优化Dockerfile 2023-08-16 09:25:14 +08:00
endial ec8aead8b1 feat: 更新为使用 Debian 12 2023-08-16 09:22:36 +08:00
endial 76cc298e38 fix: 使用 readlink 解决 libltdl7 库遗漏安装问题 2023-08-16 09:13:07 +08:00
endial 1e1e4077ed feat: CI/CD配置增加临时数据清理 2023-08-15 17:09:34 +08:00
endial 0076a4514e feat: 根据基础镜像通用库路径更改相应调用 2023-08-15 17:06:20 +08:00
endial 23850d3af7 feat: 更新本地编译脚本 2023-08-04 15:37:56 +08:00
endial 678a7e0ff6 feat: 更新 CI/CD 编译阶段定义 2023-08-04 15:33:56 +08:00
endial 7c86979332 feat: 删除 Docker Hub 使用的 Hooks 2023-08-04 15:31:59 +08:00
endial c4d8fd5845 fix: 增加应用信息变量设置 2023-08-03 13:02:42 +08:00
endial baea6b9945 fix: 更新依赖镜像的架构选择 2023-08-02 11:22:25 +08:00
endial 3103d458f9 feat: 增加slapd编译 2023-08-02 11:17:04 +08:00
endial 04704f191c feat: 更新依赖软件包及编译命令 2023-08-02 11:07:44 +08:00
endial f1f92c5a76 feat: CI/CD 增加 tag 选择编译环境 2023-08-02 11:02:49 +08:00
endial 1dc232d5df fix: 移除针对当前版本无效的配置项 2023-08-01 15:32:47 +08:00
endial ca53e5f798 fix: 移除针对当前版本无效的配置项 2023-08-01 15:08:14 +08:00
endial e732ffb824 fix: 移除针对当前版本无效的配置项 2023-08-01 15:06:08 +08:00
endial 68aa36c810 fix: 增加开发库,解决 POSIX regex 问题 2023-08-01 14:49:19 +08:00
endial 27009abc37 docs: 更新版本信息 2023-08-01 14:08:42 +08:00
6 changed files with 50 additions and 80 deletions
+2 -2
View File
@@ -62,8 +62,8 @@ build-artifact:
test: test:
stage: test stage: test
script: script:
- docker run --pull always --rm --platform=linux/arm64 "$IMG_URL$IMG_TAG" -VV - docker run --pull always --rm --platform=linux/arm64 "$IMG_URL$IMG_TAG" -V
- docker run --pull always --rm --platform=linux/amd64 "$IMG_URL$IMG_TAG" -VV - docker run --pull always --rm --platform=linux/amd64 "$IMG_URL$IMG_TAG" -V
- docker images -q "$IMG_URL" | sort -u | xargs docker rmi -f - docker images -q "$IMG_URL" | sort -u | xargs docker rmi -f
# 部署阶段任务 # 部署阶段任务
+11 -26
View File
@@ -16,7 +16,7 @@
# 该部分变量,在编译命令中通过 `--build-arg` 传入;如果未设置,则使用下面对应的默认值 # 该部分变量,在编译命令中通过 `--build-arg` 传入;如果未设置,则使用下面对应的默认值
ARG APP_NAME=openldap # 设置当前应用名称 ARG APP_NAME=openldap # 设置当前应用名称
ARG APP_VER=2.6.6 # 设置当前应用版本 ARG APP_VER=2.4.59 # 设置当前应用版本
ARG REGISTRY_URL="docker.colovu.com/" # 设置默认仓库地址,默认为本地仓库;定义时需要包含末尾的`/` ARG REGISTRY_URL="docker.colovu.com/" # 设置默认仓库地址,默认为本地仓库;定义时需要包含末尾的`/`
ARG APT_SOURCE=aliyun # 设置 apt-get 源:default / ustc / aliyun ARG APT_SOURCE=aliyun # 设置 apt-get 源:default / ustc / aliyun
ARG LOCAL_URL="http://local.colovu.com/dist" # 编译镜像时指定用于加速的本地软件包存储服务器地址 ARG LOCAL_URL="http://local.colovu.com/dist" # 编译镜像时指定用于加速的本地软件包存储服务器地址
@@ -35,15 +35,14 @@ RUN select_source ${APT_SOURCE};
# 安装依赖的软件包及库 # 安装依赖的软件包及库
# 官方推荐包:Cyrus SASL 2.1.27+、OpenSSL 1.1.1+、libevent 2.1.8+、libsodiumgroff # 官方推荐包:Cyrus SASL 2.1.27+、OpenSSL 1.1.1+、libevent 2.1.8+、libsodiumgroff
# dbuilder已安装: libtool libltdl7 libltdl-dev libssl3 libssl-dev RUN install_pkg libperl-dev libcrypto++-dev libsasl2-dev libevent-dev libdb5.3-dev groff groff-base
# groff: 解决`soelim: not found`问题 # dbuilder已安装: libtool libltdl7 libltdl-dev libssl1.1 libssl-dev
RUN install_pkg libwrap0-dev libcrypt-dev libsodium-dev libsasl2-dev libevent-dev groff-base unixodbc-dev libperl-dev
# 参考文档: # 参考文档:
# 编译: https://www.cnblogs.com/si-jie/p/8214206.html # 编译: https://www.cnblogs.com/si-jie/p/8214206.html
# seolim解决(groff): http://www.emreakkas.com/linux-tips/ubuntu-solve-bin-sh-soelim-not-found # seolim解决(groff): http://www.emreakkas.com/linux-tips/ubuntu-solve-bin-sh-soelim-not-found
# 下载并解压软件包 # 下载并解压软件包(OpenLDAP 2.4.59)
RUN set -eux; \ RUN set -eux; \
appName=${APP_NAME}-${APP_VER}.tgz; \ appName=${APP_NAME}-${APP_VER}.tgz; \
[ -n ${LOCAL_URL} ] && localURL=${LOCAL_URL}/${APP_NAME}; \ [ -n ${LOCAL_URL} ] && localURL=${LOCAL_URL}/${APP_NAME}; \
@@ -62,25 +61,11 @@ RUN set -eux; \
CPPFLAGS="-I/usr/local/include -D_GNU_SOURCE" \ CPPFLAGS="-I/usr/local/include -D_GNU_SOURCE" \
./configure \ ./configure \
--prefix=/usr/local/${APP_NAME} \ --prefix=/usr/local/${APP_NAME} \
\ --enable-dynamic \
--enable-dynamic --enable-syslog \ --enable-slapd --enable-cleartext --enable-crypt --enable-spasswd --enable-modules \
\ --enable-bdb --enable-mdb --enable-ndb=no --enable-sql=no \
--enable-slapd --enable-cleartext --enable-crypt --enable-spasswd --enable-modules --enable-rlookups --enable-wrappers \ --enable-overlays \
\ --with-cyrus-sasl --with-tls=openssl \
--enable-dnssrv=mod --enable-ldap=mod --enable-mdb=mod --enable-meta=mod --enable-asyncmeta=mod --enable-null=mod \
--enable-passwd=mod --enable-perl=mod --enable-relay=mod --enable-sock=mod --enable-sql=mod \
\
--enable-overlays=mod --enable-accesslog=mod --enable-auditlog=mod --enable-autoca=mod --enable-collect=mod \
--enable-constraint=mod --enable-dds=mod --enable-deref=mod --enable-dyngroup=mod --enable-dynlist=mod \
--enable-homedir=mod --enable-memberof=mod --enable-otp=mod --enable-ppolicy=mod --enable-refint=mod \
--enable-remoteauth=mod --enable-retcode=mod --enable-sssvlv=mod --enable-syncprov=mod --enable-unique=mod \
--enable-valsort=mod \
\
--enable-argon2 \
\
--enable-balancer=mod \
\
--with-cyrus-sasl --with-tls=openssl --with-systemd=no --with-argon2=libsodium \
; \ ; \
make depend; \ make depend; \
make -j "$(nproc)" && make install; make -j "$(nproc)" && make install;
@@ -111,7 +96,7 @@ ENV APP_NAME=${APP_NAME} \
APP_VER=${APP_VER} \ APP_VER=${APP_VER} \
APP_EXEC=slapd \ APP_EXEC=slapd \
APP_USER=${APP_NAME} \ APP_USER=${APP_NAME} \
LD_LIBRARY_PATH="/usr/local/${APP_NAME}/lib:/usr/local/${APP_NAME}/libexec/openldap" \ LD_LIBRARY_PATH="/usr/local/${APP_NAME}/lib" \
PATH="${PATH}:/usr/local/${APP_NAME}/sbin:/usr/local/${APP_NAME}/bin:/usr/local/${APP_NAME}/libexec" PATH="${PATH}:/usr/local/${APP_NAME}/sbin:/usr/local/${APP_NAME}/bin:/usr/local/${APP_NAME}/libexec"
LABEL \ LABEL \
@@ -147,7 +132,7 @@ RUN set -eux; \
[ -e "${overrideShell}" ] && /bin/bash "${overrideShell}"; \ [ -e "${overrideShell}" ] && /bin/bash "${overrideShell}"; \
\ \
# 验证安装的应用 # 验证安装的应用
${APP_EXEC} -VV; ${APP_EXEC} -V;
# 配置容器的数据卷、工作目录及服务端口(必须保证端口在1024之上) # 配置容器的数据卷、工作目录及服务端口(必须保证端口在1024之上)
VOLUME ["/srv/${APP_NAME}/conf", "/srv/${APP_NAME}/data", "/srv/${APP_NAME}/cert", "/srv/${APP_NAME}/log"] VOLUME ["/srv/${APP_NAME}/conf", "/srv/${APP_NAME}/data", "/srv/${APP_NAME}/cert", "/srv/${APP_NAME}/log"]
+7 -7
View File
@@ -8,13 +8,13 @@
**版本信息:** **版本信息:**
- 2.6、latest - 2.4
**镜像信息:** **镜像信息:**
* 镜像地址: * 镜像地址:
* 阿里云: registry.cn-shenzhen.aliyuncs.com/colovu/openldap:latest * 阿里云: registry.cn-shenzhen.aliyuncs.com/colovu/openldap:2.4
* Colovu Registry: docker.colovu.com/colovu/openldap:latest * Colovu Registry: docker.colovu.com/colovu/openldap:2.4
* 依赖镜像:colovu/debian:12 * 依赖镜像:colovu/debian:12
> 后续相关命令行默认使用 Aliyun ACR 镜像服务器做说明 > 后续相关命令行默认使用 Aliyun ACR 镜像服务器做说明
@@ -25,7 +25,7 @@ Docker 快速启动命令:
```shell ```shell
# 从 Registry 服务器下载镜像并启动 # 从 Registry 服务器下载镜像并启动
$ docker run -d --name imgname registry.cn-shenzhen.aliyuncs.com/colovu/openldap:latest $ docker run -d --name imgname registry.cn-shenzhen.aliyuncs.com/colovu/openldap:2.4
``` ```
- `registry.cn-shenzhen.aliyuncs.com/colovu/imgname:<TAG>`:镜像名称及版本标签 TAG;标签不指定时默认使用最新版本 - `registry.cn-shenzhen.aliyuncs.com/colovu/imgname:<TAG>`:镜像名称及版本标签 TAG;标签不指定时默认使用最新版本
@@ -92,7 +92,7 @@ $ docker run --detach --rm --name openldap \
--env LDAP_BIND_PASSWORD=bindpassword \ --env LDAP_BIND_PASSWORD=bindpassword \
--env LDAP_USERS=customuser \ --env LDAP_USERS=customuser \
--env LDAP_PASSWORDS=custompassword \ --env LDAP_PASSWORDS=custompassword \
registry.cn-shenzhen.aliyuncs.com/colovu/openldap:latest registry.cn-shenzhen.aliyuncs.com/colovu/openldap:2.4
``` ```
则 OpenLDAP 容器初始化完成后,相关配置信息如下: 则 OpenLDAP 容器初始化完成后,相关配置信息如下:
@@ -138,7 +138,7 @@ $ docker run -it --rm --name mariadb-client \
在初始化 `OpenLDAP` 容器时,如果没有预置配置文件,可以在命令行中设置相应环境变量对默认参数进行修改。类似命令如下(配置环境变量`APP_ENV_KEY_NAME`的值为`key_value`): 在初始化 `OpenLDAP` 容器时,如果没有预置配置文件,可以在命令行中设置相应环境变量对默认参数进行修改。类似命令如下(配置环境变量`APP_ENV_KEY_NAME`的值为`key_value`):
```shell ```shell
$ docker run -d -e "APP_ENV_KEY_NAME=key_value" registry.cn-shenzhen.aliyuncs.com/openldap:latest $ docker run -d -e "APP_ENV_KEY_NAME=key_value" registry.cn-shenzhen.aliyuncs.com/openldap:2.4
``` ```
### 常规配置参数 ### 常规配置参数
@@ -212,7 +212,7 @@ $ docker run -d -e "APP_ENV_KEY_NAME=key_value" registry.cn-shenzhen.aliyuncs.co
## 更新记录 ## 更新记录
- 2023/9/25 (2.6): 更新版本,基于 OpenLDAP 2.6.6Debian 12。 - 2021/7/1 (2.4): 初始版本,基于 OpenLDAP 2.4.59
---- ----
+3 -3
View File
@@ -4,7 +4,7 @@
# 应用通用业务处理函数 # 应用通用业务处理函数
# {0}config # {0}config
# {-1}frontend # {-1}frontend
# {1}mdb # {1}hdb
# {2}monitor # {2}monitor
. /colovu/lib/libcommon.sh # 通用函数库 . /colovu/lib/libcommon.sh # 通用函数库
@@ -57,7 +57,7 @@ app_root_credentials() {
cat > "${APP_CONF_DIR}/default_rootdn.ldif" << EOF cat > "${APP_CONF_DIR}/default_rootdn.ldif" << EOF
# RootDN configration # RootDN configration
dn: olcDatabase={1}mdb,cn=config dn: olcDatabase={1}hdb,cn=config
changetype: modify changetype: modify
replace: olcSuffix replace: olcSuffix
olcSuffix: $LDAP_ROOT olcSuffix: $LDAP_ROOT
@@ -89,7 +89,7 @@ olcAccess: {0}to *
by dn.base="${LDAP_ADMIN_DN}" read by dn.base="${LDAP_ADMIN_DN}" read
by * none by * none
dn: olcDatabase={1}mdb,cn=config dn: olcDatabase={1}hdb,cn=config
changetype: modify changetype: modify
replace: olcAccess replace: olcAccess
olcAccess: {0}to * olcAccess: {0}to *
+2 -2
View File
@@ -25,8 +25,8 @@ for dir in ${APP_DIRS[@]}; do
done done
# 检测指定文件是否在配置文件存储目录存在,如果不存在则拷贝(新挂载数据卷、手动删除都会导致不存在) # 检测指定文件是否在配置文件存储目录存在,如果不存在则拷贝(新挂载数据卷、手动删除都会导致不存在)
LOG_I "Check config files in: ${LDAP_ONLINE_CONF_DIR}" LOG_I "Check config files in: ${APP_CONF_DIR}"
if [[ -z "$(ls -A "${LDAP_ONLINE_CONF_DIR}")" ]]; then if [[ -z "$(ls -A "${APP_CONF_DIR}")" ]]; then
app_ensure_config_file_exist "${APP_CONF_DIR}" "${APP_DEF_DIR}" $(ls -A "${APP_DEF_DIR}") app_ensure_config_file_exist "${APP_CONF_DIR}" "${APP_DEF_DIR}" $(ls -A "${APP_DEF_DIR}")
fi fi
@@ -27,13 +27,12 @@ dn: cn=module,cn=config
objectClass: olcModuleList objectClass: olcModuleList
cn: module cn: module
olcModulepath: /usr/local/openldap/libexec/openldap olcModulepath: /usr/local/openldap/libexec/openldap
olcModuleload: back_mdb.la olcModuleload: back_hdb.la
olcModuleload: back_monitor.la olcModuleload: back_monitor.la
#olcModuleload: back_bdb.la
olcModuleload: memberof.la
olcModuleload: refint.la olcModuleload: refint.la
olcModuleload: ppolicy.la olcModuleload: memberof.la
#olcModuleload: syncprov.la #olcModuleload: syncprov.la
#olcModuleload: ppolicy.la
# #
# Schema settings # Schema settings
@@ -44,17 +43,6 @@ cn: schema
include: file:///srv/openldap/conf/schema/core.ldif include: file:///srv/openldap/conf/schema/core.ldif
#
# Define global ACLs to disable default read access.
#
#
# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn. (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!
#
# #
# Frontend settings, olcDatabase: -1 # Frontend settings, olcDatabase: -1
# #
@@ -75,11 +63,10 @@ olcAccess: to * by * manage
# #
# Backend database definitions, olcDatabase: 1 # Backend database definitions, olcDatabase: 1
# #
dn: olcDatabase=mdb,cn=config dn: olcDatabase=hdb,cn=config
objectClass: olcDatabaseConfig objectClass: olcDatabaseConfig
objectClass: olcMdbConfig objectClass: olcHdbConfig
olcDatabase: mdb olcDatabase: hdb
olcDbMaxSize: 1073741824
olcSuffix: dc=example,dc=com olcSuffix: dc=example,dc=com
olcRootDN: cn=root,dc=example,dc=com olcRootDN: cn=root,dc=example,dc=com
olcDbDirectory: /srv/openldap/data olcDbDirectory: /srv/openldap/data
@@ -93,34 +80,32 @@ olcAccess: to * by * manage
dn: olcDatabase=monitor,cn=config dn: olcDatabase=monitor,cn=config
objectClass: olcDatabaseConfig objectClass: olcDatabaseConfig
olcDatabase: monitor olcDatabase: monitor
olcRootDN: cn=config
olcMonitoring: FALSE
olcAccess: to * by * manage olcAccess: to * by * manage
# #
# Add overlay # Add overlay
# #
#dn: olcOverlay=memberof,olcDatabase={1}mdb,cn=config dn: olcOverlay=memberof,olcDatabase={1}hdb,cn=config
#objectClass: olcConfig objectClass: olcConfig
#objectClass: olcMemberOf objectClass: olcMemberOf
#objectClass: olcOverlayConfig objectClass: olcOverlayConfig
#objectClass: top objectClass: top
#olcOverlay: memberof olcOverlay: memberof
#olcMemberOfDangling: ignore olcMemberOfDangling: ignore
#olcMemberOfRefInt: TRUE olcMemberOfRefInt: TRUE
#olcMemberOfGroupOC: groupOfNames olcMemberOfGroupOC: groupOfNames
#olcMemberOfMemberAD: member olcMemberOfMemberAD: member
#olcMemberOfMemberOfAD: memberOf olcMemberOfMemberOfAD: memberOf
#dn: olcOverlay=refint,olcDatabase={1}mdb,cn=config dn: olcOverlay=refint,olcDatabase={1}hdb,cn=config
#objectClass: olcConfig objectClass: olcConfig
#objectClass: olcOverlayConfig objectClass: olcOverlayConfig
#objectClass: olcRefintConfig objectClass: olcRefintConfig
#objectClass: top objectClass: top
#olcOverlay: refint olcOverlay: refint
#olcRefintAttribute: memberof uniqueMember owner olcRefintAttribute: memberof uniqueMember owner
#dn: olcOverlay=ppolicy,olcDatabase={1}mdb,cn=config #dn: olcOverlay=ppolicy,olcDatabase={1}hdb,cn=config
#objectClass: olcConfig #objectClass: olcConfig
#objectClass: olcOverlayConfig #objectClass: olcOverlayConfig
#objectClass: olcPPolicyConfig #objectClass: olcPPolicyConfig