V0.0.4
[fix] 更正 README.MD 错误 [update] Dockerfile alpine 版本调整 [fix] entrypoint.sh 逻辑修正
This commit is contained in:
parent
1812cba147
commit
a4602771cb
@ -11,7 +11,7 @@ RUN apk add --no-cache git && git clone https://github.com/XTLS/Xray-core.git .
|
|||||||
go build -o xray /app/main/
|
go build -o xray /app/main/
|
||||||
|
|
||||||
# runner
|
# runner
|
||||||
FROM alpine:3.17 as runner
|
FROM alpine:latest as runner
|
||||||
|
|
||||||
|
|
||||||
ENV UUID=""
|
ENV UUID=""
|
||||||
|
|||||||
@ -12,7 +12,7 @@ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
ocker run -d --name xray_reality -p 443:443 wulabing/xray_docker_reality:0.0.1
|
docker run -d --name xray_reality --restart=always -p 443:443 wulabing/xray_docker_reality:0.0.1
|
||||||
```
|
```
|
||||||
|
|
||||||
查看日志获取配置信息
|
查看日志获取配置信息
|
||||||
|
|||||||
1
reality/SERVERNAMES.MD
Normal file
1
reality/SERVERNAMES.MD
Normal file
@ -0,0 +1 @@
|
|||||||
|
## 已知可用的 SERVERNAMES 及 DEST 列表
|
||||||
@ -1,5 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
if [ -f /config_info.txt ]; then
|
||||||
|
echo "config.json exist"
|
||||||
|
cat /config_info.txt
|
||||||
|
else
|
||||||
if [ -z "$UUID" ]; then
|
if [ -z "$UUID" ]; then
|
||||||
echo "UUID is not set, generate random UUID "
|
echo "UUID is not set, generate random UUID "
|
||||||
UUID="$(uuidgen)"
|
UUID="$(uuidgen)"
|
||||||
@ -30,7 +33,6 @@ if [ -z "$NETWORK" ]; then
|
|||||||
echo "NETWORK is not set,set default value tcp"
|
echo "NETWORK is not set,set default value tcp"
|
||||||
NETWORK="tcp"
|
NETWORK="tcp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# change config
|
# change config
|
||||||
jq ".inbounds[0].settings.clients[0].id=\"$UUID\"" /config.json >/config.json_tmp && mv /config.json_tmp /config.json
|
jq ".inbounds[0].settings.clients[0].id=\"$UUID\"" /config.json >/config.json_tmp && mv /config.json_tmp /config.json
|
||||||
jq ".inbounds[0].streamSettings.realitySettings.dest=\"$DEST\"" /config.json >/config.json_tmp && mv /config.json_tmp /config.json
|
jq ".inbounds[0].streamSettings.realitySettings.dest=\"$DEST\"" /config.json >/config.json_tmp && mv /config.json_tmp /config.json
|
||||||
@ -40,16 +42,17 @@ jq --argjson serverNames "$SERVERNAMES_JSON_ARRAY" '.inbounds[0].streamSettings.
|
|||||||
|
|
||||||
jq ".inbounds[0].streamSettings.realitySettings.privateKey=\"$PRIVATEKEY\"" /config.json >/config.json_tmp && mv /config.json_tmp /config.json
|
jq ".inbounds[0].streamSettings.realitySettings.privateKey=\"$PRIVATEKEY\"" /config.json >/config.json_tmp && mv /config.json_tmp /config.json
|
||||||
jq ".inbounds[0].streamSettings.network=\"$NETWORK\"" /config.json >/config.json_tmp && mv /config.json_tmp /config.json
|
jq ".inbounds[0].streamSettings.network=\"$NETWORK\"" /config.json >/config.json_tmp && mv /config.json_tmp /config.json
|
||||||
|
fi
|
||||||
|
|
||||||
# config info with green color
|
# config info with green color
|
||||||
echo -e "\033[32m"
|
echo -e "\033[32m" >/config_info.txt
|
||||||
echo "UUID: $UUID"
|
echo "UUID: $UUID" >>/config_info.txt
|
||||||
echo "DEST: $DEST"
|
echo "DEST: $DEST" >>/config_info.txt
|
||||||
echo "SERVERNAMES: $SERVERNAMES (任选其一)"
|
echo "SERVERNAMES: $SERVERNAMES (任选其一)" >>/config_info.txt
|
||||||
echo "PRIVATEKEY: $PRIVATEKEY"
|
echo "PRIVATEKEY: $PRIVATEKEY" >>/config_info.txt
|
||||||
echo "PUBLICKEY: $PUBLICKEY"
|
echo "PUBLICKEY: $PUBLICKEY" >>/config_info.txt
|
||||||
echo "NETWORK: $NETWORK"
|
echo "NETWORK: $NETWORK" >>/config_info.txt
|
||||||
echo -e "\033[0m"
|
echo -e "\033[0m" >>/config_info.txt
|
||||||
|
|
||||||
# run xray
|
# run xray
|
||||||
/xray -config /config.json
|
exec /xray -config /config.json
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user