Skip to content

Commit

Permalink
Bump go Xray-core to v1.8.13
Browse files Browse the repository at this point in the history
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
  • Loading branch information
LorenEteval committed May 28, 2024
1 parent 1db2970 commit 997bf61
Show file tree
Hide file tree
Showing 61 changed files with 761 additions and 350 deletions.
77 changes: 60 additions & 17 deletions xray-go/.github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,77 @@ body:
required: true
- label: I searched issues and did not find any similar issues.
required: true
- type: textarea
- type: input
attributes:
label: Version
description: Xray-core version
render: shell
description: Version of Xray-core
validations:
required: true
- type: textarea
attributes:
label: Description
description: Please provide a detailed description of the bug. And information that you consider valuable.
description: Please provide a detailed description of the error. And the information you think valuable.
validations:
required: true
- type: textarea
attributes:
label: Reproduction
label: Reproduction Method
description: |-
Provide method to reproduce the bug.
Please provide config that can reproduce the problem, including both the server and client.
Do not paste a large exported config here. Removing unnecessary inbounds, outbounds, route rules, and options. This cloud help us locate the problem if you really want to get help.
Even if you are using a GUI/script/panel, please follow the above requirements.
DO NOT just write "I'm using xxx GUI/ xxx panel" instead of providing config. We do not have the energy or obligation to find the software and spend time reproducing according to the description.
Based on the configuration you provided below, provide the method to reproduce the bug.
validations:
required: true
- type: markdown
attributes:
value: |-
## Configuration and Log Section
### For config
Please provide the configuration files that can reproduce the problem, including the server and client.
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.
### For logs
Please set the log level to debug first.
Restart Xray-core, then operate according to the reproduction method, try to reduce the irrelevant part in the log.
Remember to delete parts with personal information (such as UUID and IP).
Provide the log of Xray-core, not the log output by the panel or other things.
### Finally
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.
Put the content between the preset ```<details><pre><code>``` ```</code></pre></details>``` in the text box.
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.
- type: textarea
attributes:
label: log
description: |-
Set the log level to debug.
Please Restart Xray-core, and then follow the reproduction method to reduce irrelevant parts in log.
Remember to remove personal information such as UUID, IP.
Provid complete log, DO NOT just paste the the parts that you think necessary based on your own judgment.
render: shell
label: Client config
value: |-
<details><pre><code>
</code></pre></details>
validations:
required: true
- type: textarea
attributes:
label: Server config
value: |-
<details><pre><code>
</code></pre></details>
validations:
required: true
- type: textarea
attributes:
label: Client log
value: |-
<details><pre><code>
</code></pre></details>
validations:
required: true
- type: textarea
attributes:
label: Server log
value: |-
<details><pre><code>
</code></pre></details>
validations:
required: true
67 changes: 55 additions & 12 deletions xray-go/.github/ISSUE_TEMPLATE/bug_report_zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ body:
required: true
- label: 我搜索了issues,没有发现已提出的类似问题。
required: true
- type: textarea
- type: input
attributes:
label: 版本
description: 使用的Xray-core版本
render: shell
validations:
required: true
- type: textarea
attributes:
label: 描述
Expand All @@ -26,19 +27,61 @@ body:
attributes:
label: 重现方式
description: |-
提供重现BUG方法。
请提供可以重现问题的配置文件,包括服务端和客户端
不要直接在这里黏贴一大段导出的 config 文件。去掉无用的出入站、规则、选项,这可以帮助确定问题,如果你真的想得到帮助。
即使你在使用图形客户端/脚本/面板,也请遵照上述要求。
不要直接用“我使用xxx客户端/xxx面板”替代config,我们没有精力也没有义务去找到项目再花时间按描述重新问题。
基于你下面提供的配置,提供重现BUG方法。
validations:
required: true
- type: textarea
- type: markdown
attributes:
label: 日志
description: |-
value: |-
## 配置与日志部分
### 对于配置文件
请提供可以重现问题的配置文件,包括服务端和客户端。
不要直接在这里黏贴一大段导出的 config 文件。去掉无用的出入站、规则、选项,这可以帮助确定问题,如果你真的想得到帮助。
### 对于日志
请先将日志等级设置为 debug.
重启 Xray-core ,再按复现方式操作,尽量减少日志中的无关部分。
记得删除有关个人信息(如UUID与IP)的部分。
提供完整的日志,不要仅提供你自己觉得有用的部分。
render: shell
提供 Xray-core 的日志,而不是面板或者别的东西输出的日志。
### 最后
在去掉不影响复现的部分后,提供实际运行的**完整**文件,不要出于自己的判断只提供入站出站或者几行日志。
把内容放在文本框预置的 ```<details><pre><code>``` 和 ```</code></pre></details>``` 中间。
如果问题十分明确只出现在某一端(如按文档正确编写配置后核心启动失败/崩溃),可以在下面不需要的项目填入N/A.
- type: textarea
attributes:
label: 客户端配置
value: |-
<details><pre><code>
</code></pre></details>
validations:
required: true
- type: textarea
attributes:
label: 服务端配置
value: |-
<details><pre><code>
</code></pre></details>
validations:
required: true
- type: textarea
attributes:
label: 客户端日志
value: |-
<details><pre><code>
</code></pre></details>
validations:
required: true
- type: textarea
attributes:
label: 服务端日志
value: |-
<details><pre><code>
</code></pre></details>
validations:
required: true
6 changes: 6 additions & 0 deletions xray-go/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Build and Release

# NOTE: This Github Actions file depends on the Makefile.
# Building the correct package requires the correct binaries generated by the Makefile. To
# ensure the correct output, the Makefile must accept the appropriate input and compile the
# correct file with the correct name. If you need to modify this file, please ensure it won't
# disrupt the Makefile.

on:
workflow_dispatch:
release:
Expand Down
18 changes: 10 additions & 8 deletions xray-go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ NAME = xray

VERSION=$(shell git describe --always --dirty)

export GOARCH ?=
export GOOS ?=

ifdef GOARCH
ifeq ($(GOOS),darwin)
NAME:=$(NAME)-$(GOARCH)
endif
endif
# NOTE: This MAKEFILE can be used to build Xray-core locally and in Automatic workflows. It is \
provided for convinience in automatic building and functions as a part of it.
# NOTE: If you need to modify this file, please be aware that:\
- This file is not the main Makefile; it only accepts environment variables and builds the \
binary.\
- Automatic building expects the correct binaries to be built by this Makefile. If you \
intend to propose a change to this Makefile, carefully review the file below and ensure \
that the change will not accidently break the automatic building:\
.github/workflows/release.yml \
Otherwise it is recommended to contact the project maintainers.

LDFLAGS = -X github.com/xtls/xray-core/core.build=$(VERSION) -s -w -buildid=
PARAMS = -trimpath -ldflags "$(LDFLAGS)" -v
Expand Down
7 changes: 3 additions & 4 deletions xray-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
## Installation

- Linux Script
- [XTLS/Xray-install](https://github.com/XTLS/Xray-install)
- [team-cloudchaser/tempest](https://github.com/team-cloudchaser/tempest) (supports [`systemd`](https://systemd.io) and [OpenRC](https://github.com/OpenRC/openrc); Linux-only)
- [XTLS/Xray-install](https://github.com/XTLS/Xray-install) (**Official**)
- [tempest](https://github.com/team-cloudchaser/tempest) (supports [`systemd`](https://systemd.io) and [OpenRC](https://github.com/OpenRC/openrc); Linux-only)
- Docker
- Official: [ghcr.io/xtls/xray-core](https://ghcr.io/xtls/xray-core)
- [iamybj/docker-xray](https://hub.docker.com/r/iamybj/docker-xray)
- [ghcr.io/xtls/xray-core](https://ghcr.io/xtls/xray-core) (**Official**)
- [teddysun/xray](https://hub.docker.com/r/teddysun/xray)
- Web Panel
- [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)
Expand Down
27 changes: 21 additions & 6 deletions xray-go/app/commander/commander.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ type Commander struct {
services []Service
ohm outbound.Manager
tag string
listen string
}

// NewCommander creates a new Commander based on the given config.
func NewCommander(ctx context.Context, config *Config) (*Commander, error) {
c := &Commander{
tag: config.Tag,
tag: config.Tag,
listen: config.Listen,
}

common.Must(core.RequireFeatures(ctx, func(om outbound.Manager) {
Expand Down Expand Up @@ -66,16 +68,29 @@ func (c *Commander) Start() error {
}
c.Unlock()

var listen = func(listener net.Listener) {
if err := c.server.Serve(listener); err != nil {
newError("failed to start grpc server").Base(err).AtError().WriteToLog()
}
}

if len(c.listen) > 0 {
if l, err := net.Listen("tcp", c.listen); err != nil {
newError("API server failed to listen on ", c.listen).Base(err).AtError().WriteToLog()
return err
} else {
newError("API server listening on ", l.Addr()).AtInfo().WriteToLog()
go listen(l)
}
return nil
}

listener := &OutboundListener{
buffer: make(chan net.Conn, 4),
done: done.New(),
}

go func() {
if err := c.server.Serve(listener); err != nil {
newError("failed to start grpc server").Base(err).AtError().WriteToLog()
}
}()
go listen(listener)

if err := c.ohm.RemoveHandler(context.Background(), c.tag); err != nil {
newError("failed to remove existing handler").WriteToLog()
Expand Down
40 changes: 25 additions & 15 deletions xray-go/app/commander/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions xray-go/app/commander/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import "common/serial/typed_message.proto";
message Config {
// Tag of the outbound handler that handles grpc connections.
string tag = 1;

// Network address of commander grpc service.
string listen = 3;

// Services that supported by this server. All services must implement Service
// interface.
repeated xray.common.serial.TypedMessage service = 2;
Expand Down
Loading

0 comments on commit 997bf61

Please sign in to comment.