diff --git a/.github/workflows/xray_docker_reality.yml b/.github/workflows/xray_docker_reality.yml index 32777f0..81e9320 100644 --- a/.github/workflows/xray_docker_reality.yml +++ b/.github/workflows/xray_docker_reality.yml @@ -17,33 +17,34 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3.4.0 + - name: Checkout + uses: actions/checkout@v3.4.0 - - name: Docker Setup Buildx - uses: docker/setup-buildx-action@v2.5.0 + - name: Docker Setup Buildx + uses: docker/setup-buildx-action@v2.5.0 - - name: Docker Login - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + - name: Docker Login + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - - name: Extract first line of commit message - shell: bash - run: | - COMMIT_MESSAGE=$(git log --format=%B -n 1 ${{ github.sha }}) - FIRST_LINE=$(echo "$COMMIT_MESSAGE" | head -n1) - TAG_NAME=$(echo "$FIRST_LINE" | tr -d '[:space:]') # Remove spaces if needed - echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV - - - name: Build the Docker image latest - run: docker build --file ./reality/Dockerfile --tag wulabing/xray_docker_reality:latest ./reality + - name: Extract first line of commit message + shell: bash + run: | + COMMIT_MESSAGE=$(git log --format=%B -n 1 ${{ github.sha }}) + FIRST_LINE=$(echo "$COMMIT_MESSAGE" | head -n1) + TAG_NAME=$(echo "$FIRST_LINE" | tr -d '[:space:]') # Remove spaces if needed + echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV - - name: Build the Docker image - run: docker build --file ./reality/Dockerfile --tag wulabing/xray_docker_reality:${{env.TAG_NAME}} ./reality + - name: Build the Docker image + run: docker build --file ./reality/Dockerfile --tag wulabing/xray_docker_reality:${{env.TAG_NAME}} ./reality - - name: Push the Docker image latest - run: docker push wulabing/xray_docker_reality:latest - - name: Push the Docker image - run: docker push wulabing/xray_docker_reality:${{env.TAG_NAME}} + - name: Build the Docker image latest + run: docker build --file ./reality/Dockerfile --tag wulabing/xray_docker_reality:latest ./reality + + - name: Push the Docker image + run: docker push wulabing/xray_docker_reality:${{env.TAG_NAME}} + + - name: Push the Docker image latest + run: docker push wulabing/xray_docker_reality:latest \ No newline at end of file diff --git a/reality/Dockerfile b/reality/Dockerfile index 75bd9c2..12961ac 100644 --- a/reality/Dockerfile +++ b/reality/Dockerfile @@ -24,7 +24,9 @@ ENV TZ=Asia/Shanghai WORKDIR / -COPY . / +COPY ./entrypoint.sh / +COPY ./config.json / + COPY --from=builder /app/xray / RUN apk add --no-cache tzdata ca-certificates util-linux jq && \ diff --git a/reality/README.MD b/reality/README.MD index 45d6fb7..1fd72ac 100644 --- a/reality/README.MD +++ b/reality/README.MD @@ -12,7 +12,7 @@ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh ``` -docker run -d --name xray_reality --restart=always -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:latest ``` 查看日志获取配置信息 diff --git a/reality/SERVERNAMES.MD b/reality/SERVERNAMES.MD index 6e17700..093fd25 100644 --- a/reality/SERVERNAMES.MD +++ b/reality/SERVERNAMES.MD @@ -1 +1,6 @@ ## 已知可用的 SERVERNAMES 及 DEST 列表 + +| DEST | SERVERMANES | 说明 | +|-------------------|--------------------------------|------------------------------------| +| www.apple.com:443 | images.apple.com www.apple.com | Apple 使用了 akamai CDN,全球各地存在节点,并且知名 | + \ No newline at end of file diff --git a/reality/entrypoint.sh b/reality/entrypoint.sh index 5d9e201..84f4dbe 100644 --- a/reality/entrypoint.sh +++ b/reality/entrypoint.sh @@ -1,7 +1,6 @@ #!/bin/sh if [ -f /config_info.txt ]; then echo "config.json exist" - cat /config_info.txt else if [ -z "$UUID" ]; then echo "UUID is not set, generate random UUID " @@ -42,17 +41,20 @@ else 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 + + # config info with green color + echo -e "\033[32m" >/config_info.txt + echo "UUID: $UUID" >>/config_info.txt + echo "DEST: $DEST" >>/config_info.txt + echo "SERVERNAMES: $SERVERNAMES (任选其一)" >>/config_info.txt + echo "PRIVATEKEY: $PRIVATEKEY" >>/config_info.txt + echo "PUBLICKEY: $PUBLICKEY" >>/config_info.txt + echo "NETWORK: $NETWORK" >>/config_info.txt + echo -e "\033[0m" >>/config_info.txt fi -# config info with green color -echo -e "\033[32m" >/config_info.txt -echo "UUID: $UUID" >>/config_info.txt -echo "DEST: $DEST" >>/config_info.txt -echo "SERVERNAMES: $SERVERNAMES (任选其一)" >>/config_info.txt -echo "PRIVATEKEY: $PRIVATEKEY" >>/config_info.txt -echo "PUBLICKEY: $PUBLICKEY" >>/config_info.txt -echo "NETWORK: $NETWORK" >>/config_info.txt -echo -e "\033[0m" >>/config_info.txt +# show config info +cat /config_info.txt # run xray exec /xray -config /config.json