mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
127
.github/workflows/release.yml
vendored
127
.github/workflows/release.yml
vendored
@@ -1,13 +1,26 @@
|
|||||||
name: Release X-UI
|
name: Release X-UI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "*"
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '**.js'
|
||||||
|
- '**.css'
|
||||||
|
- '**.html'
|
||||||
|
- '**.sh'
|
||||||
|
- '**.go'
|
||||||
|
- 'go.mod'
|
||||||
|
- 'go.sum'
|
||||||
|
- 'x-ui.service'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform:
|
platform:
|
||||||
@@ -15,10 +28,10 @@ jobs:
|
|||||||
- arm64
|
- arm64
|
||||||
- armv7
|
- armv7
|
||||||
- armv6
|
- armv6
|
||||||
- armv5
|
|
||||||
- 386
|
- 386
|
||||||
|
- armv5
|
||||||
- s390x
|
- s390x
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -27,53 +40,56 @@ jobs:
|
|||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
check-latest: true
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
if [ "${{ matrix.platform }}" == "arm64" ]; then
|
|
||||||
sudo apt install gcc-aarch64-linux-gnu
|
|
||||||
elif [ "${{ matrix.platform }}" == "armv7" ]; then
|
|
||||||
sudo apt install gcc-arm-linux-gnueabihf
|
|
||||||
elif [ "${{ matrix.platform }}" == "armv6" ]; then
|
|
||||||
sudo apt install gcc-arm-linux-gnueabihf
|
|
||||||
elif [ "${{ matrix.platform }}" == "armv5" ]; then
|
|
||||||
sudo apt install gcc-arm-linux-gnueabi
|
|
||||||
elif [ "${{ matrix.platform }}" == "386" ]; then
|
|
||||||
sudo apt install gcc-i686-linux-gnu
|
|
||||||
elif [ "${{ matrix.platform }}" == "s390x" ]; then
|
|
||||||
sudo apt install gcc-s390x-linux-gnu
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build x-ui
|
- name: Build x-ui
|
||||||
run: |
|
run: |
|
||||||
export CGO_ENABLED=1
|
export CGO_ENABLED=1
|
||||||
export GOOS=linux
|
export GOOS=linux
|
||||||
export GOARCH=${{ matrix.platform }}
|
export GOARCH=${{ matrix.platform }}
|
||||||
if [ "${{ matrix.platform }}" == "arm64" ]; then
|
TOOLCHAIN_URL=""
|
||||||
export GOARCH=arm64
|
MUSL_CC_HOST="https://github.com/musl-cc/musl.cc/releases/download/v0.0.1" #http://musl.cc
|
||||||
export CC=aarch64-linux-gnu-gcc
|
case "${{ matrix.platform }}" in
|
||||||
elif [ "${{ matrix.platform }}" == "armv7" ]; then
|
amd64)
|
||||||
export GOARCH=arm
|
TOOLCHAIN_URL="$MUSL_CC_HOST/x86_64-linux-musl-cross.tgz"
|
||||||
export GOARM=7
|
;;
|
||||||
export CC=arm-linux-gnueabihf-gcc
|
arm64)
|
||||||
elif [ "${{ matrix.platform }}" == "armv6" ]; then
|
TOOLCHAIN_URL="$MUSL_CC_HOST/aarch64-linux-musl-cross.tgz"
|
||||||
export GOARCH=arm
|
;;
|
||||||
export GOARM=6
|
armv7)
|
||||||
export CC=arm-linux-gnueabihf-gcc
|
TOOLCHAIN_URL="$MUSL_CC_HOST/armv7l-linux-musleabihf-cross.tgz"
|
||||||
elif [ "${{ matrix.platform }}" == "armv5" ]; then
|
export GOARCH=arm
|
||||||
export GOARCH=arm
|
export GOARM=7
|
||||||
export GOARM=5
|
;;
|
||||||
export CC=arm-linux-gnueabi-gcc
|
armv6)
|
||||||
elif [ "${{ matrix.platform }}" == "386" ]; then
|
TOOLCHAIN_URL="$MUSL_CC_HOST/armv6-linux-musleabihf-cross.tgz"
|
||||||
export GOARCH=386
|
export GOARCH=arm
|
||||||
export CC=i686-linux-gnu-gcc
|
export GOARM=6
|
||||||
elif [ "${{ matrix.platform }}" == "s390x" ]; then
|
;;
|
||||||
export GOARCH=s390x
|
armv5)
|
||||||
export CC=s390x-linux-gnu-gcc
|
TOOLCHAIN_URL="$MUSL_CC_HOST/arm-linux-musleabi-cross.tgz"
|
||||||
fi
|
export GOARCH=arm
|
||||||
|
export GOARM=5
|
||||||
go build -ldflags "-w -s" -o xui-release -v main.go
|
;;
|
||||||
|
386)
|
||||||
|
TOOLCHAIN_URL="$MUSL_CC_HOST/i686-linux-musl-cross.tgz"
|
||||||
|
;;
|
||||||
|
s390x)
|
||||||
|
TOOLCHAIN_URL="$MUSL_CC_HOST/s390x-linux-musl-cross.tgz"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo "Downloading musl toolchain for ${{ matrix.platform }}"
|
||||||
|
curl -LO "$TOOLCHAIN_URL"
|
||||||
|
tar -xf *.tgz
|
||||||
|
TOOLCHAIN_DIR=$(find . -maxdepth 1 -type d -name "*-cross" | head -n1)
|
||||||
|
TOOLCHAIN_DIR=$(realpath "$TOOLCHAIN_DIR")
|
||||||
|
export PATH="$TOOLCHAIN_DIR/bin:$PATH"
|
||||||
|
# Detect compiler
|
||||||
|
export CC=$(find $TOOLCHAIN_DIR/bin -name '*-gcc' | head -n1)
|
||||||
|
echo "Using CC=$CC"
|
||||||
|
go build -ldflags "-w -s -linkmode external -extldflags '-static'" -o xui-release -v main.go
|
||||||
|
file xui-release
|
||||||
|
ldd xui-release || echo "Static binary confirmed"
|
||||||
|
|
||||||
mkdir x-ui
|
mkdir x-ui
|
||||||
cp xui-release x-ui/
|
cp xui-release x-ui/
|
||||||
@@ -84,7 +100,7 @@ jobs:
|
|||||||
cd x-ui/bin
|
cd x-ui/bin
|
||||||
|
|
||||||
# Download dependencies
|
# Download dependencies
|
||||||
Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v25.7.26/"
|
Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v25.8.3/"
|
||||||
if [ "${{ matrix.platform }}" == "amd64" ]; then
|
if [ "${{ matrix.platform }}" == "amd64" ]; then
|
||||||
wget -q ${Xray_URL}Xray-linux-64.zip
|
wget -q ${Xray_URL}Xray-linux-64.zip
|
||||||
unzip Xray-linux-64.zip
|
unzip Xray-linux-64.zip
|
||||||
@@ -101,14 +117,14 @@ jobs:
|
|||||||
wget -q ${Xray_URL}Xray-linux-arm32-v6.zip
|
wget -q ${Xray_URL}Xray-linux-arm32-v6.zip
|
||||||
unzip Xray-linux-arm32-v6.zip
|
unzip Xray-linux-arm32-v6.zip
|
||||||
rm -f Xray-linux-arm32-v6.zip
|
rm -f Xray-linux-arm32-v6.zip
|
||||||
elif [ "${{ matrix.platform }}" == "armv5" ]; then
|
|
||||||
wget -q ${Xray_URL}Xray-linux-arm32-v5.zip
|
|
||||||
unzip Xray-linux-arm32-v5.zip
|
|
||||||
rm -f Xray-linux-arm32-v5.zip
|
|
||||||
elif [ "${{ matrix.platform }}" == "386" ]; then
|
elif [ "${{ matrix.platform }}" == "386" ]; then
|
||||||
wget -q ${Xray_URL}Xray-linux-32.zip
|
wget -q ${Xray_URL}Xray-linux-32.zip
|
||||||
unzip Xray-linux-32.zip
|
unzip Xray-linux-32.zip
|
||||||
rm -f Xray-linux-32.zip
|
rm -f Xray-linux-32.zip
|
||||||
|
elif [ "${{ matrix.platform }}" == "armv5" ]; then
|
||||||
|
wget -q ${Xray_URL}Xray-linux-arm32-v5.zip
|
||||||
|
unzip Xray-linux-arm32-v5.zip
|
||||||
|
rm -f Xray-linux-arm32-v5.zip
|
||||||
elif [ "${{ matrix.platform }}" == "s390x" ]; then
|
elif [ "${{ matrix.platform }}" == "s390x" ]; then
|
||||||
wget -q ${Xray_URL}Xray-linux-s390x.zip
|
wget -q ${Xray_URL}Xray-linux-s390x.zip
|
||||||
unzip Xray-linux-s390x.zip
|
unzip Xray-linux-s390x.zip
|
||||||
@@ -124,9 +140,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
run: tar -zcvf x-ui-linux-${{ matrix.platform }}.tar.gz x-ui
|
run: tar -zcvf x-ui-linux-${{ matrix.platform }}.tar.gz x-ui
|
||||||
|
|
||||||
|
- name: Upload files to Artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: x-ui-linux-${{ matrix.platform }}
|
||||||
|
path: ./x-ui-linux-${{ matrix.platform }}.tar.gz
|
||||||
|
|
||||||
- name: Upload files to GH release
|
- name: Upload files to GH release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ case $1 in
|
|||||||
esac
|
esac
|
||||||
mkdir -p build/bin
|
mkdir -p build/bin
|
||||||
cd build/bin
|
cd build/bin
|
||||||
wget -q "https://github.com/XTLS/Xray-core/releases/download/v25.7.26/Xray-linux-${ARCH}.zip"
|
wget -q "https://github.com/XTLS/Xray-core/releases/download/v25.8.3/Xray-linux-${ARCH}.zip"
|
||||||
unzip "Xray-linux-${ARCH}.zip"
|
unzip "Xray-linux-${ARCH}.zip"
|
||||||
rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat LICENSE README.md
|
rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat LICENSE README.md
|
||||||
mv xray "xray-linux-${FNAME}"
|
mv xray "xray-linux-${FNAME}"
|
||||||
|
|||||||
@@ -429,6 +429,11 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string {
|
|||||||
params["fp"] = fp
|
params["fp"] = fp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if pqvValue, ok := searchKey(realitySettings, "mldsa65Verify"); ok {
|
||||||
|
if pqv, ok := pqvValue.(string); ok && len(pqv) > 0 {
|
||||||
|
params["pqv"] = pqv
|
||||||
|
}
|
||||||
|
}
|
||||||
params["spx"] = "/" + random.Seq(15)
|
params["spx"] = "/" + random.Seq(15)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -619,6 +624,11 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string
|
|||||||
params["fp"] = fp
|
params["fp"] = fp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if pqvValue, ok := searchKey(realitySettings, "mldsa65Verify"); ok {
|
||||||
|
if pqv, ok := pqvValue.(string); ok && len(pqv) > 0 {
|
||||||
|
params["pqv"] = pqv
|
||||||
|
}
|
||||||
|
}
|
||||||
params["spx"] = "/" + random.Seq(15)
|
params["spx"] = "/" + random.Seq(15)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1385,6 +1385,9 @@ class Inbound extends XrayCommonClass {
|
|||||||
if (!ObjectUtil.isEmpty(this.stream.reality.settings.spiderX)) {
|
if (!ObjectUtil.isEmpty(this.stream.reality.settings.spiderX)) {
|
||||||
params.set("spx", this.stream.reality.settings.spiderX);
|
params.set("spx", this.stream.reality.settings.spiderX);
|
||||||
}
|
}
|
||||||
|
if (!ObjectUtil.isEmpty(this.stream.reality.settings.mldsa65Verify)) {
|
||||||
|
params.set("pqv", this.stream.reality.settings.mldsa65Verify);
|
||||||
|
}
|
||||||
if (type == 'tcp' && !ObjectUtil.isEmpty(flow)) {
|
if (type == 'tcp' && !ObjectUtil.isEmpty(flow)) {
|
||||||
params.set("flow", flow);
|
params.set("flow", flow);
|
||||||
}
|
}
|
||||||
@@ -1565,6 +1568,9 @@ class Inbound extends XrayCommonClass {
|
|||||||
if (!ObjectUtil.isEmpty(this.stream.reality.settings.spiderX)) {
|
if (!ObjectUtil.isEmpty(this.stream.reality.settings.spiderX)) {
|
||||||
params.set("spx", this.stream.reality.settings.spiderX);
|
params.set("spx", this.stream.reality.settings.spiderX);
|
||||||
}
|
}
|
||||||
|
if (!ObjectUtil.isEmpty(this.stream.reality.settings.mldsa65Verify)) {
|
||||||
|
params.set("pqv", this.stream.reality.settings.mldsa65Verify);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -392,7 +392,8 @@ class RealityStreamSettings extends CommonClass {
|
|||||||
fingerprint = '',
|
fingerprint = '',
|
||||||
serverName = '',
|
serverName = '',
|
||||||
shortId = '',
|
shortId = '',
|
||||||
spiderX = '/'
|
spiderX = '',
|
||||||
|
mldsa65Verify = ''
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.publicKey = publicKey;
|
this.publicKey = publicKey;
|
||||||
@@ -400,6 +401,7 @@ class RealityStreamSettings extends CommonClass {
|
|||||||
this.serverName = serverName;
|
this.serverName = serverName;
|
||||||
this.shortId = shortId
|
this.shortId = shortId
|
||||||
this.spiderX = spiderX;
|
this.spiderX = spiderX;
|
||||||
|
this.mldsa65Verify = mldsa65Verify;
|
||||||
}
|
}
|
||||||
static fromJson(json = {}) {
|
static fromJson(json = {}) {
|
||||||
return new RealityStreamSettings(
|
return new RealityStreamSettings(
|
||||||
@@ -408,6 +410,7 @@ class RealityStreamSettings extends CommonClass {
|
|||||||
json.serverName,
|
json.serverName,
|
||||||
json.shortId,
|
json.shortId,
|
||||||
json.spiderX,
|
json.spiderX,
|
||||||
|
json.mldsa65Verify,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
toJson() {
|
toJson() {
|
||||||
@@ -417,6 +420,7 @@ class RealityStreamSettings extends CommonClass {
|
|||||||
serverName: this.serverName,
|
serverName: this.serverName,
|
||||||
shortId: this.shortId,
|
shortId: this.shortId,
|
||||||
spiderX: this.spiderX,
|
spiderX: this.spiderX,
|
||||||
|
mldsa65Verify: this.mldsa65Verify,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -792,7 +796,8 @@ class Outbound extends CommonClass {
|
|||||||
let sni = url.searchParams.get('sni') ?? '';
|
let sni = url.searchParams.get('sni') ?? '';
|
||||||
let sid = url.searchParams.get('sid') ?? '';
|
let sid = url.searchParams.get('sid') ?? '';
|
||||||
let spx = url.searchParams.get('spx') ?? '';
|
let spx = url.searchParams.get('spx') ?? '';
|
||||||
stream.reality = new RealityStreamSettings(pbk, fp, sni, sid, spx);
|
let pqv = url.searchParams.get('pqv') ?? '';
|
||||||
|
stream.reality = new RealityStreamSettings(pbk, fp, sni, sid, spx, pqv);
|
||||||
}
|
}
|
||||||
|
|
||||||
const regex = /([^@]+):\/\/([^@]+)@(.+):(\d+)(.*)$/;
|
const regex = /([^@]+):\/\/([^@]+)@(.+):(\d+)(.*)$/;
|
||||||
|
|||||||
@@ -447,6 +447,9 @@
|
|||||||
<a-form-item label="Public Key">
|
<a-form-item label="Public Key">
|
||||||
<a-input v-model.trim="outbound.stream.reality.publicKey"></a-input>
|
<a-input v-model.trim="outbound.stream.reality.publicKey"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item label="mldsa65 Verify">
|
||||||
|
<a-input v-model.trim="outbound.stream.reality.mldsa65Verify"></a-input>
|
||||||
|
</a-form-item>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user