Skip to content

Commit

Permalink
fix: update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jonssonyan committed Aug 23, 2023
1 parent 066857b commit 097042c
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 118 deletions.
222 changes: 109 additions & 113 deletions vpress/install-tutorial/custom-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,48 @@

## 准备

#### 安装流程
#### 安装顺序

Docker -> Caddy -> MariaDB -> Redis -> Trojan Panel -> Trojan Panel UI -> Trojan Panel Core
Docker -> Caddy2 -> MariaDB -> Redis -> Trojan Panel Backend -> Trojan Panel Frontend -> Trojan Panel Core

#### 版本对应关系

| 名称 | 版本 |
|-------------------|-------------|
| Docker | latest |
| Nginx | 1.20-alpine |
| Caddy | 2.6.2 |
| MariaDB | 10.7.3 |
| Redis | 6.2.7 |
| Trojan Panel UI | latest |
| Trojan Panel | latest |
| Trojan Panel Core | latest |
| 名称 | 版本 |
|-----------------------|-------------|
| Docker | latest |
| Nginx | 1.20-alpine |
| Caddy2 | 2.6.2 |
| MariaDB | 10.7.3 |
| Redis | 6.2.7 |
| Trojan Panel Frontend | latest |
| Trojan Panel Backend | latest |
| Trojan Panel Core | latest |

## 安装Docker

> Docker官方安装教程:https://docs.docker.com/engine/install/
注意:

1. 如果是国内服务器需要设置Docker国内镜像源

## 安装Caddy
## 安装Caddy2

> Docker Hub:https://hub.docker.com/_/caddy
1. Pull the image

```shell
docker pull caddy:2.6.2
```
```shell
docker pull caddy:2.6.2
```

2. Start a container

```shell
docker run -d --name trojan-panel-caddy --restart always \
--network=host \
-v "${CADDY_CONFIG}":"${CADDY_CONFIG}" \
-v ${CERT_PATH}:"/tpdata/cert/certificates/acme-v02.api.letsencrypt.org-directory/${domain}/" \
-v ${WEB_PATH}:${WEB_PATH} \
-v ${CADDY_LOG}:${CADDY_LOG} \
caddy:2.6.2 caddy run --config ${CADDY_CONFIG}
```
```shell
docker run -d --name trojan-panel-caddy --restart always \
--network=host \
-v "${CADDY_CONFIG}":"${CADDY_CONFIG}" \
-v ${CERT_PATH}:"/tpdata/cert/certificates/acme-v02.api.letsencrypt.org-directory/${domain}/" \
-v ${WEB_PATH}:${WEB_PATH} \
-v ${CADDY_LOG}:${CADDY_LOG} \
caddy:2.6.2 caddy run --config ${CADDY_CONFIG}
```

参数解释:

Expand Down Expand Up @@ -346,21 +342,21 @@ Caddy配置举例
1. Pull the image
```shell
docker pull mariadb:10.7.3
```
```shell
docker pull mariadb:10.7.3
```
2. Start a container
```shell
docker run -d --name trojan-panel-mariadb --restart always \
--network=host \
-e MYSQL_DATABASE="trojan_panel_db" \
-e MYSQL_ROOT_PASSWORD="${mariadb_pas}" \
-e TZ=Asia/Shanghai \
mariadb:10.7.3 \
--port ${mariadb_port}
```
```shell
docker run -d --name trojan-panel-mariadb --restart always \
--network=host \
-e MYSQL_DATABASE="trojan_panel_db" \
-e MYSQL_ROOT_PASSWORD="${mariadb_pas}" \
-e TZ=Asia/Shanghai \
mariadb:10.7.3 \
--port ${mariadb_port}
```
参数解释:
Expand All @@ -378,57 +374,57 @@ mariadb:10.7.3 \
1. Pull the image
```shell
docker pull redis:6.2.7
```
```shell
docker pull redis:6.2.7
```
2. Start a container
```shell
docker run -d --name trojan-panel-redis --restart always \
--network=host \
redis:6.2.7 \
redis-server --requirepass "${redis_pass}" --port ${redis_port}
```
```shell
docker run -d --name trojan-panel-redis --restart always \
--network=host \
redis:6.2.7 \
redis-server --requirepass "${redis_pass}" --port ${redis_port}
```
参数解释:
- `--name trojan-panel-redis`:定义容器的名称
- `--restart always`:容器随着Docker启动而启动
- `--network=host`:使用Host网络模式
- `redis-server --requirepass "${redis_pass}" --port ${redis_port}`:设置Redis密码为`${redis_pass}` 设置Redis端口为`${redis_port}`
(默认:6378)
- `redis-server --requirepass "${redis_pass}" --port ${redis_port}`:设置Redis密码为`${redis_pass}`
设置Redis端口为`${redis_port}`(默认:6378)
## 安装Trojan Panel
> Docker Hub:https://hub.docker.com/r/jonssonyan/trojan-panel
1. Pull the image
```shell
docker pull jonssonyan/trojan-panel
```
```shell
docker pull jonssonyan/trojan-panel
```

2. Start a container

```shell
docker run -d --name trojan-panel --restart always \
--network=host \
-v ${WEB_PATH}:/tpdata/trojan-panel/webfile/ \
-v ${TROJAN_PANEL_LOGS}:/tpdata/trojan-panel/logs/ \
-v ${TROJAN_PANEL_EXPORT}:/tpdata/trojan-panel/export/ \
-v ${TROJAN_PANEL_TEMPLATE}:/tpdata/trojan-panel/template/ \
-v /etc/localtime:/etc/localtime \
-e GIN_MODE=release \
-e "mariadb_ip=${mariadb_ip}" \
-e "mariadb_port=${mariadb_port}" \
-e "mariadb_user=${mariadb_user}" \
-e "mariadb_pas=${mariadb_pas}" \
-e "redis_host=${redis_host}" \
-e "redis_port=${redis_port}" \
-e "redis_pass=${redis_pass}" \
jonssonyan/trojan-panel
```
```shell
docker run -d --name trojan-panel --restart always \
--network=host \
-v ${WEB_PATH}:/tpdata/trojan-panel/webfile/ \
-v ${TROJAN_PANEL_LOGS}:/tpdata/trojan-panel/logs/ \
-v ${TROJAN_PANEL_EXPORT}:/tpdata/trojan-panel/export/ \
-v ${TROJAN_PANEL_TEMPLATE}:/tpdata/trojan-panel/template/ \
-v /etc/localtime:/etc/localtime \
-e GIN_MODE=release \
-e "mariadb_ip=${mariadb_ip}" \
-e "mariadb_port=${mariadb_port}" \
-e "mariadb_user=${mariadb_user}" \
-e "mariadb_pas=${mariadb_pas}" \
-e "redis_host=${redis_host}" \
-e "redis_port=${redis_port}" \
-e "redis_pass=${redis_pass}" \
jonssonyan/trojan-panel
```

参数解释:

Expand All @@ -455,19 +451,19 @@ jonssonyan/trojan-panel
1. Pull the image

```shell
docker pull jonssonyan/trojan-panel-ui
```
```shell
docker pull jonssonyan/trojan-panel-ui
```

2. Start a container

```shell
docker run -d --name trojan-panel-ui --restart always \
--network=host \
-v "${UI_NGINX_CONFIG}":"/etc/nginx/conf.d/default.conf" \
-v ${CERT_PATH}:${CERT_PATH} \
jonssonyan/trojan-panel-ui
```
```shell
docker run -d --name trojan-panel-ui --restart always \
--network=host \
-v "${UI_NGINX_CONFIG}":"/etc/nginx/conf.d/default.conf" \
-v ${CERT_PATH}:${CERT_PATH} \
jonssonyan/trojan-panel-ui
```

参数解释:

Expand Down Expand Up @@ -556,39 +552,39 @@ server {
1. Pull the image

```shell
docker pull jonssonyan/trojan-panel-core
```
```shell
docker pull jonssonyan/trojan-panel-core
```

2. Start a container

```shell
docker run -d --name trojan-panel-core --restart always \
--network=host \
-v ${TROJAN_PANEL_CORE_DATA}bin/xray/config:${TROJAN_PANEL_CORE_DATA}bin/xray/config \
-v ${TROJAN_PANEL_CORE_DATA}bin/trojango/config:${TROJAN_PANEL_CORE_DATA}bin/trojango/config \
-v ${TROJAN_PANEL_CORE_DATA}bin/hysteria/config:${TROJAN_PANEL_CORE_DATA}bin/hysteria/config \
-v ${TROJAN_PANEL_CORE_DATA}bin/naiveproxy/config:${TROJAN_PANEL_CORE_DATA}bin/naiveproxy/config \
-v ${TROJAN_PANEL_CORE_LOGS}:${TROJAN_PANEL_CORE_LOGS} \
-v ${TROJAN_PANEL_CORE_SQLITE}:${TROJAN_PANEL_CORE_SQLITE} \
-v ${CERT_PATH}:${CERT_PATH} \
-v ${WEB_PATH}:${WEB_PATH} \
-v /etc/localtime:/etc/localtime \
-e GIN_MODE=release \
-e "mariadb_ip=${mariadb_ip}" \
-e "mariadb_port=${mariadb_port}" \
-e "mariadb_user=${mariadb_user}" \
-e "mariadb_pas=${mariadb_pas}" \
-e "database=${database}" \
-e "account-table=${account_table}" \
-e "redis_host=${redis_host}" \
-e "redis_port=${redis_port}" \
-e "redis_pass=${redis_pass}" \
-e "crt_path=${CERT_PATH}${domain}.crt" \
-e "key_path=${CERT_PATH}${domain}.key" \
-e "grpc_port=${grpc_port}" \
jonssonyan/trojan-panel-core
```
```shell
docker run -d --name trojan-panel-core --restart always \
--network=host \
-v ${TROJAN_PANEL_CORE_DATA}bin/xray/config:${TROJAN_PANEL_CORE_DATA}bin/xray/config \
-v ${TROJAN_PANEL_CORE_DATA}bin/trojango/config:${TROJAN_PANEL_CORE_DATA}bin/trojango/config \
-v ${TROJAN_PANEL_CORE_DATA}bin/hysteria/config:${TROJAN_PANEL_CORE_DATA}bin/hysteria/config \
-v ${TROJAN_PANEL_CORE_DATA}bin/naiveproxy/config:${TROJAN_PANEL_CORE_DATA}bin/naiveproxy/config \
-v ${TROJAN_PANEL_CORE_LOGS}:${TROJAN_PANEL_CORE_LOGS} \
-v ${TROJAN_PANEL_CORE_SQLITE}:${TROJAN_PANEL_CORE_SQLITE} \
-v ${CERT_PATH}:${CERT_PATH} \
-v ${WEB_PATH}:${WEB_PATH} \
-v /etc/localtime:/etc/localtime \
-e GIN_MODE=release \
-e "mariadb_ip=${mariadb_ip}" \
-e "mariadb_port=${mariadb_port}" \
-e "mariadb_user=${mariadb_user}" \
-e "mariadb_pas=${mariadb_pas}" \
-e "database=${database}" \
-e "account-table=${account_table}" \
-e "redis_host=${redis_host}" \
-e "redis_port=${redis_port}" \
-e "redis_pass=${redis_pass}" \
-e "crt_path=${CERT_PATH}${domain}.crt" \
-e "key_path=${CERT_PATH}${domain}.key" \
-e "grpc_port=${grpc_port}" \
jonssonyan/trojan-panel-core
```

参数解释:

Expand Down
4 changes: 2 additions & 2 deletions vpress/install-tutorial/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ CPU: linux/amd64 / linux/arm/v6 / linux/arm/v7 / linux/arm64 / linux/s390x / lin

3. 数据库和Redis的密码**尽量设置复杂**(数据库密码不支持部分特殊字符),否则存在被撞库的安全风险。

4. 建议的安装顺序: [网络加速](../tutorial/performance-tuning.md#网络加速) > Trojan Panel Frontend > Trojan Panel
Backend -> Trojan Panel Core
4. 建议的安装顺序: [网络加速](../tutorial/performance-tuning.md#网络加速) > Trojan Panel Backend > Trojan Panel
Frontend -> Trojan Panel Core

建议在脚本运行中需要手动输入的部分,如果没有特殊需求或者不知道这个选项是干什么的,
**除数据库密码和Redis密码自定义以外,其他默认即可**
Expand Down
6 changes: 3 additions & 3 deletions vpress/tutorial/recommend-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

### Xray

[Xray客户端](https://xtls.github.io/links.html#%E5%9B%BE%E5%BD%A2%E5%8C%96%E5%AE%A2%E6%88%B7%E7%AB%AF)
[Xray客户端](https://github.com/XTLS/Xray-core#gui-clients)

### Trojan-gfw & Trojan-go

- Android: [igniter](https://github.com/trojan-gfw/igniter) / [trojan-go-android](https://github.com/p4gefau1t/trojan-go-android)
- IOS: [Shadowrocket](https://apps.apple.com/us/app/shadowrocket/id932747118)
- Windows/Mac/Linux: [v2rayN](https://github.com/2dust/v2rayN) / [Clash for Windows](https://github.com/Fndroid/clash_for_windows_pkg) / [Qv2rayarchive](https://github.com/Qv2ray/Qv2ray)
- Windows/Mac/Linux: [v2rayN](https://github.com/2dust/v2rayN) / [Clash for Windows](https://github.com/Fndroid/clash_for_windows_pkg) / [Qv2ray(archive)](https://github.com/Qv2ray/Qv2ray)

### Hysteria

Expand All @@ -19,5 +19,5 @@
## 申请免费证书

1. [ACME](https://github.com/acmesh-official/acme.sh)(推荐)
2. [FreeSSL](https://freessl.cn/)需要注册并绑定手机
2. [FreeSSL](https://freessl.cn/)注册需要并绑定手机

0 comments on commit 097042c

Please sign in to comment.