Skip to content

Commit daacc20

Browse files
committed
2 parents 1a11e7c + bbb51b5 commit daacc20

File tree

6 files changed

+58
-182
lines changed

6 files changed

+58
-182
lines changed

README.md

+53-181
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
1-
<h1 align="center">Go-Ldap-Admin</h1>
2-
3-
<div align="center">
4-
基于Go+Vue实现的openLDAP后台管理项目。
51
<p align="center">
6-
<img src="https://img.shields.io/github/go-mod/go-version/eryajf-world/go-ldap-admin" alt="Go version"/>
7-
<img src="https://img.shields.io/badge/Gin-1.6.3-brightgreen" alt="Gin version"/>
8-
<img src="https://img.shields.io/badge/Gorm-1.20.12-brightgreen" alt="Gorm version"/>
9-
<img src="https://img.shields.io/github/license/eryajf-world/go-ldap-admin" alt="License"/>
2+
<a href="" rel="noopener">
3+
<img src="https://cdn.staticaly.com/gh/eryajf/tu/main/img/image_20220607_174313.png" alt="Project logo"></a>
104
</p>
5+
<h1 align="center">Go Ldap Admin</h1>
6+
7+
8+
<div align="center">
9+
10+
11+
[![Go Version](https://img.shields.io/github/go-mod/go-version/eryajf-world/go-ldap-admin)](https://github.com/eryajf/go-ldap-admin)
12+
[![Gin Version](https://img.shields.io/badge/Gin-1.6.3-brightgreen)](https://github.com/eryajf/go-ldap-admin)
13+
[![Gorm Version](https://img.shields.io/badge/Gorm-1.20.12-brightgreen)](https://github.com/eryajf/go-ldap-admin)
14+
[![Status](https://img.shields.io/badge/status-active-success.svg)](https://github.com/eryajf/go-ldap-admin)
15+
[![GitHub Issues](https://img.shields.io/github/issues/eryajf/go-ldap-admin.svg)](https://github.com/eryajf/go-ldap-admin/issues)
16+
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/eryajf/go-ldap-admin)](https://github.com/eryajf/go-ldap-admin/pulls)
17+
[![GitHub Pull Requests](https://img.shields.io/github/stars/eryajf/go-ldap-admin)](https://github.com/eryajf/go-ldap-admin/stargazers)
18+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
19+
1120
</div>
1221

22+
23+
---
24+
25+
<p align="center"> 🌉 基于Go+Vue实现的openLDAP后台管理项目。
26+
<br>
27+
</p>
28+
1329
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1430
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1531
**目录**
@@ -30,9 +46,14 @@
3046

3147
## 在线体验
3248

33-
> admin / 123456
49+
提供在线体验地址如下:
3450

35-
演示地址:[http://demo-go-ldap-admin.eryajf.net](http://demo-go-ldap-admin.eryajf.net)
51+
| 分类 | 地址 | 用户名 | 密码 |
52+
| :-----------: | :----------------------------------------------------------: | :-----------------------: | ------ |
53+
| go-ldap-admin | [http://demo-go-ldap-admin.eryajf.net](http://demo-go-ldap-admin.eryajf.net) | admin | 123456 |
54+
| phpLdapAdmin | [http://demo-go-ldap-admin.eryajf.net:8091/](http://demo-go-ldap-admin.eryajf.net:8091/) | cn=admin,dc=eryajf,dc=net | 123456 |
55+
56+
在线环境可能不稳,如果遇到访问异常,或者数据错乱,请联系我进行修复。
3657

3758
## 项目地址
3859

@@ -41,151 +62,16 @@
4162
| 后端 | https://github.com/eryajf/go-ldap-admin.git | https://gitee.com/eryajf-world/go-ldap-admin.git |
4263
| 前端 | https://github.com/eryajf/go-ldap-admin-ui.git | https://gitee.com/eryajf-world/go-ldap-admin-ui.git |
4364

44-
## 核心功能
45-
46-
- 基于 GIN WEB API 框架,基于Casbin的 RBAC 访问控制模型,JWT 认证,Validator 参数校验
47-
- 基于 GORM 的数据库存储
48-
- 基于 go-ldap 库的主逻辑交互
49-
- 用户管理
50-
- 用户的增删改查
51-
- 分组管理
52-
- 分组的增删改查
53-
- 分组内成员的管理
54-
55-
## 快速开始
56-
57-
你可以通过docker-compose在本地快速拉起进行体验。
58-
59-
快速拉起的容器包括:MySQL-5.7,openLDAP-1.4.0,phpldapadmin-0.9.0,go-ldap-admin-server,go-ldap-admin-ui。
60-
61-
服务端口映射如下:
62-
63-
| Service | Port |
64-
| :-----------: | :-------------------: |
65-
| MySQL | `3307:3306` |
66-
| openLDAP | `389:389` |
67-
| phpldapadmin | `8091:80` |
68-
| go-ldap-admin | `8090:80`,`8888:8888` |
69-
70-
拉起之前确认是否有与本地端口冲突的情况。
71-
72-
```
73-
$ git clone https://github.com/eryajf/go-ldap-admin.git
74-
75-
$ cd docs/docker-compose
76-
77-
$ docker-compose up -d
78-
```
79-
80-
当看到容器都正常运行之后,可以在本地进行访问:http://localhost:8090,用户名/密码:admin/123456
81-
如果想要访问PhpLdapAdmin,则可访问:http://localhost:8091,用户名/密码:cn=admin,dc=eryajf,dc=net/123456
82-
83-
`登录页:`
84-
85-
![](http://t.eryajf.net/imgs/2022/05/17dbe07a137c9b4c.png)
86-
87-
`首页:`
88-
89-
![](http://t.eryajf.net/imgs/2022/05/b18c5fbf5ba0e6af.png)
90-
91-
`用户管理:`
92-
93-
![](http://t.eryajf.net/imgs/2022/05/f3ae695b703c00c8.png)
94-
95-
`分组管理:`
96-
97-
![](http://t.eryajf.net/imgs/2022/05/e49632b76a4327ec.png)
98-
99-
`分组内成员管理:`
100-
101-
![](http://t.eryajf.net/imgs/2022/05/f1732540ce0632de.png)
102-
103-
## 本地开发
104-
105-
### 前言准备
65+
## 文档快链
10666

107-
前提是已准备好MySQL与openLDAP,本地开发建议直接通过docker拉起即可,可参考文档:[https://wiki.eryajf.net/pages/3a0d5f](https://wiki.eryajf.net/pages/3a0d5f)
67+
项目相关介绍,使用,最佳实践等相关内容,都会在官方文档呈现,如有疑问,请先阅读官方文档,以下列举以下常用快链
10868

109-
### 拉取代码
110-
111-
```
112-
# 后端代码
113-
$ git clone https://github.com/eryajf/go-ldap-admin.git
114-
115-
# 前端代码
116-
$ git clone https://github.com/eryajf/go-ldap-admin-ui.git
117-
```
118-
119-
后端目录结构:
120-
121-
```
122-
├─config # viper读取配置
123-
├─controller # controller层,响应路由请求的方法
124-
├─docs # 一些物料信息
125-
├─logic # 主要的处理逻辑
126-
├─middleware # 中间件
127-
├─model # 结构体模型
128-
├─public # 一些公共的,工具类的放在这里
129-
├─routes # 所有路由
130-
├─service # 整合与底层存储交互的方法
131-
├─svc # 定义入参出参的结构体
132-
└─test # 跑测试用的
133-
```
134-
135-
### 更改配置
136-
137-
```
138-
# 修改后端配置
139-
$ cd go-ldap-admin
140-
# 文件路径 config.yml
141-
$ vim config.yml
142-
143-
# 根据自己本地的情况,调整数据库以及openLDAP等配置信息。
144-
```
145-
146-
### 启动服务
147-
148-
```
149-
# 启动后端
150-
$ cd go-ldap-admin
151-
$ go mod tidy
152-
$ go run main.go
153-
$ make run
154-
155-
# 启动前端
156-
$ cd go-ldap-admin-ui
157-
$ git config --global url."https://".insteadOf git://
158-
$ npm install --registry=http://registry.npmmirror.com
159-
$ yarn dev
160-
```
161-
162-
本地访问:http://localhost:8090,用户名/密码:admin/密码是配置文件中openLDAP中admin的密码。
163-
164-
## 生产部署
165-
166-
生产环境单独部署,通过Nginx代理服务,配置如下:
167-
168-
```nginx
169-
server {
170-
listen 80;
171-
server_name demo-go-ldap-admin.eryajf.net;
172-
173-
root /data/www/web/dist;
174-
175-
location / {
176-
try_files $uri $uri/ /index.html;
177-
add_header Cache-Control 'no-store';
178-
}
179-
180-
location /api/ {
181-
proxy_set_header Host $http_host;
182-
proxy_set_header X-Real-IP $remote_addr;
183-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
184-
proxy_set_header X-Forwarded-Proto $scheme;
185-
proxy_pass http://127.0.0.1:8888;
186-
}
187-
}
188-
```
69+
- [官网地址](http://ldapdoc.eryajf.net)
70+
- [项目背景](http://ldapdoc.eryajf.net/pages/101948/)
71+
- [快速开始](http://ldapdoc.eryajf.net/pages/706e78/)
72+
- [功能概览](http://ldapdoc.eryajf.net/pages/7a40de/)
73+
- [本地开发](http://ldapdoc.eryajf.net/pages/cb7497/)
74+
- [生产部署](http://ldapdoc.eryajf.net/pages/5769c4/)
18975

19076
## 感谢
19177

@@ -209,6 +95,19 @@ server {
20995
- 如果你还有其他想法或者需求,欢迎在issue中交流!
21096
- 程序还有很多bug,欢迎各位朋友一起协同共建!
21197

98+
99+
## 加群
100+
101+
如果想要加群交流,可通过搜索 eryajf 添加我的微信,备注 ldap 拉你进群。
102+
103+
## 捐赠
104+
105+
如果你觉得这个项目对你有帮助,你可以请作者喝杯咖啡 ☕️ [点我](http://ldapdoc.eryajf.net/pages/2b6725/)
106+
107+
## 使用登记
108+
109+
如果你所在公司使用了该项目,烦请在这里留下脚印,感谢支持🥳 [点我](https://github.com/eryajf/go-ldap-admin/issues/18)
110+
212111
## 贡献者
213112

214113
<!-- readme: collaborators,contributors -start -->
@@ -236,31 +135,4 @@ server {
236135
</a>
237136
</td></tr>
238137
</table>
239-
<!-- readme: collaborators,contributors -end -->
240-
241-
242-
## 加群
243-
244-
可通过搜索 eryajf 添加我的微信,备注 ldap 拉你进群。
245-
246-
## 为什么有这个项目
247-
248-
我曾经经历的公司强依赖openLDAP来作为企业内部员工管理的平台,并通过openLDAP进行各平台的认证打通工作。
249-
250-
但成也萧何败也萧何,给运维省力的同时,ldap又是维护不够友好的。
251-
252-
[godap](https://github.com/bradleypeabody/godap)项目中,作者这样描述对ldap的感受:
253-
254-
> The short version of the story goes like this: I hate LDAP. I used to love it. But I loved it for all the wrong reasons. LDAP is supported as an authentication solution by many different pieces of software. Aside from its de jure standard status, its wide deployment cements it as a de facto standard as well.
255-
>
256-
> However, just because it is a standard doesn't mean it is a great idea.
257-
>
258-
> I'll admit that given its age LDAP has had a good run. I'm sure its authors carefully considered how to construct the protocol and chose ASN.1 and its encoding with all of wellest of well meaning intentions.
259-
>
260-
> The trouble is that with today's Internet, LDAP is just a pain in the ass. You can't call it from your browser. It's not human readable or easy to debug. Tooling is often arcane and confusing. It's way more complicated than what is needed for most simple authentication-only uses. (Yes, I know there are many other uses than authentication - but it's often too complicated for those too.)
261-
>
262-
> Likely owing to the complexity of the protocol, there seems to be virtually no easy to use library to implement the server side of the LDAP protocol that isn't tied in with some complete directory server system; and certainly not in a language as easy to "make it work" as Go.
263-
264-
他说他对ldap又爱又恨,因为ldap出现的最早,许多的三方软件都兼容支持它,它成了这方面的一个标准。但问题在于,它对于维护者而言,又是复杂麻烦的。就算是有Phpldapadmin这样的平台能够在浏览器维护,但看到那样上古的界面,以及复杂的交互逻辑,仍旧能够把不少人劝退。
265-
266-
鉴于此,我开发了这个现代化的openLDAP管理后台。
138+
<!-- readme: collaborators,contributors -end -->

src/assets/backgd-image/back.jpeg

-3.08 MB
Binary file not shown.

src/assets/backgd-image/login.jpeg

511 KB
Loading

src/views/login/index.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default {
7070
}
7171
}
7272
return {
73-
imgSrc: require('@/assets/backgd-image/back.jpeg'),
73+
imgSrc: require('@/assets/backgd-image/login.jpeg'),
7474
loginForm: {
7575
username: '',
7676
password: ''
@@ -277,6 +277,8 @@ $light_gray:#eee;
277277
background-color: rgba(0,0,0,0.5);
278278
// overflow: hidden;
279279
border-radius: 8px;
280+
margin-left: 850px;
281+
margin-top: -125px;
280282
}
281283
282284
.svg-container {

src/views/personnel/group/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<el-table-column type="selection" width="55" align="center" />
3030
<el-table-column show-overflow-tooltip sortable prop="groupName" label="名称" />
3131
<el-table-column show-overflow-tooltip sortable prop="groupType" label="类型" />
32+
<el-table-column show-overflow-tooltip sortable prop="groupDn" label="DN" />
3233
<el-table-column show-overflow-tooltip sortable prop="remark" label="描述" />
3334
<el-table-column fixed="right" label="操作" align="center" width="220">
3435
<template #default="scope">

src/views/personnel/user/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<el-table-column show-overflow-tooltip sortable prop="position" label="职位" />
4949
<el-table-column show-overflow-tooltip sortable prop="creator" label="创建人" />
5050
<el-table-column show-overflow-tooltip sortable prop="introduction" label="说明" />
51+
<el-table-column show-overflow-tooltip sortable prop="userDn" label="DN" />
5152
<el-table-column fixed="right" label="操作" align="center" width="120">
5253
<template slot-scope="scope">
5354
<el-tooltip content="编辑" effect="dark" placement="top">

0 commit comments

Comments
 (0)