Skip to content

Commit 34d1293

Browse files
committed
update to 26.1.23
2 parents 57bd02e + 0a42dba commit 34d1293

File tree

379 files changed

+22810
-7934
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

379 files changed

+22810
-7934
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ body:
77
description: |-
88
Please check all of the following options to prove that you have read and understood the requirements, otherwise this issue will be closed.
99
options:
10+
- label: I have read all the comments in the issue template and ensured that this issue meet the requirements.
11+
required: true
1012
- label: I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
1113
required: true
1214
- label: I provided the complete config and logs, rather than just providing the truncated parts based on my own judgment.
@@ -38,6 +40,8 @@ body:
3840
### For config
3941
Please provide the configuration files that can reproduce the problem, including the server and client.
4042
Don't just paste a big exported config file here. Eliminate useless inbound/outbound, rules, options, this can help determine the problem, if you really want to get help.
43+
After removing parts that do not affect reproduction, provide the actual running **complete** file.
44+
meaning of complete: This config can be directly used to start the core, **not a truncated part of the config**. For fields like keys, use newly generated valid parameters that have not been actually used to fill in.
4145
4246
### For logs
4347
Please set the log level to debug and dnsLog to true first.
@@ -46,42 +50,29 @@ body:
4650
Provide the log of Xray-core, not the log output by the panel or other things.
4751
4852
### Finally
49-
After removing parts that do not affect reproduction, provide the actual running **complete** file, do not only provide inbound or outbound or a few lines of logs based on your own judgment.
50-
Put the content between the preset ```<details><pre><code>``` ```</code></pre></details>``` in the text box.
51-
If the problem is very clear that only related to one end (such as core startup failure/crash after correctly writing the config according to the documents), N/A can be filled in for unnecessary areas below.
53+
The specific content to be filled in each of the following text boxes needs to be placed between ```<details><pre><code>``` and ```</code></pre></details>```, like this
54+
```
55+
<details><pre><code>
56+
(config)
57+
</code></pre></details>
58+
```
5259
- type: textarea
5360
attributes:
5461
label: Client config
55-
value: |-
56-
<details><pre><code>
57-
58-
</code></pre></details>
5962
validations:
6063
required: true
6164
- type: textarea
6265
attributes:
6366
label: Server config
64-
value: |-
65-
<details><pre><code>
66-
67-
</code></pre></details>
6867
validations:
6968
required: true
7069
- type: textarea
7170
attributes:
7271
label: Client log
73-
value: |-
74-
<details><pre><code>
75-
76-
</code></pre></details>
7772
validations:
7873
required: true
7974
- type: textarea
8075
attributes:
8176
label: Server log
82-
value: |-
83-
<details><pre><code>
84-
85-
</code></pre></details>
8677
validations:
8778
required: true

.github/ISSUE_TEMPLATE/bug_report_zh.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ body:
77
description: |-
88
请勾选以下所有选项以证明您已经阅读并理解了以下要求,否则该 issue 将被关闭。
99
options:
10+
- label: 我读完了 issue 模板中的所有注释,确保填写符合要求。
11+
required: true
1012
- label: 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
1113
required: true
1214
- label: 我提供了完整的配置文件和日志,而不是出于自己的判断只给出截取的部分。
@@ -38,6 +40,8 @@ body:
3840
### 对于配置文件
3941
请提供可以重现问题的配置文件,包括服务端和客户端。
4042
不要直接在这里黏贴一大段导出的 config 文件。去掉无用的出入站、规则、选项,这可以帮助确定问题,如果你真的想得到帮助。
43+
在去掉不影响复现的部分后,提供实际运行的**完整**文件。
44+
完整的含义:可以直接使用这个配置启动核心,**不是截取的部分配置**。对于密钥等参数使用重新生成未实际使用的有效参数填充。
4145
4246
### 对于日志
4347
请先将日志等级设置为 debug, dnsLog 设置为true.
@@ -46,42 +50,29 @@ body:
4650
提供 Xray-core 的日志,而不是面板或者别的东西输出的日志。
4751
4852
### 最后
49-
在去掉不影响复现的部分后,提供实际运行的**完整**文件,不要出于自己的判断只提供入站出站或者几行日志。
50-
把内容放在文本框预置的 ```<details><pre><code>``` 和 ```</code></pre></details>``` 中间。
51-
如果问题十分明确只出现在某一端(如按文档正确编写配置后核心启动失败/崩溃),可以在下面不需要的项目填入N/A.
53+
把下面的每格具体内容需要放在 ```<details><pre><code>``` 和 ```</code></pre></details>``` 中间,如
54+
```
55+
<details><pre><code>
56+
(config)
57+
</code></pre></details>
58+
```
5259
- type: textarea
5360
attributes:
5461
label: 客户端配置
55-
value: |-
56-
<details><pre><code>
57-
58-
</code></pre></details>
5962
validations:
6063
required: true
6164
- type: textarea
6265
attributes:
6366
label: 服务端配置
64-
value: |-
65-
<details><pre><code>
66-
67-
</code></pre></details>
6867
validations:
6968
required: true
7069
- type: textarea
7170
attributes:
7271
label: 客户端日志
73-
value: |-
74-
<details><pre><code>
75-
76-
</code></pre></details>
7772
validations:
7873
required: true
7974
- type: textarea
8075
attributes:
8176
label: 服务端日志
82-
value: |-
83-
<details><pre><code>
84-
85-
</code></pre></details>
8677
validations:
8778
required: true

.github/docker/Dockerfile

Lines changed: 56 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,62 @@
1-
# syntax=docker/dockerfile:1
2-
FROM --platform=$BUILDPLATFORM golang:alpine AS build
1+
# syntax=docker/dockerfile:latest
2+
FROM --platform=$BUILDPLATFORM golang:latest AS build
3+
4+
# Build xray-core
35
WORKDIR /src
46
COPY . .
57
ARG TARGETOS
68
ARG TARGETARCH
7-
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main
8-
ADD https://github.com/v2fly/geoip/releases/latest/download/geoip.dat /v2fly/geoip.dat
9-
ADD https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat /v2fly/geosite.dat
10-
ADD https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat /loyalsoldier/geoip.dat
11-
ADD https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat /loyalsoldier/geosite.dat
12-
13-
# chainguard/static contains only tzdata and ca-certificates, can be built with multiarch static binaries.
14-
FROM --platform=linux/amd64 chainguard/static:latest
15-
WORKDIR /var/log/xray
16-
COPY .github/docker/files/config.json /etc/xray/config.json
17-
COPY --from=build --chmod=755 /src/xray /usr/bin/xray
18-
19-
USER root
20-
WORKDIR /root
21-
VOLUME /etc/xray
22-
ARG TZ=Asia/Shanghai
9+
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags "-s -w -buildid=" ./main
10+
11+
# Download geodat into a staging directory
12+
ADD https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geoip.dat /tmp/geodat/geoip.dat
13+
ADD https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geosite.dat /tmp/geodat/geosite.dat
14+
15+
RUN mkdir -p /tmp/empty
16+
17+
# Create config files with empty JSON content
18+
RUN mkdir -p /tmp/usr/local/etc/xray
19+
RUN cat <<EOF >/tmp/usr/local/etc/xray/00_log.json
20+
{
21+
"log": {
22+
"error": "/var/log/xray/error.log",
23+
"loglevel": "warning",
24+
"access": "none",
25+
"dnsLog": false
26+
}
27+
}
28+
EOF
29+
RUN echo '{}' >/tmp/usr/local/etc/xray/01_api.json
30+
RUN echo '{}' >/tmp/usr/local/etc/xray/02_dns.json
31+
RUN echo '{}' >/tmp/usr/local/etc/xray/03_routing.json
32+
RUN echo '{}' >/tmp/usr/local/etc/xray/04_policy.json
33+
RUN echo '{}' >/tmp/usr/local/etc/xray/05_inbounds.json
34+
RUN echo '{}' >/tmp/usr/local/etc/xray/06_outbounds.json
35+
RUN echo '{}' >/tmp/usr/local/etc/xray/07_transport.json
36+
RUN echo '{}' >/tmp/usr/local/etc/xray/08_stats.json
37+
RUN echo '{}' >/tmp/usr/local/etc/xray/09_reverse.json
38+
39+
# Create log files
40+
RUN mkdir -p /tmp/var/log/xray && touch \
41+
/tmp/var/log/xray/access.log \
42+
/tmp/var/log/xray/error.log
43+
44+
# Build finally image
45+
FROM gcr.io/distroless/static:nonroot
46+
47+
COPY --from=build --chown=0:0 --chmod=755 /src/xray /usr/local/bin/xray
48+
COPY --from=build --chown=0:0 --chmod=755 /tmp/empty /usr/local/share/xray
49+
COPY --from=build --chown=0:0 --chmod=644 /tmp/geodat/*.dat /usr/local/share/xray/
50+
COPY --from=build --chown=0:0 --chmod=755 /tmp/empty /usr/local/etc/xray
51+
COPY --from=build --chown=0:0 --chmod=644 /tmp/usr/local/etc/xray/*.json /usr/local/etc/xray/
52+
COPY --from=build --chown=0:0 --chmod=755 /tmp/empty /var/log/xray
53+
COPY --from=build --chown=65532:65532 --chmod=600 /tmp/var/log/xray/*.log /var/log/xray/
54+
55+
VOLUME /usr/local/etc/xray
56+
VOLUME /var/log/xray
57+
58+
ARG TZ=Etc/UTC
2359
ENV TZ=$TZ
24-
ENTRYPOINT [ "/usr/bin/xray" ]
25-
CMD [ "-confdir", "/etc/xray/" ]
2660

27-
ARG flavor=v2fly
28-
COPY --from=build --chmod=644 /$flavor /usr/share/xray
61+
ENTRYPOINT [ "/usr/local/bin/xray" ]
62+
CMD [ "-confdir", "/usr/local/etc/xray/" ]

.github/docker/Dockerfile.usa

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# syntax=docker/dockerfile:latest
2+
FROM --platform=$BUILDPLATFORM golang:latest AS build
3+
4+
# Build xray-core
5+
WORKDIR /src
6+
COPY . .
7+
ARG TARGETOS
8+
ARG TARGETARCH
9+
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags "-s -w -buildid=" ./main
10+
11+
# Download geodat into a staging directory
12+
ADD https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geoip.dat /tmp/geodat/geoip.dat
13+
ADD https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geosite.dat /tmp/geodat/geosite.dat
14+
15+
RUN mkdir -p /tmp/empty
16+
17+
# Create config files with empty JSON content
18+
RUN mkdir -p /tmp/usr/local/etc/xray
19+
RUN cat <<EOF >/tmp/usr/local/etc/xray/00_log.json
20+
{
21+
"log": {
22+
"error": "/var/log/xray/error.log",
23+
"loglevel": "warning",
24+
"access": "none",
25+
"dnsLog": false
26+
}
27+
}
28+
EOF
29+
RUN echo '{}' >/tmp/usr/local/etc/xray/01_api.json
30+
RUN echo '{}' >/tmp/usr/local/etc/xray/02_dns.json
31+
RUN echo '{}' >/tmp/usr/local/etc/xray/03_routing.json
32+
RUN echo '{}' >/tmp/usr/local/etc/xray/04_policy.json
33+
RUN echo '{}' >/tmp/usr/local/etc/xray/05_inbounds.json
34+
RUN echo '{}' >/tmp/usr/local/etc/xray/06_outbounds.json
35+
RUN echo '{}' >/tmp/usr/local/etc/xray/07_transport.json
36+
RUN echo '{}' >/tmp/usr/local/etc/xray/08_stats.json
37+
RUN echo '{}' >/tmp/usr/local/etc/xray/09_reverse.json
38+
39+
# Create log files
40+
RUN mkdir -p /tmp/var/log/xray && touch \
41+
/tmp/var/log/xray/access.log \
42+
/tmp/var/log/xray/error.log
43+
44+
# Build finally image
45+
# Note on Distroless Base Image and Architecture Support:
46+
# - The official 'gcr.io/distroless/static' image provided by Google only supports a limited set of architectures for Linux:
47+
# - linux/amd64
48+
# - linux/arm/v7
49+
# - linux/arm64/v8
50+
# - linux/ppc64le
51+
# - linux/s390x
52+
# - Upon inspection, the blob contents of the Distroless images across these architectures are nearly identical, with only minor differences in metadata (e.g., 'Architecture' field in the manifest).
53+
# - Due to this similarity in content, it is feasible to forcibly specify a single platform (e.g., '--platform=linux/amd64') for unsupported architectures, as the core image content remains compatible with statically compiled binaries like Go applications.
54+
FROM --platform=linux/amd64 gcr.io/distroless/static:nonroot
55+
56+
COPY --from=build --chown=0:0 --chmod=755 /src/xray /usr/local/bin/xray
57+
COPY --from=build --chown=0:0 --chmod=755 /tmp/empty /usr/local/share/xray
58+
COPY --from=build --chown=0:0 --chmod=644 /tmp/geodat/*.dat /usr/local/share/xray/
59+
COPY --from=build --chown=0:0 --chmod=755 /tmp/empty /usr/local/etc/xray
60+
COPY --from=build --chown=0:0 --chmod=644 /tmp/usr/local/etc/xray/*.json /usr/local/etc/xray/
61+
COPY --from=build --chown=0:0 --chmod=755 /tmp/empty /var/log/xray
62+
COPY --from=build --chown=65532:65532 --chmod=600 /tmp/var/log/xray/*.log /var/log/xray/
63+
64+
VOLUME /usr/local/etc/xray
65+
VOLUME /var/log/xray
66+
67+
ARG TZ=Etc/UTC
68+
ENV TZ=$TZ
69+
70+
ENTRYPOINT [ "/usr/local/bin/xray" ]
71+
CMD [ "-confdir", "/usr/local/etc/xray/" ]

.github/docker/files/config.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)