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