1 Star 0 Fork 14

江南叶少 / virtual-ldap

forked from zheng / virtual-ldap 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

基于钉钉通讯录搭建LDAP服务

流程

workflow

钉钉中应用效果

修改个人密码

员工账号管理

注意:管理员仅可查看所在部门下属员工

同步策略

  • Web服务端

    启动后等待30秒,从钉钉开放平台获取部门、人员数据

    若部门/人员新增,本地数据库中不存在,则同步至数据库中,并同步部门人员关系

    • 默认同步后,若人员为该组织的管理人员或部门管理人员,则在服务端中是管理员身份,可查看当前部门及下属部门人员信息,为下属部门人员开通账号。
  • 默认同步后的人员账号,根据姓名生成;如 张三 ,生成的账号为 zhangsan若非管理员身份,账号默认禁用 ,需要上级管理人员为该账号开通。

    • 开通后的账号,可在钉钉自建H5应用中修改密码,只有修改了密码,该账号方可在各平台使用。
    • 当钉钉通讯录中发生变更时,由钉钉开发者平台回调,向Web服务端推送相关事件消息,处理相关逻辑。
  • LDAP

    • 每一分钟从服务端同步一次部门/人员数据
    • 若服务端无法正常访问,则使用最近一次同步数据
    • 默认只同步开通账号的人员,开通后,若需要在各平台正常使用,需要在钉钉自建H5应用中修改初始密码

钉钉回调事件配置

dingding_callback_event

源码运行

应用创建

dingding_create_app

修改配置

dingding_config1 dingding_config2 dingding_config3
# 1、进入相关目录
cd docker-compose

# 2、修改configs目录下appsettings.json中钉钉相关配置(如上图)

# 3、使用docker compose运行
docker compose up -d

Jenkins

使用Docker运行jenkins

# 使用docker运行jenkins,并设置插件源为清华大学
# Windows下运行,请将每后结尾的 \ 替换为 ^
docker run -itd  --name jenkins --privileged --restart always --privileged=true \
-e TZ=Asia/Shanghai \
-e JENKINS_UC_DOWNLOAD=https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json \
-p 9999:8080 -p 50000:50000 \
-v /d/ldap-docker-config/jenkins:/var/jenkins_home \
jenkins/jenkins:lts-jdk11

打开浏览器进入jenkins界面 http://localhost:9999
输入密码

# 进入jenkins容器
docker exec -it jenkins bash

# 查看jenkins默认密码,使用默认密码登录jenkins
more /var/jenkins_home/secrets/initialAdminPassword

ldap browse

安装LDAP插件

  • 初次进入自由选择插件时选择
ldap browse - 进入Jenkins后选择 ldap browse

Jenkins设置LDAP

  • Server : IP:389
  • root DN : dc=example,dc=com
  • Group search base : ou=Staff, ou=Groups, o=demo
  • Manager DN : cn=jenkins, dc=example, dc=com
  • Display Name LDAP attribute : cn
  • Email Address LDAP attribute : uid
ldap browse

参考

ldap-server源码参考 xiaoquqi/virtual-ldap

The MIT License (MIT) Copyright (c) 2020 ohdarling88 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

利用钉钉通讯录同步搭建LDAP服务,支持通讯录变更回调 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/yemuchen/virtual-ldap.git
git@gitee.com:yemuchen/virtual-ldap.git
yemuchen
virtual-ldap
virtual-ldap
master

搜索帮助