From 4fdef3cfde47a5febe969f7223ddd49800dcd7a4 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Tue, 24 Sep 2024 11:38:10 +0200 Subject: [PATCH 01/34] add or remove noise --- web/assets/js/model/outbound.js | 32 ++++++- web/assets/js/model/xray.js | 10 +- web/html/xui/form/outbound.html | 42 ++++++--- .../xui/form/stream/stream_splithttp.html | 12 +-- web/html/xui/settings.html | 92 +++++++++++-------- web/service/config.json | 5 +- 6 files changed, 125 insertions(+), 68 deletions(-) diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index bc4ad735d3..5772d34fec 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -854,7 +854,7 @@ Outbound.FreedomSettings = class extends CommonClass { timeout = 10, redirect = '', fragment = {}, - noises = {} + noises = [] ) { super(); this.domainStrategy = domainStrategy; @@ -864,13 +864,21 @@ Outbound.FreedomSettings = class extends CommonClass { this.noises = noises; } + addNoise() { + this.noises.push(new Outbound.FreedomSettings.Noise()); + } + + delNoise(index) { + this.noises.splice(index, 1); + } + static fromJson(json = {}) { return new Outbound.FreedomSettings( json.domainStrategy, json.timeout, json.redirect, json.fragment ? Outbound.FreedomSettings.Fragment.fromJson(json.fragment) : undefined, - json.noises ? Outbound.FreedomSettings.Noises.fromJson(json.noises) : undefined, + json.noises ? json.noises.map(noise => Outbound.FreedomSettings.Noise.fromJson(noise)) : [new Outbound.FreedomSettings.Noise()], ); } @@ -880,10 +888,11 @@ Outbound.FreedomSettings = class extends CommonClass { timeout: this.timeout, redirect: this.redirect, fragment: Object.keys(this.fragment).length === 0 ? undefined : this.fragment, - noises: Object.keys(this.noises).length === 0 ? undefined : this.noises, + noises: Outbound.FreedomSettings.Noise.toJsonArray(this.noises), }; } }; + Outbound.FreedomSettings.Fragment = class extends CommonClass { constructor(packets = '1-3', length = '', interval = '') { super(); @@ -900,7 +909,8 @@ Outbound.FreedomSettings.Fragment = class extends CommonClass { ); } }; -Outbound.FreedomSettings.Noises = class extends CommonClass { + +Outbound.FreedomSettings.Noise = class extends CommonClass { constructor( type = 'rand', packet = '10-20', @@ -913,12 +923,24 @@ Outbound.FreedomSettings.Noises = class extends CommonClass { } static fromJson(json = {}) { - return new Outbound.FreedomSettings.Noises( + return new Outbound.FreedomSettings.Noise( json.type, json.packet, json.delay, ); } + + toJson() { + return { + type: this.type, + packet: this.packet, + delay: this.delay, + }; + } + + static toJsonArray(noises) { + return noises.map(noise => noise.toJson()); + } }; Outbound.BlackholeSettings = class extends CommonClass { diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 93c3ac1e1d..74211952e2 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -530,10 +530,10 @@ class SplitHTTPStreamSettings extends XrayCommonClass { noSSEHeader = false, xPaddingBytes = "100-1000", xmux = { - maxConnections: 0, - maxConcurrency: 0, - cMaxReuseTimes: 0, - cMaxLifetimeMs: 0 + maxConcurrency: 0, + maxConnections: 0, + cMaxReuseTimes: 0, + cMaxLifetimeMs: 0 } ) { super(); @@ -581,8 +581,8 @@ class SplitHTTPStreamSettings extends XrayCommonClass { noSSEHeader: this.noSSEHeader, xPaddingBytes: this.xPaddingBytes, xmux: { - maxConnections: this.xmux.maxConnections, maxConcurrency: this.xmux.maxConcurrency, + maxConnections: this.xmux.maxConnections, cMaxReuseTimes: this.xmux.cMaxReuseTimes, cMaxLifetimeMs: this.xmux.cMaxLifetimeMs } diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index 21fedd8873..bbad5c8574 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -46,21 +46,39 @@ + + - + + - diff --git a/web/html/xui/form/stream/stream_splithttp.html b/web/html/xui/form/stream/stream_splithttp.html index f03a039c7c..453263de01 100644 --- a/web/html/xui/form/stream/stream_splithttp.html +++ b/web/html/xui/form/stream/stream_splithttp.html @@ -34,17 +34,17 @@ - - - - + + + + - + - + {{end}} diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index b95ce0a58e..4ffbb0b7ae 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -314,23 +314,29 @@ - + - - [[ p ]] + + + [[ p ]] - - + + + Remove + Add Noise @@ -436,11 +442,9 @@ protocol: "freedom", settings: { domainStrategy: "AsIs", - noises: { - type: "rand", - packet: "10-20", - delay: "10-16", - } + noises: [ + { type: "rand", packet: "10-20", delay: "10-16" }, + ], }, }, defaultMux: { @@ -604,6 +608,30 @@ this.user.loginSecret = ""; } }, + addNoise() { + const newNoise = { type: "rand", packet: "10-20", delay: "10-16" }; + this.noisesArray = [...this.noisesArray, newNoise]; + }, + removeNoise(index) { + const newNoises = [...this.noisesArray]; + newNoises.splice(index, 1); + this.noisesArray = newNoises; + }, + updateNoiseType(index, value) { + const updatedNoises = [...this.noisesArray]; + updatedNoises[index] = { ...updatedNoises[index], type: value }; + this.noisesArray = updatedNoises; + }, + updateNoisePacket(index, value) { + const updatedNoises = [...this.noisesArray]; + updatedNoises[index] = { ...updatedNoises[index], packet: value }; + this.noisesArray = updatedNoises; + }, + updateNoiseDelay(index, value) { + const updatedNoises = [...this.noisesArray]; + updatedNoises[index] = { ...updatedNoises[index], delay: value }; + this.noisesArray = updatedNoises; + }, }, computed: { fragment: { @@ -643,37 +671,25 @@ } }, noises: { - get: function () { return this.allSetting?.subJsonNoises != ""; }, - set: function (v) { - this.allSetting.subJsonNoises = v ? JSON.stringify(this.defaultNoises) : ""; - } - }, - noisesType: { - get: function () { return this.noises ? JSON.parse(this.allSetting.subJsonNoises).settings.noises.type : ""; }, - set: function (v) { - if (v != "") { - newNoises = JSON.parse(this.allSetting.subJsonNoises); - newNoises.settings.noises.type = v; - this.allSetting.subJsonNoises = JSON.stringify(newNoises); - } - } - }, - noisesPacket: { - get: function () { return this.noises ? JSON.parse(this.allSetting.subJsonNoises).settings.noises.packet : ""; }, - set: function (v) { - if (v != "") { - newNoises = JSON.parse(this.allSetting.subJsonNoises); - newNoises.settings.noises.packet = v; - this.allSetting.subJsonNoises = JSON.stringify(newNoises); + get() { + return this.allSetting?.subJsonNoises != ""; + }, + set(v) { + if (v) { + this.allSetting.subJsonNoises = JSON.stringify(this.defaultNoises); + } else { + this.allSetting.subJsonNoises = ""; } } }, - noisesDelay: { - get: function () { return this.noises ? JSON.parse(this.allSetting.subJsonNoises).settings.noises.delay : ""; }, - set: function (v) { - if (v != "") { - newNoises = JSON.parse(this.allSetting.subJsonNoises); - newNoises.settings.noises.delay = v; + noisesArray: { + get() { + return this.noises ? JSON.parse(this.allSetting.subJsonNoises).settings.noises : []; + }, + set(value) { + if (this.noises) { + const newNoises = JSON.parse(this.allSetting.subJsonNoises); + newNoises.settings.noises = value; this.allSetting.subJsonNoises = JSON.stringify(newNoises); } } diff --git a/web/service/config.json b/web/service/config.json index 3f7fbc3a49..122963fe3d 100644 --- a/web/service/config.json +++ b/web/service/config.json @@ -2,8 +2,9 @@ "log": { "access": "none", "dnsLog": false, - "error": "./error.log", - "loglevel": "warning" + "error": "", + "loglevel": "warning", + "maskAddress": "" }, "api": { "tag": "api", From e5835c299c2c975354e1e9ab7b6fa1497183d963 Mon Sep 17 00:00:00 2001 From: Pavel Kogen Date: Tue, 24 Sep 2024 12:53:12 +0300 Subject: [PATCH 02/34] OS Support - Amazon Linux (#2564) --- README.es_ES.md | 1 + README.md | 1 + README.ru_RU.md | 1 + README.zh_CN.md | 1 + install.sh | 10 +++++++--- x-ui.sh | 10 +++++++--- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.es_ES.md b/README.es_ES.md index bab3a57a7b..5c0b810931 100644 --- a/README.es_ES.md +++ b/README.es_ES.md @@ -225,6 +225,7 @@ location /sub { - AlmaLinux 9+ - Rockylinux 9+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## Arquitecturas y Dispositivos Compatibles diff --git a/README.md b/README.md index d2d2cf1781..0b5a5a9998 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,7 @@ location /sub { - Rocky Linux 9+ - Oracle Linux 8+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## Supported Architectures and Devices diff --git a/README.ru_RU.md b/README.ru_RU.md index a154171243..07e30a5bb8 100644 --- a/README.ru_RU.md +++ b/README.ru_RU.md @@ -253,6 +253,7 @@ location /sub { - Rocky Linux 9+ - Oracle Linux 8+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## Поддерживаемые архитектуры и устройства diff --git a/README.zh_CN.md b/README.zh_CN.md index eab52883d6..0406b1b9c1 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -248,6 +248,7 @@ location /sub { - AlmaLinux 9+ - Rockylinux 9+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## 支持的架构和设备
diff --git a/install.sh b/install.sh index d60d9a8bb0..2fe66b083e 100644 --- a/install.sh +++ b/install.sh @@ -39,12 +39,12 @@ arch() { echo "arch: $(arch)" os_version="" -os_version=$(grep -i version_id /etc/os-release | cut -d \" -f2 | cut -d . -f1) +os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"') if [[ "${release}" == "arch" ]]; then echo "Your OS is Arch Linux" elif [[ "${release}" == "parch" ]]; then - echo "Your OS is Parch linux" + echo "Your OS is Parch Linux" elif [[ "${release}" == "manjaro" ]]; then echo "Your OS is Manjaro" elif [[ "${release}" == "armbian" ]]; then @@ -63,6 +63,10 @@ elif [[ "${release}" == "fedora" ]]; then if [[ ${os_version} -lt 36 ]]; then echo -e "${red} Please use Fedora 36 or higher version!${plain}\n" && exit 1 fi +elif [[ "${release}" == "amzn" ]]; then + if [[ ${os_version} != "2023" ]]; then + echo -e "${red} Please use Amazon Linux 2023!${plain}\n" && exit 1 + fi elif [[ "${release}" == "debian" ]]; then if [[ ${os_version} -lt 11 ]]; then echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1 @@ -94,8 +98,8 @@ else echo "- Rocky Linux 9+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" + echo "- Amazon Linux 2023" exit 1 - fi install_base() { diff --git a/x-ui.sh b/x-ui.sh index 0b6bd331c6..46449217aa 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -36,12 +36,12 @@ fi echo "The OS release is: $release" os_version="" -os_version=$(grep -i version_id /etc/os-release | cut -d \" -f2 | cut -d . -f1) +os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"') if [[ "${release}" == "arch" ]]; then echo "Your OS is Arch Linux" elif [[ "${release}" == "parch" ]]; then - echo "Your OS is Parch linux" + echo "Your OS is Parch Linux" elif [[ "${release}" == "manjaro" ]]; then echo "Your OS is Manjaro" elif [[ "${release}" == "armbian" ]]; then @@ -60,6 +60,10 @@ elif [[ "${release}" == "fedora" ]]; then if [[ ${os_version} -lt 36 ]]; then echo -e "${red} Please use Fedora 36 or higher version!${plain}\n" && exit 1 fi +elif [[ "${release}" == "amzn" ]]; then + if [[ ${os_version} != "2023" ]]; then + echo -e "${red} Please use Amazon Linux 2023!${plain}\n" && exit 1 + fi elif [[ "${release}" == "debian" ]]; then if [[ ${os_version} -lt 11 ]]; then echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1 @@ -91,8 +95,8 @@ else echo "- Rocky Linux 9+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" + echo "- Amazon Linux 2023" exit 1 - fi # Declare Variables From 16b47959565570e9f121080af157f7c0b95bfa25 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Tue, 24 Sep 2024 12:00:37 +0200 Subject: [PATCH 03/34] removed - timeout --- web/assets/js/model/outbound.js | 4 ---- web/assets/js/model/xray.js | 6 +----- web/html/xui/form/outbound.html | 3 --- web/html/xui/form/protocol/dokodemo.html | 3 --- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 5772d34fec..a66cc21521 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -851,14 +851,12 @@ Outbound.Settings = class extends CommonClass { Outbound.FreedomSettings = class extends CommonClass { constructor( domainStrategy = '', - timeout = 10, redirect = '', fragment = {}, noises = [] ) { super(); this.domainStrategy = domainStrategy; - this.timeout = timeout; this.redirect = redirect; this.fragment = fragment; this.noises = noises; @@ -875,7 +873,6 @@ Outbound.FreedomSettings = class extends CommonClass { static fromJson(json = {}) { return new Outbound.FreedomSettings( json.domainStrategy, - json.timeout, json.redirect, json.fragment ? Outbound.FreedomSettings.Fragment.fromJson(json.fragment) : undefined, json.noises ? json.noises.map(noise => Outbound.FreedomSettings.Noise.fromJson(noise)) : [new Outbound.FreedomSettings.Noise()], @@ -885,7 +882,6 @@ Outbound.FreedomSettings = class extends CommonClass { toJson() { return { domainStrategy: ObjectUtil.isEmpty(this.domainStrategy) ? undefined : this.domainStrategy, - timeout: this.timeout, redirect: this.redirect, fragment: Object.keys(this.fragment).length === 0 ? undefined : this.fragment, noises: Outbound.FreedomSettings.Noise.toJsonArray(this.noises), diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 74211952e2..078b87119e 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -2513,15 +2513,13 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { address, port, network = 'tcp,udp', - followRedirect = false, - timeout = 30 + followRedirect = false ) { super(protocol); this.address = address; this.port = port; this.network = network; this.followRedirect = followRedirect; - this.timeout = timeout; } static fromJson(json = {}) { @@ -2531,7 +2529,6 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { json.port, json.network, json.followRedirect, - json.timeout, ); } @@ -2541,7 +2538,6 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { port: this.port, network: this.network, followRedirect: this.followRedirect, - timeout: this.timeout, }; } }; diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index bbad5c8574..604108fe5b 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -22,9 +22,6 @@ [[ s ]] - - - diff --git a/web/html/xui/form/protocol/dokodemo.html b/web/html/xui/form/protocol/dokodemo.html index e7e1d95083..70ffe7e071 100644 --- a/web/html/xui/form/protocol/dokodemo.html +++ b/web/html/xui/form/protocol/dokodemo.html @@ -16,8 +16,5 @@ - - - {{end}} From d5de8e1bf37e797dfd587d09bab4ade2ba1f943a Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Tue, 24 Sep 2024 12:18:42 +0200 Subject: [PATCH 04/34] removeNoise - hide when only one noise --- web/html/xui/settings.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 4ffbb0b7ae..2ea44418d4 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -333,7 +333,7 @@ @input="(value) => updateNoisePacket(index, value)" placeholder="5-10"> - Remove + Remove Add Noise From 75dd7b93f528df313e465a3573c4ea99876d927f Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Tue, 24 Sep 2024 12:19:08 +0200 Subject: [PATCH 05/34] update dependencies --- go.mod | 6 +++--- go.sum | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d66f430006..7f5e5357be 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( require ( github.com/andybalholm/brotli v1.1.0 // indirect - github.com/bytedance/sonic v1.12.2 // indirect + github.com/bytedance/sonic v1.12.3 // indirect github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cloudflare/circl v1.4.0 // indirect github.com/cloudwego/base64x v0.1.4 // indirect @@ -49,7 +49,7 @@ require ( github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/compress v1.17.10 // indirect github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect @@ -64,7 +64,7 @@ require ( github.com/quic-go/quic-go v0.47.0 // indirect github.com/refraction-networking/utls v1.6.7 // indirect github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/sagernet/sing v0.4.3 // indirect github.com/sagernet/sing-shadowsocks v0.2.7 // indirect github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 // indirect diff --git a/go.sum b/go.sum index b6158bf195..b3c26149aa 100644 --- a/go.sum +++ b/go.sum @@ -20,6 +20,8 @@ github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBT github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/bytedance/sonic v1.12.2 h1:oaMFuRTpMHYLpCntGca65YWt5ny+wAceDERTkT2L9lg= github.com/bytedance/sonic v1.12.2/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -127,6 +129,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= +github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= @@ -198,6 +202,8 @@ github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/sagernet/sing v0.4.3 h1:Ty/NAiNnVd6844k7ujlL5lkzydhcTH5Psc432jXA4Y8= github.com/sagernet/sing v0.4.3/go.mod h1:ieZHA/+Y9YZfXs2I3WtuwgyCZ6GPsIR7HdKb1SdEnls= From 7c892ac05198b563270023cb1409acde7537aafc Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Tue, 24 Sep 2024 13:24:10 +0200 Subject: [PATCH 06/34] Iplimit - warning improved --- web/job/check_client_ip_job.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/web/job/check_client_ip_job.go b/web/job/check_client_ip_job.go index 481d756b6c..c38550b7e1 100644 --- a/web/job/check_client_ip_job.go +++ b/web/job/check_client_ip_job.go @@ -37,17 +37,11 @@ func (j *CheckClientIpJob) Run() { shouldClearAccessLog := false iplimitActive := j.hasLimitIp() - f2bInstalled := j.checkFail2BanInstalled() + f2bInstalled := j.checkFail2BanInstalled(iplimitActive) isAccessLogAvailable := j.checkAccessLogAvailable(iplimitActive) - if iplimitActive { - if f2bInstalled && isAccessLogAvailable { - shouldClearAccessLog = j.processLogFile() - } else { - if !f2bInstalled { - logger.Warning("[iplimit] fail2ban is not installed. IP limiting may not work properly.") - } - } + if iplimitActive && f2bInstalled && isAccessLogAvailable { + shouldClearAccessLog = j.processLogFile() } if shouldClearAccessLog || (isAccessLogAvailable && time.Now().Unix()-j.lastClear > 3600) { @@ -168,11 +162,17 @@ func (j *CheckClientIpJob) processLogFile() bool { return shouldCleanLog } -func (j *CheckClientIpJob) checkFail2BanInstalled() bool { +func (j *CheckClientIpJob) checkFail2BanInstalled(iplimitActive bool) bool { cmd := "fail2ban-client" args := []string{"-h"} err := exec.Command(cmd, args...).Run() - return err == nil + + if iplimitActive && err != nil { + logger.Warning("[LimitIP] Fail2Ban is not installed, Please install Fail2Ban from the x-ui bash menu.") + return false + } + + return true } func (j *CheckClientIpJob) checkAccessLogAvailable(iplimitActive bool) bool { @@ -183,7 +183,7 @@ func (j *CheckClientIpJob) checkAccessLogAvailable(iplimitActive bool) bool { if accessLogPath == "none" || accessLogPath == "" { if iplimitActive { - logger.Warning("Access log path is not set, and IP limit is active. Please configure the access log path.") + logger.Warning("[LimitIP] Access log path is not set, Please configure the access log path in Xray configs.") } return false } From c30c6f08f36e1784ba59108f0b9d3d160b83daa1 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Tue, 24 Sep 2024 14:57:14 +0200 Subject: [PATCH 07/34] Direct Sub Json - geoIP, geoSite --- web/html/xui/settings.html | 66 ++++++++++++++++++++++------ web/translation/translate.en_US.toml | 2 +- web/translation/translate.es_ES.toml | 2 +- web/translation/translate.fa_IR.toml | 2 +- web/translation/translate.id_ID.toml | 2 +- web/translation/translate.pt_BR.toml | 2 +- web/translation/translate.ru_RU.toml | 2 +- web/translation/translate.tr_TR.toml | 2 +- web/translation/translate.uk_UA.toml | 2 +- web/translation/translate.vi_VN.toml | 2 +- web/translation/translate.zh_CN.toml | 2 +- 11 files changed, 63 insertions(+), 23 deletions(-) diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 2ea44418d4..7cebfd1eec 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -380,9 +380,14 @@ - + - + + + + + + @@ -458,8 +463,7 @@ type: "field", outboundTag: "direct", domain: [ - "geosite:category-ir", - "geosite:cn" + "geosite:category-ir" ], "enabled": true }, @@ -468,17 +472,30 @@ outboundTag: "direct", ip: [ "geoip:private", - "geoip:ir", - "geoip:cn" + "geoip:ir" ], enabled: true }, ], - countryOptions: [ + geoIPOptions: [ { label: 'Private IP/Domain', value: 'private' }, { label: '🇮🇷 Iran', value: 'ir' }, { label: '🇨🇳 China', value: 'cn' }, { label: '🇷🇺 Russia', value: 'ru' }, + { label: '🇻🇳 Vietnam', value: 'vn' }, + { label: '🇪🇸 Spain', value: 'es' }, + { label: '🇮🇩 Indonesia', value: 'id' }, + { label: '🇺🇦 Ukraine', value: 'ua' }, + { label: '🇹🇷 Türkiye', value: 'tr' }, + { label: '🇧🇷 Brazil', value: 'br' }, + ], + geoSiteOptions: [ + { label: '🇮🇷 Iran', value: 'ir' }, + { label: '🇨🇳 China', value: 'cn' }, + { label: '🇷🇺 Russia', value: 'ru' }, + { label: 'Apple', value: 'apple' }, + { label: 'Meta', value: 'meta' }, + { label: 'Google', value: 'google' }, ], get remarkModel() { rm = this.allSetting.remarkModel; @@ -730,26 +747,49 @@ this.allSetting.subJsonRules = v ? JSON.stringify(this.defaultRules) : ""; } }, - directCountries: { + geoIP: { get: function () { if (!this.enableDirect) return []; - rules = JSON.parse(this.allSetting.subJsonRules); + const rules = JSON.parse(this.allSetting.subJsonRules); return Array.isArray(rules) ? rules[1].ip.map(d => d.replace("geoip:", "")) : []; }, set: function (v) { - rules = JSON.parse(this.allSetting.subJsonRules); + const rules = JSON.parse(this.allSetting.subJsonRules); if (!Array.isArray(rules)) return; - rules[0].domain = []; + rules[1].ip = []; + v.forEach(d => { + rules[1].ip.push("geoip:" + d); + }); + this.allSetting.subJsonRules = JSON.stringify(rules); + } + }, + geoSite: { + get: function () { + if (!this.enableDirect) return []; + const rules = JSON.parse(this.allSetting.subJsonRules); + return Array.isArray(rules) ? + rules[0].domain.map(d => { + if (d.startsWith("geosite:category-")) { + return d.replace("geosite:category-", ""); + } + return d.replace("geosite:", ""); + }) + : []; + }, + set: function (v) { + const rules = JSON.parse(this.allSetting.subJsonRules); + if (!Array.isArray(rules)) return; + + rules[0].domain = []; v.forEach(d => { let category = ''; - if (["cn", "private"].includes(d)) { + if (["cn", "apple", "meta", "google"].includes(d)) { category = ""; } else if (["ru", "ir"].includes(d)) { category = "category-"; } rules[0].domain.push("geosite:" + category + d); - rules[1].ip.push("geoip:" + d); }); this.allSetting.subJsonRules = JSON.stringify(rules); } diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index f92f46edc4..0978e84e55 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -316,7 +316,7 @@ "muxSett" = "Mux Settings" "direct" = "Direct Connection" "directDesc" = "Directly establishes connections with domains or IP ranges of a specific country." -"directSett" = "Direct Connection Options" + [pages.xray] "title" = "Xray Configs" diff --git a/web/translation/translate.es_ES.toml b/web/translation/translate.es_ES.toml index 462e534e0f..1997bd8282 100644 --- a/web/translation/translate.es_ES.toml +++ b/web/translation/translate.es_ES.toml @@ -316,7 +316,7 @@ "muxSett" = "Configuración Mux" "direct" = "Conexión Directa" "directDesc" = "Establece conexiones directas con dominios o rangos de IP de un país específico." -"directSett" = "Opciones de Conexión Directa" + [pages.xray] "title" = "Xray Configuración" diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index 0b4e7854c5..dac201f209 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -316,7 +316,7 @@ "muxSett" = "تنظیمات ماکس" "direct" = "اتصال مستقیم" "directDesc" = "به طور مستقیم با دامنه ها یا محدوده آی‌پی یک کشور خاص ارتباط برقرار می کند" -"directSett" = "گزینه های اتصال مستقیم" + [pages.xray] "title" = "پیکربندی ایکس‌ری" diff --git a/web/translation/translate.id_ID.toml b/web/translation/translate.id_ID.toml index b59c5fc7b3..565b10a767 100644 --- a/web/translation/translate.id_ID.toml +++ b/web/translation/translate.id_ID.toml @@ -316,7 +316,7 @@ "muxSett" = "Pengaturan Mux" "direct" = "Koneksi langsung" "directDesc" = "Secara langsung membuat koneksi dengan domain atau rentang IP negara tertentu." -"directSett" = "Opsi Koneksi Langsung" + [pages.xray] "title" = "Konfigurasi Xray" diff --git a/web/translation/translate.pt_BR.toml b/web/translation/translate.pt_BR.toml index 4da6d8f90d..106bc9b9bd 100644 --- a/web/translation/translate.pt_BR.toml +++ b/web/translation/translate.pt_BR.toml @@ -316,7 +316,7 @@ "muxSett" = "Configurações de Mux" "direct" = "Conexão Direta" "directDesc" = "Estabelece conexões diretamente com domínios ou intervalos de IP de um país específico." -"directSett" = "Opções de Conexão Direta" + [pages.xray] "title" = "Configurações Xray" diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index 59196c0089..7ddc95c87b 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -316,7 +316,7 @@ "muxSett" = "Mux Настройки" "direct" = "Прямая связь" "directDesc" = "Напрямую устанавливает соединения с доменами или диапазонами IP конкретной страны." -"directSett" = "Варианты прямого подключения" + [pages.xray] "title" = "Настройки Xray" diff --git a/web/translation/translate.tr_TR.toml b/web/translation/translate.tr_TR.toml index 1274941f93..f21a292779 100644 --- a/web/translation/translate.tr_TR.toml +++ b/web/translation/translate.tr_TR.toml @@ -316,7 +316,7 @@ "muxSett" = "Mux Ayarları" "direct" = "Doğrudan Bağlantı" "directDesc" = "Belirli bir ülkenin alan adları veya IP aralıkları ile doğrudan bağlantı kurar." -"directSett" = "Doğrudan Bağlantı Seçenekleri" + [pages.xray] "title" = "Xray Yapılandırmaları" diff --git a/web/translation/translate.uk_UA.toml b/web/translation/translate.uk_UA.toml index 221c34d5e4..1ed68eab32 100644 --- a/web/translation/translate.uk_UA.toml +++ b/web/translation/translate.uk_UA.toml @@ -316,7 +316,7 @@ "muxSett" = "Налаштування Mux" "direct" = "Пряме підключення" "directDesc" = "Безпосередньо встановлює з’єднання з доменами або діапазонами IP певної країни." -"directSett" = "Параметри прямого підключення" + [pages.xray] "title" = "Xray конфігурації" diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml index e45c664b77..edcf56bb85 100644 --- a/web/translation/translate.vi_VN.toml +++ b/web/translation/translate.vi_VN.toml @@ -316,7 +316,7 @@ "muxSett" = "Mux Cài đặt" "direct" = "Kết nối trực tiếp" "directDesc" = "Trực tiếp thiết lập kết nối với tên miền hoặc dải IP của một quốc gia cụ thể." -"directSett" = "Tùy chọn kết nối trực tiếp" + [pages.xray] "title" = "Cài đặt Xray" diff --git a/web/translation/translate.zh_CN.toml b/web/translation/translate.zh_CN.toml index 0314b0ab10..65a2a6ea79 100644 --- a/web/translation/translate.zh_CN.toml +++ b/web/translation/translate.zh_CN.toml @@ -316,7 +316,7 @@ "muxSett" = "复用器设置" "direct" = "直接连接" "directDesc" = "直接与特定国家的域或IP范围建立连接" -"directSett" = "直接连接选项" + [pages.xray] "title" = "Xray 配置" From dc29e858c916c17c5a45353befe0d2cb1d22ca19 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Tue, 24 Sep 2024 15:15:19 +0200 Subject: [PATCH 08/34] Xray Core v24.9.19 --- .github/workflows/release.yml | 2 +- DockerInit.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8a6f841cf..d98919a509 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,7 +83,7 @@ jobs: cd x-ui/bin # Download dependencies - Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v24.9.16/" + Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v24.9.19/" if [ "${{ matrix.platform }}" == "amd64" ]; then wget ${Xray_URL}Xray-linux-64.zip unzip Xray-linux-64.zip diff --git a/DockerInit.sh b/DockerInit.sh index ac06cf4d2a..a4dcbe3484 100755 --- a/DockerInit.sh +++ b/DockerInit.sh @@ -27,7 +27,7 @@ case $1 in esac mkdir -p build/bin cd build/bin -wget "https://github.com/XTLS/Xray-core/releases/download/v24.9.16/Xray-linux-${ARCH}.zip" +wget "https://github.com/XTLS/Xray-core/releases/download/v24.9.19/Xray-linux-${ARCH}.zip" unzip "Xray-linux-${ARCH}.zip" rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat mv xray "xray-linux-${FNAME}" From 43713fbdf8f441db09396ca9300c181e23a2715f Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Tue, 24 Sep 2024 15:15:29 +0200 Subject: [PATCH 09/34] v2.4.2 --- README.es_ES.md | 4 ++-- README.md | 4 ++-- README.ru_RU.md | 4 ++-- README.zh_CN.md | 4 ++-- config/version | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.es_ES.md b/README.es_ES.md index 5c0b810931..efbc846da1 100644 --- a/README.es_ES.md +++ b/README.es_ES.md @@ -32,10 +32,10 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install. ## Instalar una Versión Personalizada -Para instalar la versión deseada, agrega la versión al final del comando de instalación. Por ejemplo, ver `v2.4.1`: +Para instalar la versión deseada, agrega la versión al final del comando de instalación. Por ejemplo, ver `v2.4.2`: ``` -bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.1 +bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.2 ``` ## Certificado SSL diff --git a/README.md b/README.md index 0b5a5a9998..a135975642 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,10 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install. ## Install Custom Version -To install your desired version, add the version to the end of the installation command. e.g., ver `v2.4.1`: +To install your desired version, add the version to the end of the installation command. e.g., ver `v2.4.2`: ``` -bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.1 +bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.2 ``` ## SSL Certificate diff --git a/README.ru_RU.md b/README.ru_RU.md index 07e30a5bb8..2192539400 100644 --- a/README.ru_RU.md +++ b/README.ru_RU.md @@ -32,10 +32,10 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install. ## Установка определённой версии -Чтобы установить нужную вам версию, добавьте номер версии в конец команды установки. Например, `v2.4.1`: +Чтобы установить нужную вам версию, добавьте номер версии в конец команды установки. Например, `v2.4.2`: ``` -bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.1 +bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.2 ``` ## SSL Сертификат diff --git a/README.zh_CN.md b/README.zh_CN.md index 0406b1b9c1..f57df5b852 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -32,10 +32,10 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install. ## 安装指定版本 -要安装所需的版本,请将该版本添加到安装命令的末尾。 e.g., ver `v2.4.1`: +要安装所需的版本,请将该版本添加到安装命令的末尾。 e.g., ver `v2.4.2`: ``` -bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.1 +bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v2.4.2 ``` ### SSL证书 diff --git a/config/version b/config/version index 58073ef8d7..acdc3f1b0b 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -2.4.1 \ No newline at end of file +2.4.2 \ No newline at end of file From da7e4d51d6ff62ac71c5c11eb09b9a5f8bad2426 Mon Sep 17 00:00:00 2001 From: Sanaei Date: Tue, 24 Sep 2024 16:50:00 +0200 Subject: [PATCH 10/34] OS Support - Amazon Linux + AlmaLinux 8 --- README.es_ES.md | 2 +- README.md | 2 +- README.ru_RU.md | 2 +- README.zh_CN.md | 2 +- install.sh | 10 +++++----- x-ui.sh | 10 +++++----- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.es_ES.md b/README.es_ES.md index efbc846da1..cc935be35e 100644 --- a/README.es_ES.md +++ b/README.es_ES.md @@ -222,7 +222,7 @@ location /sub { - Arch Linux - Manjaro - Armbian -- AlmaLinux 9+ +- AlmaLinux 8+ - Rockylinux 9+ - OpenSUSE Tubleweed - Amazon Linux 2023 diff --git a/README.md b/README.md index a135975642..02c476a81f 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ location /sub { - Parch Linux - Manjaro - Armbian -- AlmaLinux 9+ +- AlmaLinux 8+ - Rocky Linux 9+ - Oracle Linux 8+ - OpenSUSE Tubleweed diff --git a/README.ru_RU.md b/README.ru_RU.md index 2192539400..65419a3128 100644 --- a/README.ru_RU.md +++ b/README.ru_RU.md @@ -249,7 +249,7 @@ location /sub { - Parch Linux - Manjaro - Armbian -- AlmaLinux 9+ +- AlmaLinux 8+ - Rocky Linux 9+ - Oracle Linux 8+ - OpenSUSE Tubleweed diff --git a/README.zh_CN.md b/README.zh_CN.md index f57df5b852..94b3b597b6 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -245,7 +245,7 @@ location /sub { - Arch Linux - Manjaro - Armbian -- AlmaLinux 9+ +- AlmaLinux 8+ - Rockylinux 9+ - OpenSUSE Tubleweed - Amazon Linux 2023 diff --git a/install.sh b/install.sh index 2fe66b083e..ea60eb54ae 100644 --- a/install.sh +++ b/install.sh @@ -39,7 +39,7 @@ arch() { echo "arch: $(arch)" os_version="" -os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"') +os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"' | tr -d '.') if [[ "${release}" == "arch" ]]; then echo "Your OS is Arch Linux" @@ -56,7 +56,7 @@ elif [[ "${release}" == "centos" ]]; then echo -e "${red} Please use CentOS 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "ubuntu" ]]; then - if [[ ${os_version} -lt 20 ]]; then + if [[ ${os_version} -lt 2004 ]]; then echo -e "${red} Please use Ubuntu 20 or higher version!${plain}\n" && exit 1 fi elif [[ "${release}" == "fedora" ]]; then @@ -72,8 +72,8 @@ elif [[ "${release}" == "debian" ]]; then echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "almalinux" ]]; then - if [[ ${os_version} -lt 9 ]]; then - echo -e "${red} Please use AlmaLinux 9 or higher ${plain}\n" && exit 1 + if [[ ${os_version} -lt 8 ]]; then + echo -e "${red} Please use AlmaLinux 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "rocky" ]]; then if [[ ${os_version} -lt 9 ]]; then @@ -94,7 +94,7 @@ else echo "- Parch Linux" echo "- Manjaro" echo "- Armbian" - echo "- AlmaLinux 9+" + echo "- AlmaLinux 8+" echo "- Rocky Linux 9+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" diff --git a/x-ui.sh b/x-ui.sh index 46449217aa..9067ef4f22 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -36,7 +36,7 @@ fi echo "The OS release is: $release" os_version="" -os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"') +os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"' | tr -d '.') if [[ "${release}" == "arch" ]]; then echo "Your OS is Arch Linux" @@ -53,7 +53,7 @@ elif [[ "${release}" == "centos" ]]; then echo -e "${red} Please use CentOS 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "ubuntu" ]]; then - if [[ ${os_version} -lt 20 ]]; then + if [[ ${os_version} -lt 2004 ]]; then echo -e "${red} Please use Ubuntu 20 or higher version!${plain}\n" && exit 1 fi elif [[ "${release}" == "fedora" ]]; then @@ -69,8 +69,8 @@ elif [[ "${release}" == "debian" ]]; then echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "almalinux" ]]; then - if [[ ${os_version} -lt 9 ]]; then - echo -e "${red} Please use AlmaLinux 9 or higher ${plain}\n" && exit 1 + if [[ ${os_version} -lt 8 ]]; then + echo -e "${red} Please use AlmaLinux 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "rocky" ]]; then if [[ ${os_version} -lt 9 ]]; then @@ -91,7 +91,7 @@ else echo "- Parch Linux" echo "- Manjaro" echo "- Armbian" - echo "- AlmaLinux 9+" + echo "- AlmaLinux 8+" echo "- Rocky Linux 9+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" From 4bea427c796d31f3f208c840de9a97a261ac47ca Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Wed, 25 Sep 2024 10:16:47 +0200 Subject: [PATCH 11/34] minor change --- README.es_ES.md | 4 +++- README.md | 2 +- README.ru_RU.md | 2 +- README.zh_CN.md | 4 +++- install.sh | 6 +++--- web/html/xui/settings.html | 2 +- x-ui.sh | 6 +++--- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.es_ES.md b/README.es_ES.md index cc935be35e..8aaf440098 100644 --- a/README.es_ES.md +++ b/README.es_ES.md @@ -220,10 +220,12 @@ location /sub { - CentOS 8+ - Fedora 36+ - Arch Linux +- Parch Linux - Manjaro - Armbian - AlmaLinux 8+ -- Rockylinux 9+ +- Rocky Linux 8+ +- Oracle Linux 8+ - OpenSUSE Tubleweed - Amazon Linux 2023 diff --git a/README.md b/README.md index 02c476a81f..10cd824f6c 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ location /sub { - Manjaro - Armbian - AlmaLinux 8+ -- Rocky Linux 9+ +- Rocky Linux 8+ - Oracle Linux 8+ - OpenSUSE Tubleweed - Amazon Linux 2023 diff --git a/README.ru_RU.md b/README.ru_RU.md index 65419a3128..1bcc28e25d 100644 --- a/README.ru_RU.md +++ b/README.ru_RU.md @@ -250,7 +250,7 @@ location /sub { - Manjaro - Armbian - AlmaLinux 8+ -- Rocky Linux 9+ +- Rocky Linux 8+ - Oracle Linux 8+ - OpenSUSE Tubleweed - Amazon Linux 2023 diff --git a/README.zh_CN.md b/README.zh_CN.md index 94b3b597b6..60730e7e60 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -243,10 +243,12 @@ location /sub { - CentOS 8+ - Fedora 36+ - Arch Linux +- Parch Linux - Manjaro - Armbian - AlmaLinux 8+ -- Rockylinux 9+ +- Rocky Linux 8+ +- Oracle Linux 8+ - OpenSUSE Tubleweed - Amazon Linux 2023 diff --git a/install.sh b/install.sh index ea60eb54ae..cfebc6b1bb 100644 --- a/install.sh +++ b/install.sh @@ -76,8 +76,8 @@ elif [[ "${release}" == "almalinux" ]]; then echo -e "${red} Please use AlmaLinux 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "rocky" ]]; then - if [[ ${os_version} -lt 9 ]]; then - echo -e "${red} Please use Rocky Linux 9 or higher ${plain}\n" && exit 1 + if [[ ${os_version} -lt 8 ]]; then + echo -e "${red} Please use Rocky Linux 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "oracle" ]]; then if [[ ${os_version} -lt 8 ]]; then @@ -95,7 +95,7 @@ else echo "- Manjaro" echo "- Armbian" echo "- AlmaLinux 8+" - echo "- Rocky Linux 9+" + echo "- Rocky Linux 8+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" echo "- Amazon Linux 2023" diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 7cebfd1eec..f2462518da 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -478,7 +478,7 @@ }, ], geoIPOptions: [ - { label: 'Private IP/Domain', value: 'private' }, + { label: 'Private IP', value: 'private' }, { label: '🇮🇷 Iran', value: 'ir' }, { label: '🇨🇳 China', value: 'cn' }, { label: '🇷🇺 Russia', value: 'ru' }, diff --git a/x-ui.sh b/x-ui.sh index 9067ef4f22..5e54987ec5 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -73,8 +73,8 @@ elif [[ "${release}" == "almalinux" ]]; then echo -e "${red} Please use AlmaLinux 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "rocky" ]]; then - if [[ ${os_version} -lt 9 ]]; then - echo -e "${red} Please use Rocky Linux 9 or higher ${plain}\n" && exit 1 + if [[ ${os_version} -lt 8 ]]; then + echo -e "${red} Please use Rocky Linux 8 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "oracle" ]]; then if [[ ${os_version} -lt 8 ]]; then @@ -92,7 +92,7 @@ else echo "- Manjaro" echo "- Armbian" echo "- AlmaLinux 8+" - echo "- Rocky Linux 9+" + echo "- Rocky Linux 8+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" echo "- Amazon Linux 2023" From 19b95829e015b97602cfc505685548d1001a7719 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Wed, 25 Sep 2024 11:19:41 +0200 Subject: [PATCH 12/34] OS Support - AlmaLinux 8.0 + --- README.es_ES.md | 2 +- README.md | 2 +- README.ru_RU.md | 2 +- README.zh_CN.md | 2 +- install.sh | 6 +++--- x-ui.sh | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.es_ES.md b/README.es_ES.md index 8aaf440098..e03149d0a1 100644 --- a/README.es_ES.md +++ b/README.es_ES.md @@ -223,7 +223,7 @@ location /sub { - Parch Linux - Manjaro - Armbian -- AlmaLinux 8+ +- AlmaLinux 8.0+ - Rocky Linux 8+ - Oracle Linux 8+ - OpenSUSE Tubleweed diff --git a/README.md b/README.md index 10cd824f6c..e6525637cb 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ location /sub { - Parch Linux - Manjaro - Armbian -- AlmaLinux 8+ +- AlmaLinux 8.0+ - Rocky Linux 8+ - Oracle Linux 8+ - OpenSUSE Tubleweed diff --git a/README.ru_RU.md b/README.ru_RU.md index 1bcc28e25d..3c65e65e54 100644 --- a/README.ru_RU.md +++ b/README.ru_RU.md @@ -249,7 +249,7 @@ location /sub { - Parch Linux - Manjaro - Armbian -- AlmaLinux 8+ +- AlmaLinux 8.0+ - Rocky Linux 8+ - Oracle Linux 8+ - OpenSUSE Tubleweed diff --git a/README.zh_CN.md b/README.zh_CN.md index 60730e7e60..9f69a7c439 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -246,7 +246,7 @@ location /sub { - Parch Linux - Manjaro - Armbian -- AlmaLinux 8+ +- AlmaLinux 8.0+ - Rocky Linux 8+ - Oracle Linux 8+ - OpenSUSE Tubleweed diff --git a/install.sh b/install.sh index cfebc6b1bb..a0b937a4b0 100644 --- a/install.sh +++ b/install.sh @@ -72,8 +72,8 @@ elif [[ "${release}" == "debian" ]]; then echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "almalinux" ]]; then - if [[ ${os_version} -lt 8 ]]; then - echo -e "${red} Please use AlmaLinux 8 or higher ${plain}\n" && exit 1 + if [[ ${os_version} -lt 80 ]]; then + echo -e "${red} Please use AlmaLinux 8.0 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "rocky" ]]; then if [[ ${os_version} -lt 8 ]]; then @@ -94,7 +94,7 @@ else echo "- Parch Linux" echo "- Manjaro" echo "- Armbian" - echo "- AlmaLinux 8+" + echo "- AlmaLinux 8.0+" echo "- Rocky Linux 8+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" diff --git a/x-ui.sh b/x-ui.sh index 5e54987ec5..120c83a0bc 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -69,8 +69,8 @@ elif [[ "${release}" == "debian" ]]; then echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "almalinux" ]]; then - if [[ ${os_version} -lt 8 ]]; then - echo -e "${red} Please use AlmaLinux 8 or higher ${plain}\n" && exit 1 + if [[ ${os_version} -lt 80 ]]; then + echo -e "${red} Please use AlmaLinux 8.0 or higher ${plain}\n" && exit 1 fi elif [[ "${release}" == "rocky" ]]; then if [[ ${os_version} -lt 8 ]]; then @@ -91,7 +91,7 @@ else echo "- Parch Linux" echo "- Manjaro" echo "- Armbian" - echo "- AlmaLinux 8+" + echo "- AlmaLinux 8.0+" echo "- Rocky Linux 8+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" From 6cf2b56f9bdb38452a4ecdd1b10ae3cf6ed41bbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:07:10 +0200 Subject: [PATCH 13/34] Bump github.com/valyala/fasthttp from 1.55.0 to 1.56.0 (#2566) Bumps [github.com/valyala/fasthttp](https://github.com/valyala/fasthttp) from 1.55.0 to 1.56.0. - [Release notes](https://github.com/valyala/fasthttp/releases) - [Commits](https://github.com/valyala/fasthttp/compare/v1.55.0...v1.56.0) --- updated-dependencies: - dependency-name: github.com/valyala/fasthttp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 7f5e5357be..749d92570a 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/pelletier/go-toml/v2 v2.2.3 github.com/robfig/cron/v3 v3.0.1 github.com/shirou/gopsutil/v4 v4.24.8 - github.com/valyala/fasthttp v1.55.0 + github.com/valyala/fasthttp v1.56.0 github.com/xtls/xray-core v1.8.24 go.uber.org/atomic v1.11.0 golang.org/x/text v0.18.0 diff --git a/go.sum b/go.sum index b3c26149aa..414b57e6fe 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,6 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/bytedance/sonic v1.12.2 h1:oaMFuRTpMHYLpCntGca65YWt5ny+wAceDERTkT2L9lg= -github.com/bytedance/sonic v1.12.2/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -127,8 +125,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= @@ -200,8 +196,6 @@ github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= @@ -269,8 +263,8 @@ github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.55.0 h1:Zkefzgt6a7+bVKHnu/YaYSOPfNYNisSVBo/unVCf8k8= -github.com/valyala/fasthttp v1.55.0/go.mod h1:NkY9JtkrpPKmgwV3HTaS2HWaJss9RSIsRVfcxxoHiOM= +github.com/valyala/fasthttp v1.56.0 h1:bEZdJev/6LCBlpdORfrLu/WOZXXxvrUQSiyniuaoW8U= +github.com/valyala/fasthttp v1.56.0/go.mod h1:sReBt3XZVnudxuLOx4J/fMrJVorWRiWY2koQKgABiVI= github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ= github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= From 8b6e3491c4ed8e8dca8c068d99c4126b6927cf2e Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Thu, 26 Sep 2024 12:19:18 +0200 Subject: [PATCH 14/34] base install for amzn --- install.sh | 2 +- x-ui.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index a0b937a4b0..3435fc76c0 100644 --- a/install.sh +++ b/install.sh @@ -110,7 +110,7 @@ install_base() { centos | almalinux | rocky | oracle) yum -y update && yum install -y -q wget curl tar tzdata ;; - fedora) + fedora | amzn) dnf -y update && dnf install -y -q wget curl tar tzdata ;; arch | manjaro | parch) diff --git a/x-ui.sh b/x-ui.sh index 120c83a0bc..e4bc622b3b 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -478,7 +478,7 @@ enable_bbr() { centos | almalinux | rocky | oracle) yum -y update && yum -y install ca-certificates ;; - fedora) + fedora | amzn) dnf -y update && dnf -y install ca-certificates ;; arch | manjaro | parch) @@ -818,7 +818,7 @@ ssl_cert_issue() { centos | almalinux | rocky | oracle) yum -y update && yum -y install socat ;; - fedora) + fedora | amzn) dnf -y update && dnf -y install socat ;; arch | manjaro | parch) @@ -1169,7 +1169,7 @@ install_iplimit() { yum update -y && yum install epel-release -y yum -y install fail2ban ;; - fedora) + fedora | amzn) dnf -y update && dnf -y install fail2ban ;; arch | manjaro | parch) @@ -1250,7 +1250,7 @@ remove_iplimit() { yum remove fail2ban -y yum autoremove -y ;; - fedora) + fedora | amzn) dnf remove fail2ban -y dnf autoremove -y ;; From 0b8beafc89c684140fe6be4cd007fbb2a9eb5f3d Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Thu, 26 Sep 2024 13:08:54 +0200 Subject: [PATCH 15/34] DNS - Expect IPs --- web/html/xui/dns_modal.html | 33 ++++-- web/html/xui/xray.html | 161 ++++++++++++++------------- web/translation/translate.en_US.toml | 1 + web/translation/translate.es_ES.toml | 1 + web/translation/translate.fa_IR.toml | 1 + web/translation/translate.id_ID.toml | 1 + web/translation/translate.pt_BR.toml | 1 + web/translation/translate.ru_RU.toml | 1 + web/translation/translate.tr_TR.toml | 1 + web/translation/translate.uk_UA.toml | 1 + web/translation/translate.vi_VN.toml | 1 + web/translation/translate.zh_CN.toml | 1 + 12 files changed, 119 insertions(+), 85 deletions(-) diff --git a/web/html/xui/dns_modal.html b/web/html/xui/dns_modal.html index 1ea93885c2..f61cd8b2ef 100644 --- a/web/html/xui/dns_modal.html +++ b/web/html/xui/dns_modal.html @@ -1,5 +1,7 @@ {{define "dnsModal"}} - + @@ -8,18 +10,29 @@ - + [[ l ]] + + + +