# 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,%E5%8F%82%E7%85%A7JIRA%E7%9A%84%E5%AE%89%E8%A3%85%E6%B5%81%E7%A8%8B%EF%BC%8C%E8%BF%9B%E8%A1%8C%E6%93%8D%E4%BD%9C%E3%80%82%E5%8F%AF%E5%9C%A8%E5%BC%95%E5%AF%BC%E8%BF%87%E7%A8%8B%E4%B8%AD%EF%BC%8C%E4%B8%8E%E4%B9%8B%E5%89%8D%E5%AE%89%E8%A3%85%E7%9A%84JIRA%E8%BF%9B%E8%A1%8C%E7%BB%91%E5%AE%9A%E5%85%B3%E8%81%94%E3%80%82)

破解

```
# 设置产品类型：-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%';
```
