From 2e6faf69e62274a35611eb20b0e0a05251c4a8cd Mon Sep 17 00:00:00 2001 From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com> Date: Fri, 20 Jun 2025 19:30:46 +0700 Subject: [PATCH 1/8] fix: generate correct keys for shadowsocks inbounds --- web/assets/js/model/inbound.js | 4 ++-- web/assets/js/util/index.js | 10 ++++++++-- web/html/form/client.html | 2 +- web/html/form/protocol/shadowsocks.html | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index 2a5fb6d6..5228001c 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -2150,7 +2150,7 @@ Inbound.TrojanSettings.Fallback = class extends XrayCommonClass { Inbound.ShadowsocksSettings = class extends Inbound.Settings { constructor(protocol, method = SSMethods.BLAKE3_AES_256_GCM, - password = RandomUtil.randomShadowsocksPassword(), + password = '', network = 'tcp,udp', shadowsockses = [new Inbound.ShadowsocksSettings.Shadowsocks()], ivCheck = false, @@ -2188,7 +2188,7 @@ Inbound.ShadowsocksSettings = class extends Inbound.Settings { Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass { constructor( method = '', - password = RandomUtil.randomShadowsocksPassword(), + password = '', email = RandomUtil.randomLowerAndNum(8), limitIp = 0, totalGB = 0, diff --git a/web/assets/js/util/index.js b/web/assets/js/util/index.js index 0d869af6..c40e02c4 100644 --- a/web/assets/js/util/index.js +++ b/web/assets/js/util/index.js @@ -138,8 +138,14 @@ class RandomUtil { } } - static randomShadowsocksPassword() { - const array = new Uint8Array(32); + static randomShadowsocksPassword(method = SSMethods.BLAKE3_AES_256_GCM) { + let length = 32; + + if ([SSMethods.BLAKE3_AES_128_GCM].includes(method)) { + length = 16; + } + + const array = new Uint8Array(length); window.crypto.getRandomValues(array); diff --git a/web/html/form/client.html b/web/html/form/client.html index c67f1470..846bbd13 100644 --- a/web/html/form/client.html +++ b/web/html/form/client.html @@ -22,7 +22,7 @@ {{ i18n "reset" }} {{ i18n "password" }} - + diff --git a/web/html/form/protocol/shadowsocks.html b/web/html/form/protocol/shadowsocks.html index b9813afb..06e12075 100644 --- a/web/html/form/protocol/shadowsocks.html +++ b/web/html/form/protocol/shadowsocks.html @@ -31,7 +31,7 @@ Password + Password From 5c10035bd964b41ce466ef16ca5ef8bb9a4507f6 Mon Sep 17 00:00:00 2001 From: Vadim Iskuchekov Date: Sat, 21 Jun 2025 09:55:35 +0200 Subject: [PATCH 2/8] feat: add comments under client id (#3131) --- web/html/component/aClientTable.html | 39 ++++++++-- web/html/form/protocol/shadowsocks.html | 7 +- web/html/form/protocol/trojan.html | 7 +- web/html/form/protocol/vless.html | 7 +- web/html/form/protocol/vmess.html | 7 +- web/html/inbounds.html | 99 +++++++++++++++++++++++-- 6 files changed, 146 insertions(+), 20 deletions(-) diff --git a/web/html/component/aClientTable.html b/web/html/component/aClientTable.html index 868112d9..8ab08679 100644 --- a/web/html/component/aClientTable.html +++ b/web/html/component/aClientTable.html @@ -41,14 +41,28 @@