Skip to content

Commit ec21c49

Browse files
authored
Merge branch 'main' into validator-interface
2 parents 601337b + 3a8c5f3 commit ec21c49

File tree

448 files changed

+6871
-6905
lines changed

Some content is hidden

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

448 files changed

+6871
-6905
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ body:
99
options:
1010
- 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.
1111
required: true
12+
- label: I provided the complete config and logs, rather than just providing the truncated parts based on my own judgment.
13+
required: true
1214
- label: I searched issues and did not find any similar issues.
1315
required: true
14-
- type: input
15-
attributes:
16-
label: Version
17-
description: Version of Xray-core
18-
validations:
19-
required: true
16+
- label: The problem can be successfully reproduced in the latest Release
17+
required: true
2018
- type: textarea
2119
attributes:
2220
label: Description
23-
description: Please provide a detailed description of the error. And the information you think valuable.
21+
description: |-
22+
Please provide a detailed description of the error. And the information you think valuable.
23+
If the problem occurs after the update, please provide the **specific** version
2424
validations:
2525
required: true
2626
- type: textarea
@@ -40,7 +40,7 @@ body:
4040
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.
4141
4242
### For logs
43-
Please set the log level to debug first.
43+
Please set the log level to debug and dnsLog to true first.
4444
Restart Xray-core, then operate according to the reproduction method, try to reduce the irrelevant part in the log.
4545
Remember to delete parts with personal information (such as UUID and IP).
4646
Provide the log of Xray-core, not the log output by the panel or other things.

.github/ISSUE_TEMPLATE/bug_report_zh.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ body:
99
options:
1010
- label: 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
1111
required: true
12-
- label: 我搜索了issues,没有发现已提出的类似问题。
12+
- label: 我提供了完整的配置文件和日志,而不是出于自己的判断只给出截取的部分。
13+
required: true
14+
- label: 我搜索了 issues, 没有发现已提出的类似问题。
15+
required: true
16+
- label: 问题在 Release 最新的版本上可以成功复现
1317
required: true
14-
- type: input
15-
attributes:
16-
label: 版本
17-
description: 使用的Xray-core版本
18-
validations:
19-
required: true
2018
- type: textarea
2119
attributes:
2220
label: 描述
23-
description: 请提供错误的详细描述。以及你认为有价值的信息。
21+
description: |-
22+
请提供错误的详细描述。以及你认为有价值的信息。
23+
如果问题在更新后出现,请提供**具体**出现问题的版本号。
2424
validations:
2525
required: true
2626
- type: textarea
@@ -40,7 +40,7 @@ body:
4040
不要直接在这里黏贴一大段导出的 config 文件。去掉无用的出入站、规则、选项,这可以帮助确定问题,如果你真的想得到帮助。
4141
4242
### 对于日志
43-
请先将日志等级设置为 debug.
43+
请先将日志等级设置为 debug, dnsLog 设置为true.
4444
重启 Xray-core ,再按复现方式操作,尽量减少日志中的无关部分。
4545
记得删除有关个人信息(如UUID与IP)的部分。
4646
提供 Xray-core 的日志,而不是面板或者别的东西输出的日志。

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Community Support and Questions
3+
url: https://github.com/XTLS/Xray-core/discussions
4+
about: Please ask and answer questions there. The issue tracker is for issues with core.

.github/docker/Dockerfile

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@
22
FROM --platform=$BUILDPLATFORM golang:alpine AS build
33
WORKDIR /src
44
COPY . .
5-
ARG TARGETOS TARGETARCH
5+
ARG TARGETOS
6+
ARG TARGETARCH
67
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
712

8-
FROM --platform=${TARGETPLATFORM} alpine:latest
9-
WORKDIR /root
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
1016
COPY .github/docker/files/config.json /etc/xray/config.json
11-
COPY --from=build /src/xray /usr/bin/xray
12-
RUN set -ex \
13-
&& apk add --no-cache tzdata ca-certificates \
14-
&& mkdir -p /var/log/xray /usr/share/xray \
15-
&& chmod +x /usr/bin/xray \
16-
&& wget -O /usr/share/xray/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat \
17-
&& wget -O /usr/share/xray/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
17+
COPY --from=build --chmod=755 /src/xray /usr/bin/xray
1818

19+
USER root
20+
WORKDIR /root
1921
VOLUME /etc/xray
20-
ENV TZ=Asia/Shanghai
22+
ARG TZ=Asia/Shanghai
23+
ENV TZ=$TZ
2124
ENTRYPOINT [ "/usr/bin/xray" ]
2225
CMD [ "-config", "/etc/xray/config.json" ]
26+
27+
ARG flavor=v2fly
28+
COPY --from=build --chmod=644 /$flavor /usr/share/xray

.github/workflows/docker.yml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build docker image
22

33
on:
4+
release:
5+
types: [published]
46
push:
57
branches:
68
- main
@@ -17,8 +19,22 @@ jobs:
1719
uses: docker/metadata-action@v5
1820
with:
1921
images: ghcr.io/${{ github.repository_owner }}/xray-core
20-
flavor: latest=true
22+
flavor: latest=auto
2123
tags: |
24+
type=sha
25+
type=ref,event=branch
26+
type=ref,event=pr
27+
type=semver,pattern={{version}}
28+
- name: Docker metadata Loyalsoldier flavor
29+
id: loyalsoldier
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: ghcr.io/${{ github.repository_owner }}/xray-core
33+
flavor: |
34+
latest=auto
35+
suffix=-ls,onlatest=true
36+
tags: |
37+
type=sha
2238
type=ref,event=branch
2339
type=ref,event=pr
2440
type=semver,pattern={{version}}
@@ -28,18 +44,33 @@ jobs:
2844
registry: ghcr.io
2945
username: ${{ github.repository_owner }}
3046
password: ${{ secrets.GITHUB_TOKEN }}
31-
- # Add support for more platforms with QEMU (optional)
32-
# https://github.com/docker/setup-qemu-action
33-
name: Set up QEMU
34-
uses: docker/setup-qemu-action@v3
3547
- name: Set up Docker Buildx
3648
uses: docker/setup-buildx-action@v3
3749
- name: Build and push
38-
uses: docker/build-push-action@v5
50+
uses: docker/build-push-action@v6
3951
with:
4052
context: .
41-
platforms: linux/amd64,linux/arm64
53+
platforms: |
54+
linux/amd64
55+
linux/arm64
56+
linux/loong64
57+
linux/riscv64
58+
provenance: false
4259
file: .github/docker/Dockerfile
4360
push: true
4461
tags: ${{ steps.meta.outputs.tags }}
45-
labels: ${{ steps.meta.outputs.labels }}
62+
- name: Build and push Loyalsoldier flavor
63+
uses: docker/build-push-action@v6
64+
with:
65+
context: .
66+
platforms: |
67+
linux/amd64
68+
linux/arm64
69+
linux/loong64
70+
linux/riscv64
71+
provenance: false
72+
file: .github/docker/Dockerfile
73+
build-args: flavor=loyalsoldier
74+
push: true
75+
tags: |
76+
${{ steps.loyalsoldier.outputs.tags }}

.github/workflows/release.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,15 @@ jobs:
7878
# Include amd64 on all platforms.
7979
goos: [windows, freebsd, openbsd, linux, darwin]
8080
goarch: [amd64, 386]
81+
gotoolchain: [""]
82+
patch-assetname: [""]
83+
8184
exclude:
8285
# Exclude i386 on darwin
8386
- goarch: 386
8487
goos: darwin
8588
include:
86-
# BEIGIN MacOS ARM64
89+
# BEGIN MacOS ARM64
8790
- goos: darwin
8891
goarch: arm64
8992
# END MacOS ARM64
@@ -152,6 +155,16 @@ jobs:
152155
goarch: arm
153156
goarm: 7
154157
# END OPENBSD ARM
158+
# BEGIN Windows 7
159+
- goos: windows
160+
goarch: amd64
161+
gotoolchain: 1.21.4
162+
patch-assetname: win7-64
163+
- goos: windows
164+
goarch: 386
165+
gotoolchain: 1.21.4
166+
patch-assetname: win7-32
167+
# END Windows 7
155168
fail-fast: false
156169

157170
runs-on: ubuntu-latest
@@ -164,16 +177,17 @@ jobs:
164177
- name: Checkout codebase
165178
uses: actions/checkout@v4
166179

167-
- name: Show workflow information
180+
- name: Show workflow information
168181
run: |
169-
export _NAME=$(jq ".[\"$GOOS-$GOARCH$GOARM$GOMIPS\"].friendlyName" -r < .github/build/friendly-filenames.json)
182+
_NAME=${{ matrix.patch-assetname }}
183+
[ -n "$_NAME" ] || _NAME=$(jq ".[\"$GOOS-$GOARCH$GOARM$GOMIPS\"].friendlyName" -r < .github/build/friendly-filenames.json)
170184
echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, GOMIPS: $GOMIPS, RELEASE_NAME: $_NAME"
171185
echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV
172186
173187
- name: Set up Go
174188
uses: actions/setup-go@v5
175189
with:
176-
go-version-file: go.mod
190+
go-version: ${{ matrix.gotoolchain || '1.23' }}
177191
check-latest: true
178192

179193
- name: Get project dependencies

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Set up Go
3333
uses: actions/setup-go@v5
3434
with:
35-
go-version-file: go.mod
35+
go-version: '1.23'
3636
check-latest: true
3737
- name: Restore Cache
3838
uses: actions/cache/restore@v4

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ NAME = xray
33
VERSION=$(shell git describe --always --dirty)
44

55
# NOTE: This MAKEFILE can be used to build Xray-core locally and in Automatic workflows. It is \
6-
provided for convinience in automatic building and functions as a part of it.
6+
provided for convenience in automatic building and functions as a part of it.
77
# NOTE: If you need to modify this file, please be aware that:\
88
- This file is not the main Makefile; it only accepts environment variables and builds the \
99
binary.\
1010
- Automatic building expects the correct binaries to be built by this Makefile. If you \
1111
intend to propose a change to this Makefile, carefully review the file below and ensure \
12-
that the change will not accidently break the automatic building:\
12+
that the change will not accidentally break the automatic building:\
1313
.github/workflows/release.yml \
1414
Otherwise it is recommended to contact the project maintainers.
1515

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
[README](https://github.com/XTLS/Xray-core#readme) is open, so feel free to submit your project [here](https://github.com/XTLS/Xray-core/pulls).
66

7+
## Donation & NFTs
8+
9+
[Announcement of NFTs by Project X](https://github.com/XTLS/Xray-core/discussions/3633)
10+
711
## License
812

913
[Mozilla Public License Version 2.0](https://github.com/XTLS/Xray-core/blob/main/LICENSE)
@@ -18,6 +22,8 @@
1822

1923
[Project X Channel](https://t.me/projectXtls)
2024

25+
[Project VLESS](https://t.me/projectVless) (non-Chinese)
26+
2127
## Installation
2228

2329
- Linux Script
@@ -27,8 +33,7 @@
2733
- [ghcr.io/xtls/xray-core](https://ghcr.io/xtls/xray-core) (**Official**)
2834
- [teddysun/xray](https://hub.docker.com/r/teddysun/xray)
2935
- Web Panel
30-
- [X-UI-English](https://github.com/NidukaAkalanka/x-ui-english), [3X-UI](https://github.com/MHSanaei/3x-ui), [X-UI](https://github.com/alireza0/x-ui), [X-UI](https://github.com/diditra/x-ui)
31-
- [Xray-UI](https://github.com/qist/xray-ui), [X-UI](https://github.com/sing-web/x-ui)
36+
- [3X-UI](https://github.com/MHSanaei/3x-ui), [X-UI](https://github.com/alireza0/x-ui), [Xray-UI](https://github.com/qist/xray-ui)
3237
- [Hiddify](https://github.com/hiddify/hiddify-config)
3338
- [Marzban](https://github.com/Gozargah/Marzban)
3439
- [Libertea](https://github.com/VZiChoushaDui/Libertea)
@@ -67,14 +72,12 @@
6772
- [luci-app-xray](https://github.com/yichya/luci-app-xray) ([openwrt-xray](https://github.com/yichya/openwrt-xray))
6873
- Windows
6974
- [v2rayN](https://github.com/2dust/v2rayN)
70-
- [NekoRay](https://github.com/Matsuridayo/nekoray)
7175
- [Furious](https://github.com/LorenEteval/Furious)
72-
- [HiddifyN](https://github.com/hiddify/HiddifyN)
7376
- [Invisible Man - Xray](https://github.com/InvisibleManVPN/InvisibleMan-XRayClient)
7477
- Android
7578
- [v2rayNG](https://github.com/2dust/v2rayNG)
76-
- [HiddifyNG](https://github.com/hiddify/HiddifyNG)
7779
- [X-flutter](https://github.com/XTLS/X-flutter)
80+
- [SaeedDev94/Xray](https://github.com/SaeedDev94/Xray)
7881
- iOS & macOS arm64
7982
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
8083
- [Streisand](https://apps.apple.com/app/streisand/id6450534064)
@@ -85,7 +88,6 @@
8588
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
8689
- Linux
8790
- [v2rayA](https://github.com/v2rayA/v2rayA)
88-
- [NekoRay](https://github.com/Matsuridayo/nekoray)
8991
- [Furious](https://github.com/LorenEteval/Furious)
9092

9193
## Others that support VLESS, XTLS, REALITY, XUDP, PLUX...
@@ -98,21 +100,15 @@
98100
- [XTLS/libXray](https://github.com/XTLS/libXray)
99101
- [xtlsapi](https://github.com/hiddify/xtlsapi)
100102
- [AndroidLibXrayLite](https://github.com/2dust/AndroidLibXrayLite)
101-
- [XrayKit](https://github.com/arror/XrayKit)
102103
- [Xray-core-python](https://github.com/LorenEteval/Xray-core-python)
103104
- [xray-api](https://github.com/XVGuardian/xray-api)
104105
- [XrayR](https://github.com/XrayR-project/XrayR)
105106
- [XrayR-release](https://github.com/XrayR-project/XrayR-release)
106107
- [XrayR-V2Board](https://github.com/missuo/XrayR-V2Board)
107108
- [Clash.Meta](https://github.com/MetaCubeX/Clash.Meta)
108-
- [Clash Verge](https://github.com/zzzgydi/clash-verge)
109109
- [clashN](https://github.com/2dust/clashN)
110110
- [Clash Meta for Android](https://github.com/MetaCubeX/ClashMetaForAndroid)
111-
- [meta_for_ios](https://t.me/meta_for_ios)
112111
- [sing-box](https://github.com/SagerNet/sing-box)
113-
- [installReality](https://github.com/BoxXt/installReality)
114-
- [sbox-reality](https://github.com/Misaka-blog/sbox-reality)
115-
- [sing-box-for-ios](https://github.com/SagerNet/sing-box-for-ios)
116112

117113
## Contributing
118114

app/commander/commander.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"sync"
99

1010
"github.com/xtls/xray-core/common"
11+
"github.com/xtls/xray-core/common/errors"
1112
"github.com/xtls/xray-core/common/signal/done"
1213
core "github.com/xtls/xray-core/core"
1314
"github.com/xtls/xray-core/features/outbound"
@@ -46,7 +47,7 @@ func NewCommander(ctx context.Context, config *Config) (*Commander, error) {
4647
}
4748
service, ok := rawService.(Service)
4849
if !ok {
49-
return nil, newError("not a Service.")
50+
return nil, errors.New("not a Service.")
5051
}
5152
c.services = append(c.services, service)
5253
}
@@ -70,16 +71,16 @@ func (c *Commander) Start() error {
7071

7172
var listen = func(listener net.Listener) {
7273
if err := c.server.Serve(listener); err != nil {
73-
newError("failed to start grpc server").Base(err).AtError().WriteToLog()
74+
errors.LogErrorInner(context.Background(), err, "failed to start grpc server")
7475
}
7576
}
7677

7778
if len(c.listen) > 0 {
7879
if l, err := net.Listen("tcp", c.listen); err != nil {
79-
newError("API server failed to listen on ", c.listen).Base(err).AtError().WriteToLog()
80+
errors.LogErrorInner(context.Background(), err, "API server failed to listen on ", c.listen)
8081
return err
8182
} else {
82-
newError("API server listening on ", l.Addr()).AtInfo().WriteToLog()
83+
errors.LogInfo(context.Background(), "API server listening on ", l.Addr())
8384
go listen(l)
8485
}
8586
return nil
@@ -93,7 +94,7 @@ func (c *Commander) Start() error {
9394
go listen(listener)
9495

9596
if err := c.ohm.RemoveHandler(context.Background(), c.tag); err != nil {
96-
newError("failed to remove existing handler").WriteToLog()
97+
errors.LogInfoInner(context.Background(), err, "failed to remove existing handler")
9798
}
9899

99100
return c.ohm.AddHandler(context.Background(), &Outbound{

0 commit comments

Comments
 (0)