From a6199526da66cc620c8185fe5570ad6ec791aeae Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Fri, 25 Aug 2023 23:56:50 +0200 Subject: [PATCH] v1.5.4 Plus some fixes and decoration --- .github/workflows/release.yml | 2 +- config/version | 2 +- web/assets/js/model/xray.js | 5 +++-- web/html/common/qrcode_modal.html | 7 ++++--- web/html/xui/form/sniffing.html | 2 ++ web/html/xui/form/stream/stream_settings.html | 2 ++ web/html/xui/form/stream/stream_sockopt.html | 2 ++ web/html/xui/form/tls_settings.html | 2 ++ web/html/xui/inbound_info_modal.html | 7 ++++--- web/html/xui/inbound_modal.html | 2 +- 10 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f091de436f..bbf748985e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 'stable' + go-version: '1.20' - name: build linux amd64 version run: | CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o xui-release -v main.go diff --git a/config/version b/config/version index 1d5e9e0bad..63ebd3fe34 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -1.5.3 \ No newline at end of file +1.5.4 \ No newline at end of file diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 0872016516..9aaabcbb71 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -686,6 +686,7 @@ class SockoptStreamSettings extends XrayCommonClass { } static fromJson(json = {}) { + if (Object.keys(json).length === 0) return undefined; return new SockoptStreamSettings( json.acceptProxyProtocol, json.tcpFastOpen, @@ -1458,10 +1459,10 @@ class Inbound extends XrayCommonClass { JSON.parse(this.settings).clients.forEach((client,index) => { if(this.tls && !ObjectUtil.isArrEmpty(this.stream.tls.settings.domains)){ this.stream.tls.settings.domains.forEach((domain) => { - link += this.genLink(domain.domain, remark + '-' + client.email + '-' + domain.remark, index) + '\r\n'; + link += this.genLink(domain.domain, [remark, client.email, domain.remark].filter(x => x.length > 0).join('-'), index) + '\r\n'; }); } else { - link += this.genLink(address, remark + '-' + client.email, index) + '\r\n'; + link += this.genLink(address, [remark, client.email].filter(x => x.length > 0).join('-'), index) + '\r\n'; } }); return link; diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index fbbc2854ed..9094ebf02a 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -35,15 +35,16 @@ this.inbound = dbInbound.toInbound(); settings = JSON.parse(this.inbound.settings); this.client = settings.clients[clientIndex]; - remark = this.dbInbound.remark + ( this.client ? "-" + this.client.email : ''); + remark = [this.dbInbound.remark, ( this.client ? this.client.email : '')].filter(Boolean).join('-'); address = this.dbInbound.address; this.subId = ''; this.qrcodes = []; if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) { this.inbound.stream.tls.settings.domains.forEach((domain) => { + remarkText = [remark, domain.remark].filter(Boolean).join('-'); this.qrcodes.push({ - remark: remark + "-" + domain.remark, - link: this.inbound.genLink(domain.domain, remark + "-" + domain.remark, clientIndex) + remark: remarkText, + link: this.inbound.genLink(domain.domain, remarkText, clientIndex) }); }); } else { diff --git a/web/html/xui/form/sniffing.html b/web/html/xui/form/sniffing.html index 10258af800..fafb2d64f2 100644 --- a/web/html/xui/form/sniffing.html +++ b/web/html/xui/form/sniffing.html @@ -1,5 +1,6 @@ {{define "form/sniffing"}} + sniffing @@ -12,6 +13,7 @@ + [[ value ]] diff --git a/web/html/xui/form/stream/stream_settings.html b/web/html/xui/form/stream/stream_settings.html index a78f283b30..54f609c810 100644 --- a/web/html/xui/form/stream/stream_settings.html +++ b/web/html/xui/form/stream/stream_settings.html @@ -1,6 +1,7 @@ {{define "form/streamSettings"}} + @@ -12,6 +13,7 @@ grpc + diff --git a/web/html/xui/form/stream/stream_sockopt.html b/web/html/xui/form/stream/stream_sockopt.html index d90bf206ec..d40190546b 100644 --- a/web/html/xui/form/stream/stream_sockopt.html +++ b/web/html/xui/form/stream/stream_sockopt.html @@ -1,8 +1,10 @@ {{define "form/streamSockopt"}} + + diff --git a/web/html/xui/form/tls_settings.html b/web/html/xui/form/tls_settings.html index ef682a9fc7..ce217c2585 100644 --- a/web/html/xui/form/tls_settings.html +++ b/web/html/xui/form/tls_settings.html @@ -1,6 +1,7 @@ {{define "form/tlsSettings"}} + @@ -8,6 +9,7 @@ + diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index dbec59c485..df6da71469 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -260,14 +260,15 @@ this.clientSettings = this.settings.clients ? Object.values(this.settings.clients)[index] : null; this.isExpired = this.inbound.isExpiry(index); this.clientStats = this.settings.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : []; - remark = this.dbInbound.remark + ( this.clientSettings ? "-" + this.clientSettings.email : ''); + remark = [this.dbInbound.remark, ( this.clientSettings ? this.clientSettings.email : '')].filter(Boolean).join('-'); address = this.dbInbound.address; this.links = []; if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) { this.inbound.stream.tls.settings.domains.forEach((domain) => { + remarkText = [remark, domain.remark].filter(Boolean).join('-'); this.links.push({ - remark: remark + "-" + domain.remark, - link: this.inbound.genLink(domain.domain, remark + "-" + domain.remark, index) + remark: remarkText, + link: this.inbound.genLink(domain.domain, remarkText, index) }); }); } else { diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html index 55aa9eb3d7..8eb5fe4a7b 100644 --- a/web/html/xui/inbound_modal.html +++ b/web/html/xui/inbound_modal.html @@ -110,7 +110,7 @@ if (this.inModal.inbound.settings.shadowsockses.length ==0){ this.inModal.inbound.settings.shadowsockses = [new Inbound.ShadowsocksSettings.Shadowsocks()]; } - if (["aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "xchacha20-poly1305"].includes(this.inModal.inbound.settings.method)) { + if (!this.inModal.inbound.isSS2022) { this.inModal.inbound.settings.shadowsockses.forEach(client => { client.method = this.inModal.inbound.settings.method; })
Accept Proxy Protocol