keyfil/教程/20250110-Confluence安装及SSO接入指南.md
liuxiaohua cd0b30796f
All checks were successful
Publish to Confluence / confluence (push) Successful in 3m39s
♻️ [2025-02-10] 梳理项目结构
2025-02-10 09:21:02 +08:00

141 lines
3.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- Space: qifu -->
<!-- Parent: 后端技术&知识&规范 -->
<!-- Parent: 技术方案 -->
<!-- Parent: 基建 -->
<!-- Parent: 03-接入指南 -->
<!-- Title: 20250110-Confluence安装及SSO接入指南 -->
<!-- Attachment: ../材料/atlassian-agent.jar -->
<!-- Macro: :anchor\((.*)\):
Template: ac:anchor
Anchor: ${1} -->
<!-- Macro: \!\[.*\]\((.+)\)\<\!\-\- width=(.*) \-\-\>
Template: ac:image
Url: ${1}
Width: ${2} -->
<!-- Macro: \<\!\-\- :toc: \-\-\>
Template: ac:toc
Printable: 'false'
MinLevel: 2
MaxLevel: 4 -->
<!-- Include: 杂项/声明文件.md -->
<!-- :toc: -->
# Confluence 安装及 SSO 接入指南
## Confluence 安装启动
- 可以参考https://www.iots.vip/post/atlassian-series-crack
### 获取 Agent
从合法渠道获取可用 Agent [`atlassian-agent.jar`](../材料/atlassian-agent.jar)
### 构建 Confluence 镜像
#### 创建 Dockerfile 文件
```dockerfile
FROM cptactionhank/atlassian-confluence:7.9.3
USER root
#- 将破解包加入容器
COPY "atlassian-agent.jar" /opt/atlassian/confluence/
#- 设置启动加载
RUN echo 'export CATALINA_OPTS="-javaagent:/opt/atlassian/confluence/atlassian-agent.jar ${CATALINA_OPTS}"' >> /opt/atlassian/confluence/bin/setenv.sh
```
#### 生成镜像
```shell
docker build -f Dockerfile -t confluence/confluence:7.9.3 .
```
### Docker Compose 启动
#### 创建 docker compose 文件
```yaml
version: '3.6'
services:
confluence:
env_file: .env
restart: always
image: confluence/confluence:7.9.3
ports:
- 10000:8090
volumes:
- ./data:/var/atlassian/confluence
```
#### 创建 .env 文件
```properties
CATALINA_OPTS=-Xms1024m -Xmx1024m -Datlassian.plugins.enable.wait=300
```
#### 启动 Confluence
```shell
docker compose up -d
```
#### 查看日志看是否破解成功
```shell
docker logs -f --tail 1000 `docker ps|grep confluence|awk '{print $1}'`
```
- 日志中出现 `============================== agent working ==============================` 表示 Agent 注入成功
#### 浏览器打开 Confluence
- 跟着操作,直到下面界面
![](https://picture.texous.cn/blog/20250110122604762.png)
#### 生成 License
```shell
#- 进入容器
docker exec -it `docker ps|grep confluence|awk '{print $1}'` /bin/bash
#- 生成 license
java -jar atlassian-agent.jar -p conf -m test@test.com -n BAT -o https://www.iots.vip -s ${SERVER_ID}
```
### 插件安装
#### 安装插件
- 进入管理应用,查找新应用
- 搜索 `miniOrange OAuth`
- 点击 `免费试用` 进行应用安装
- ![](https://picture.texous.cn/blog/20250110122844429.png)
- 安装完后进入管理应用
- 点击刚刚安装的应用
- 复制 `应用密钥`
- ![](https://picture.texous.cn/blog/20250110123145726.png)
#### 破解插件
```shell
#- 进入容器
docker exec -it `docker ps|grep confluence|awk '{print $1}'` /bin/bash
#- 生成 license
java -jar atlassian-agent.jar -d -p '${应用密钥}' -m test@test.com -n BAT -o https://www.iots.vip -s ${SERVER_ID}
```
- 将生成的 `license` 复制到输入框
### SSO 插件配置使用
- OIDC 配置:
- ![](https://picture.texous.cn/blog/20250110133936367.png)
- 用户属性映射:
- ![](https://picture.texous.cn/blog/20250110134125731.png)
- 登录按钮配置:
- ![](https://picture.texous.cn/blog/20250110134820772.png)
#### 配置用户组映射
- Keycloak 创建 Confluence 对应的群组
- ![](https://picture.texous.cn/blog/20250116100106765.png)
- Keycloak 用户加入对应的群组
- ![](https://picture.texous.cn/blog/20250116101324209.png)
- Keycloak 客户端添加对应的映射 `客户端 / 客户端范围 / xxx-dedicated / 添加映射器 / 根据配置 / Group Membership`
- ![](https://picture.texous.cn/blog/20250116101738759.png)
- Confluence 配置
- ![](https://picture.texous.cn/blog/20250116102159486.png)
## 参考
- [Confluence](https://www.iots.vip/post/atlassian-series-crack)