This commit is contained in:
vincent 2024-05-18 09:40:18 +08:00
parent 2833cb8e3c
commit 89ec3ccc87
2 changed files with 31 additions and 13 deletions

View File

@ -6,31 +6,51 @@
- docker
- docker-compose
- jq - 用于查看json文件, 提取json文件信息. 编辑json文件
- qrencode - 用于生成二维码
- qrencode - (可选,非必要)用于生成二维码
## 启动和关闭
初始化, 设置密钥和uuid, **第一次运行必须执行**
## 快速开始
1. 下载项目
```bash
git clone https://github.com/teddysun/xray-docker.git
```
2. 进入项目目录
```bash
cd xray-docker
```
3. 初始化, 设置密钥和uuid, **第一次运行必须执行**
```bash
bash ./bin/init.sh
```
启动
4. 启动
```
docker-compose up -d
```
停止
5. 查看分享链接
```bash
bash ./bin/print_share_link.sh
```
## 停止
如果需要停止服务, 进入项目目录, 执行以下命令
```bash
cd xray-docker
docker-compose down
```
## 更新镜像
```
进入项目目录, 执行以下命令
```bash
bash ./bin/update_docker_images.sh
```
## 查看分享链接
```
进入项目目录, 执行以下命令
```bash
bash ./bin/print_share_link.sh
```

View File

@ -6,11 +6,6 @@ if ! command -v jq &> /dev/null; then
exit 1
fi
# 检查 qrencode 是否安装
if ! command -v qrencode &> /dev/null; then
echo "qrencode 未安装"
exit 1
fi
script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径
config_dir=$(readlink -f "$script_dir/../conf") # 配置文件绝对路径
@ -36,7 +31,10 @@ echo "NETWORK: $network"
if [ "$ipv4" != "null" ]; then
sub_ipv4="vless://$uuid@$ipv4:$port?encryption=none&security=reality&type=$network&sni=$sni&fp=chrome&pbk=$public_key&flow=xtls-rprx-vision#my_docker_vless_reality_vision"
echo "IPV4 订阅连接: $sub_ipv4"
echo -e "IPV4 订阅二维码:\n$(echo "$sub_ipv4" | qrencode -o - -t UTF8)"
# 如果qrencode安装了则打印二维码
if command -v qrencode &> /dev/null; then
echo -e "IPV4 订阅二维码:\n$(echo "$sub_ipv4" | qrencode -o - -t UTF8)"
fi
fi
echo -e "\033[0m"