> For the complete documentation index, see [llms.txt](https://sphantix-hang.gitbook.io/timebook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sphantix-hang.gitbook.io/timebook/2.-huan-jing-pian/gong-ju-bu-shu-he-shi-yong/tuan-dui-xie-zuo-gong-ju/confluence.md).

# Confluence

Confluence 是一个团队文件分享的工具，可以作为团队wiki使用

## 安装

### 资源

[github](https://github.com/cptactionhank/docker-atlassian-confluence)

[docker hub](https://hub.docker.com/r/cptactionhank/atlassian-confluence)

[crack tool](https://gitee.com/pengzhile/atlassian-agent/releases)

**最新的版本通过上面的链接获取**

### 制作Docker破解容器

#### 编写Dockerfile文件：

```
FROM cptactionhank/atlassian-confluence:7.4.0

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
```

#### 下载[atlassian-agent.jar](https://gitee.com/pengzhile/atlassian-agent/attach_files/283101/download)文件，放置在Dockerfile同目录下，例如：

```
- Confluence
  --Dockerfile
  --atlassian-agent.jar
```

#### 构建镜像，执行命令

```
docker build -f Dockerfile -t confluence/confluence:7.4.0 .
```

执行结果：

```
Sending build context to Docker daemon  976.9kB
Step 1/4 : FROM cptactionhank/atlassian-confluence:7.4.0
7.4.0: Pulling from cptactionhank/atlassian-confluence
e7c96db7181b: Already exists
f910a506b6cb: Already exists
c2274a1a0e27: Already exists
a5c3b569088d: Pull complete
bac4503bc7b1: Pull complete
Digest: sha256:81328762c945e51c69c0b2ba1a2c5f3d4a30654c11f671ca0e3c9710660de123
Status: Downloaded newer image for cptactionhank/atlassian-confluence:7.4.0
 ---> 9d22f0059582
Step 2/4 : USER root
 ---> Running in 79b88d1ddad3
Removing intermediate container 79b88d1ddad3
 ---> 68d1b1eb8467
Step 3/4 : COPY "atlassian-agent.jar" /opt/atlassian/confluence/
 ---> 9918c17af102
Step 4/4 : RUN echo 'export CATALINA_OPTS="-javaagent:/opt/atlassian/confluence/atlassian-agent.jar ${CATALINA_OPTS}"' >> /opt/atlassian/confluence/bin/setenv.sh
 ---> Running in e0787975c651
Removing intermediate container e0787975c651
 ---> 391dbea79963
Successfully built 391dbea79963
Successfully tagged confluence/confluence:7.4.0
```

#### 启动容器

```
docker run --detach --publish 8090:8090 confluence/confluence:7.4.0
```

#### 访问[http://127.0.0.1:8090,参照JIRA的安装流程，进行操作。可在引导过程中，与之前安装的JIRA进行绑定关联。](http://127.0.0.1/:8090,参照JIRA的安装流程，进行操作。可在引导过程中，与之前安装的JIRA进行绑定关联。)

破解

```
# 设置产品类型：-p conf， 详情可执行：java -jar atlassian-agent.jar 
java -jar atlassian-agent.jar -d -m test@test.com -n BAT -p conf -o http://192.168.0.89 -s BY9B-GWD1-1C78-K2DE
```

### MySQL配置

```sql
--创建confluence数据库及用户
create database confdb character set 'UTF8';
create user confuser identified by 'conf';
grant all privileges on *.* to 'confuser'@'%' identified by 'conf' with grant option;
grant all privileges on *.* to 'confuser'@'localhost' identified by 'conf' with grant option;
flush privileges;

-- 设置confdb事务级别
show variables like 'tx%';
set session transaction isolation level read committed;
show variables like 'tx%';
```
