mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-03-03 22:53:00 +00:00
Compare commits
5 commits
d7c49f4379
...
356e7fd920
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
356e7fd920 | ||
|
|
6b3da4fe5e | ||
|
|
ea0da32e81 | ||
|
|
a6ca391ba1 | ||
|
|
511684d289 |
4 changed files with 133 additions and 26 deletions
121
.github/workflows/release.yml
vendored
121
.github/workflows/release.yml
vendored
|
|
@ -151,6 +151,96 @@ jobs:
|
||||||
overwrite: true
|
overwrite: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
|
||||||
|
# =================================
|
||||||
|
# macOS Build (darwin)
|
||||||
|
# =================================
|
||||||
|
build-macos:
|
||||||
|
name: Build for macOS
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- arch: amd64
|
||||||
|
runner: macos-13
|
||||||
|
- arch: arm64
|
||||||
|
runner: macos-14
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version-file: go.mod
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Build 3X-UI for macOS (CGO)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
export CGO_ENABLED=1
|
||||||
|
export GOOS=darwin
|
||||||
|
export GOARCH=${{ matrix.arch }}
|
||||||
|
|
||||||
|
go version
|
||||||
|
go env GOOS GOARCH CGO_ENABLED
|
||||||
|
|
||||||
|
go build -ldflags "-w -s" -o xui-release -v main.go
|
||||||
|
file xui-release
|
||||||
|
|
||||||
|
mkdir -p x-ui/bin
|
||||||
|
cp xui-release x-ui/x-ui
|
||||||
|
cp x-ui.sh x-ui/
|
||||||
|
|
||||||
|
# Download dependencies
|
||||||
|
cd x-ui/bin
|
||||||
|
Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v26.1.18/"
|
||||||
|
if [ "${{ matrix.arch }}" = "amd64" ]; then
|
||||||
|
curl -fsSL -o Xray-macos-64.zip "${Xray_URL}Xray-macos-64.zip"
|
||||||
|
unzip -q Xray-macos-64.zip
|
||||||
|
rm -f Xray-macos-64.zip
|
||||||
|
elif [ "${{ matrix.arch }}" = "arm64" ]; then
|
||||||
|
curl -fsSL -o Xray-macos-arm64-v8a.zip "${Xray_URL}Xray-macos-arm64-v8a.zip"
|
||||||
|
unzip -q Xray-macos-arm64-v8a.zip
|
||||||
|
rm -f Xray-macos-arm64-v8a.zip
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f geoip.dat geosite.dat
|
||||||
|
curl -fsSL -o geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
|
||||||
|
curl -fsSL -o geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
|
||||||
|
curl -fsSL -o geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
|
||||||
|
curl -fsSL -o geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
|
||||||
|
curl -fsSL -o geoip_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat
|
||||||
|
curl -fsSL -o geosite_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat
|
||||||
|
|
||||||
|
mv xray xray-macos-${{ matrix.arch }}
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
- name: Package
|
||||||
|
shell: bash
|
||||||
|
run: tar -zcvf x-ui-darwin-${{ matrix.arch }}.tar.gz x-ui
|
||||||
|
|
||||||
|
- name: Upload files to Artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: x-ui-darwin-${{ matrix.arch }}
|
||||||
|
path: ./x-ui-darwin-${{ matrix.arch }}.tar.gz
|
||||||
|
|
||||||
|
- name: Upload files to GH release
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
if: |
|
||||||
|
(github.event_name == 'release' && github.event.action == 'published') ||
|
||||||
|
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
file: x-ui-darwin-${{ matrix.arch }}.tar.gz
|
||||||
|
asset_name: x-ui-darwin-${{ matrix.arch }}.tar.gz
|
||||||
|
overwrite: true
|
||||||
|
prerelease: true
|
||||||
|
|
||||||
# =================================
|
# =================================
|
||||||
# Windows Build
|
# Windows Build
|
||||||
# =================================
|
# =================================
|
||||||
|
|
@ -173,14 +263,35 @@ jobs:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Install MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
msystem: MINGW64
|
||||||
|
update: true
|
||||||
|
install: >-
|
||||||
|
mingw-w64-x86_64-gcc
|
||||||
|
mingw-w64-x86_64-sqlite3
|
||||||
|
mingw-w64-x86_64-pkg-config
|
||||||
|
|
||||||
|
- name: Build 3X-UI for Windows (CGO)
|
||||||
|
shell: msys2 {0}
|
||||||
|
run: |
|
||||||
|
export PATH="/c/hostedtoolcache/windows/go/$(ls /c/hostedtoolcache/windows/go | sort -V | tail -n1)/x64/bin:$PATH"
|
||||||
|
|
||||||
|
export CGO_ENABLED=1
|
||||||
|
export GOOS=windows
|
||||||
|
export GOARCH=amd64
|
||||||
|
export CC=x86_64-w64-mingw32-gcc
|
||||||
|
|
||||||
|
which go
|
||||||
|
go version
|
||||||
|
gcc --version
|
||||||
|
|
||||||
|
go build -ldflags "-w -s" -o xui-release.exe -v main.go
|
||||||
|
|
||||||
- name: Build 3X-UI for Windows
|
- name: Build 3X-UI for Windows
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$env:CGO_ENABLED="1"
|
|
||||||
$env:GOOS="windows"
|
|
||||||
$env:GOARCH="amd64"
|
|
||||||
go build -ldflags "-w -s" -o xui-release.exe -v main.go
|
|
||||||
|
|
||||||
mkdir x-ui
|
mkdir x-ui
|
||||||
Copy-Item xui-release.exe x-ui\
|
Copy-Item xui-release.exe x-ui\
|
||||||
mkdir x-ui\bin
|
mkdir x-ui\bin
|
||||||
|
|
|
||||||
|
|
@ -554,7 +554,7 @@ class TlsStreamSettings extends XrayCommonClass {
|
||||||
maxVersion = TLS_VERSION_OPTION.TLS13,
|
maxVersion = TLS_VERSION_OPTION.TLS13,
|
||||||
cipherSuites = '',
|
cipherSuites = '',
|
||||||
rejectUnknownSni = false,
|
rejectUnknownSni = false,
|
||||||
verifyPeerCertInNames = ['dns.google', 'cloudflare-dns.com'],
|
verifyPeerCertByName = ['dns.google', 'cloudflare-dns.com'],
|
||||||
disableSystemRoot = false,
|
disableSystemRoot = false,
|
||||||
enableSessionResumption = false,
|
enableSessionResumption = false,
|
||||||
certificates = [new TlsStreamSettings.Cert()],
|
certificates = [new TlsStreamSettings.Cert()],
|
||||||
|
|
@ -569,7 +569,7 @@ class TlsStreamSettings extends XrayCommonClass {
|
||||||
this.maxVersion = maxVersion;
|
this.maxVersion = maxVersion;
|
||||||
this.cipherSuites = cipherSuites;
|
this.cipherSuites = cipherSuites;
|
||||||
this.rejectUnknownSni = rejectUnknownSni;
|
this.rejectUnknownSni = rejectUnknownSni;
|
||||||
this.verifyPeerCertInNames = Array.isArray(verifyPeerCertInNames) ? verifyPeerCertInNames.join(",") : verifyPeerCertInNames;
|
this.verifyPeerCertByName = Array.isArray(verifyPeerCertByName) ? verifyPeerCertByName.join(",") : verifyPeerCertByName;
|
||||||
this.disableSystemRoot = disableSystemRoot;
|
this.disableSystemRoot = disableSystemRoot;
|
||||||
this.enableSessionResumption = enableSessionResumption;
|
this.enableSessionResumption = enableSessionResumption;
|
||||||
this.certs = certificates;
|
this.certs = certificates;
|
||||||
|
|
@ -603,7 +603,7 @@ class TlsStreamSettings extends XrayCommonClass {
|
||||||
json.maxVersion,
|
json.maxVersion,
|
||||||
json.cipherSuites,
|
json.cipherSuites,
|
||||||
json.rejectUnknownSni,
|
json.rejectUnknownSni,
|
||||||
json.verifyPeerCertInNames,
|
json.verifyPeerCertByName,
|
||||||
json.disableSystemRoot,
|
json.disableSystemRoot,
|
||||||
json.enableSessionResumption,
|
json.enableSessionResumption,
|
||||||
certs,
|
certs,
|
||||||
|
|
@ -621,7 +621,7 @@ class TlsStreamSettings extends XrayCommonClass {
|
||||||
maxVersion: this.maxVersion,
|
maxVersion: this.maxVersion,
|
||||||
cipherSuites: this.cipherSuites,
|
cipherSuites: this.cipherSuites,
|
||||||
rejectUnknownSni: this.rejectUnknownSni,
|
rejectUnknownSni: this.rejectUnknownSni,
|
||||||
verifyPeerCertInNames: this.verifyPeerCertInNames.split(","),
|
verifyPeerCertByName: this.verifyPeerCertByName.split(","),
|
||||||
disableSystemRoot: this.disableSystemRoot,
|
disableSystemRoot: this.disableSystemRoot,
|
||||||
enableSessionResumption: this.enableSessionResumption,
|
enableSessionResumption: this.enableSessionResumption,
|
||||||
certificates: TlsStreamSettings.toJsonArray(this.certs),
|
certificates: TlsStreamSettings.toJsonArray(this.certs),
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,15 @@
|
||||||
// List of popular services for VLESS Reality Target/SNI randomization
|
// List of popular services for VLESS Reality Target/SNI randomization
|
||||||
const REALITY_TARGETS = [
|
const REALITY_TARGETS = [
|
||||||
{ target: 'www.icloud.com:443', sni: 'www.icloud.com,icloud.com' },
|
{ target: 'www.apple.com:443', sni: 'www.apple.com' },
|
||||||
{ target: 'www.apple.com:443', sni: 'www.apple.com,apple.com' },
|
{ target: 'www.icloud.com:443', sni: 'www.icloud.com' },
|
||||||
{ target: 'www.tesla.com:443', sni: 'www.tesla.com,tesla.com' },
|
{ target: 'www.amazon.com:443', sni: 'www.amazon.com' },
|
||||||
{ target: 'www.sony.com:443', sni: 'www.sony.com,sony.com' },
|
{ target: 'aws.amazon.com:443', sni: 'aws.amazon.com' },
|
||||||
{ target: 'www.nvidia.com:443', sni: 'www.nvidia.com,nvidia.com' },
|
{ target: 'www.oracle.com:443', sni: 'www.oracle.com' },
|
||||||
{ target: 'www.amd.com:443', sni: 'www.amd.com,amd.com' },
|
{ target: 'www.nvidia.com:443', sni: 'www.nvidia.com' },
|
||||||
{ target: 'azure.microsoft.com:443', sni: 'azure.microsoft.com,www.azure.com' },
|
{ target: 'www.amd.com:443', sni: 'www.amd.com' },
|
||||||
{ target: 'aws.amazon.com:443', sni: 'aws.amazon.com,amazon.com' },
|
{ target: 'www.intel.com:443', sni: 'www.intel.com' },
|
||||||
{ target: 'www.bing.com:443', sni: 'www.bing.com,bing.com' },
|
{ target: 'www.tesla.com:443', sni: 'www.tesla.com' },
|
||||||
{ target: 'www.oracle.com:443', sni: 'www.oracle.com,oracle.com' },
|
{ target: 'www.sony.com:443', sni: 'www.sony.com' }
|
||||||
{ target: 'www.intel.com:443', sni: 'www.intel.com,intel.com' },
|
|
||||||
{ target: 'www.microsoft.com:443', sni: 'www.microsoft.com,microsoft.com' },
|
|
||||||
{ target: 'www.amazon.com:443', sni: 'www.amazon.com,amazon.com' }
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -28,4 +25,3 @@ function getRandomRealityTarget() {
|
||||||
sni: selected.sni
|
sni: selected.sni
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@
|
||||||
<a-form-item label="Session Resumption">
|
<a-form-item label="Session Resumption">
|
||||||
<a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch>
|
<a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="VerifyPeerCertInNames">
|
<a-form-item label="verifyPeerCertByName">
|
||||||
<a-input v-model.trim="inbound.stream.tls.verifyPeerCertInNames"></a-input>
|
<a-input v-model.trim="inbound.stream.tls.verifyPeerCertByName"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-divider :style="{ margin: '3px 0' }"></a-divider>
|
<a-divider :style="{ margin: '3px 0' }"></a-divider>
|
||||||
<template v-for="cert,index in inbound.stream.tls.certs">
|
<template v-for="cert,index in inbound.stream.tls.certs">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue