feat: update README

This commit is contained in:
vran 2022-03-03 23:10:51 +08:00
parent 444dee0b25
commit a6127d5a0e
17 changed files with 110 additions and 10 deletions

View File

@ -6,20 +6,22 @@
- [部署指引](README/deploy.md)
- [构建指引](README/build.md)
## 快速上手
- [Databasir 之 Github 一键登录OAuth2配置](README/github-oauth2/github-oauth2.md)
- [Databasir 之 Gitlab 一键登录OAuth2配置](README/gitlab-oauth2/gitlab-oauth2.md)
## 简介
**Databasir** 是一款集中式的数据库文档管理工具,提供了自动化、版本化、扁平化的数据库文档管理能力,主要功能如下
1. 支持多种数据库
1. 自动或手动同步数据库 Schema 并生成文档
2. 项目 Schema 历史版本文档查看
3. 项目文档导出,提供 markdown、excel研发中 等格式
4. 团队管理、成员管理一应俱全,扁平化的权限管理模式
5. 安全系数高:数据库密码加密存储,存储后不会再返回前端
1. 理论上支持所有拥有 JDBC 驱动的数据库,目前 mysql、postgresql 可以开箱即用
2. 支持 github / github-enterprise / gitlab 的 OAuth2 登录,全图形化配置
3. 支持手动、定时同步数据库结构并自动生成可读性优秀的文档、UML 图
4. 支持多文件格式导出,如 markdown
5. 历史模型版本化,一键查看历史版本
6. 多人协作字段批注,不再害怕没有注释
7. 扁平化的团队管理模式,灵活适应不同团队组织架构
## 支持数据库
@ -29,14 +31,16 @@
4. - [ ] SqlServer
## 功能规划
- [x] 用户操作审计日志
- [x] 文档自动同步日志
- [ ] Excel 文档导出
- [x] Markdown 文档导出
- [x] Github OAuth2 登录模式
- [x] Gitlab OAuth2 登录模式
- [x] 模型 UML 生成
- [ ] UML 图片导出
## 展示

View File

@ -0,0 +1,60 @@
# Databasir 配置 Github OAuth2 登录
1. **创建 Github OAuth Application**
![github-app-create](img/1-github-oauth2-app-create.png)
2. **填写 Github 应用资料**
Homepage URL 填写你部署 databasir 后,可访问的公网域名。
Authorization callback URL 你可以先填写 {{ databasir 域名 }}/login/oauth2/{{ registrationId }},这里的 registrationId 你可以任意填写,只需要稍后在 Databasir 中配置时保持一致即可,我这里填写了 vran_github
![github-oauth2](img/2-github-oauth2-create.png)
3. 申请 client secret
点击 `Generate a new client secret`,生成秘钥以后记得复制暂存一下,以后是看不见原始秘钥的了
![oauth2-github](img/3-github-oauth2-create.png)
4. 保存 Client Id 和刚刚生成的 Client Secret
![oauth2-github](img/4-github-oauth2-create.png)
5. 进入 Databasir 系统管理 -> 登录设置
![databasir](img/5-github-oauth-create.png)
6. 最后一步,创建并保存登录应用
还记得我在第 2 步时候说的 `registrationId` 吗?那个就对应 databasir 中的 `应用 ID` ,只要两者保持一致就可以成功接受 github 的回调,要是前面配错了也可以在当前页面复制自动生成的 URL 去 github 重新填写 Authorization callback URL 就可以了。
注意授权地址和资源地址
- 授权地址:获取 access_token 的请求地址
- 资源地址:获取用户信息的请求地址
这里填写不一样是因为 github 官方将授权和资源地址分开的,如果你使用的时 github enterprise 版本,授权地址和资源地址其实是一样的。
![](img/6-github-oauth-create.png)
配置完成以后,注销登录后再次进入登录页面就会发现多了一个 github 的小图标,点击就可以使用 github 进行登录
![](img/7-github-oauth-create.png)
点击就会进入授权页面,授权完成就会创建一个新的 databasir 用户,并直接登录成功
![](img/8-github-oauth-create.png)
## 配置 Gitlab OAuth2 登录

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -0,0 +1,36 @@
1. 创建 Gitlab 应用,填写应用名称、回调地址等信息,注意下面授权一定记得勾选上 **read_user**
回调地址填写你访问 databasir 的公网地址 {{ databasir 地址 }}/login/oauth2/{{ 应用ID }}
这里我的应用 id 为 vran-gitlab后面在 databasir 配置的时候需要用上
![](img/1-gitlab-oauth2.png)
2. 保存好应用以后,就可以看见 Application Id 和 Secret复制这两个值
![](img/2-gitlab-oauth2.png)
3. 进入 Databasir 系统管理 -> 登录设置页面
![](img/3-gitlab-oauth2.png)
4. 创建并保存应用信息
- client Id 就对应申请到的 Application Id
- client secret 就对应申请到的 Application secret
- 应用 id 记得和我们第一步填写 redirect uri 时的应用 id 保持一致
![image-20220303225811673](img/4-gitlab-oauth2.png)
5. 保存完成以后注销登录,进入登录页面就可以看见多了一个 gitlab 的登录图标,点击就可以使用 gitlab 来登录了
![](img/5-gitlab-oauth2.png)
注意:如果登录出现 The redirect URI included is not valid. 这样的错误,请检查回调地址是否与 databasir 的地址一致,以及协议是否一致(比如 http 和 https
点击登录以后就会进入授权页面,授权完成以后就会新建一个 databasir 用户并自动完成登录
![](img/6-gitlab-oauth2.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB