From 12dad74d591d27a49843ec0c7cfa490cd57a2197 Mon Sep 17 00:00:00 2001 From: gitea-action Date: Tue, 17 Sep 2024 23:00:12 +0800 Subject: [PATCH] luci-app-passwall: sync upstream last commit: https://github.com/xiaorouji/openwrt-passwall/commit/2c5b29125b583ba716fde5e56abae30badf44959 --- .../luasrc/passwall/util_sing-box.lua | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index 16122e2f6..abbe6fa03 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -619,22 +619,26 @@ function gen_config_server(node) end if node.protocol == "tuic" then - tls.alpn = (node.tuic_alpn and node.tuic_alpn ~= "") and { - node.tuic_alpn - } or nil - protocol_table = { - users = { - { - name = "user1", - uuid = node.uuid, + if node.uuid then + local users = {} + for i = 1, #node.uuid do + users[i] = { + name = node.uuid[i], + uuid = node.uuid[i], password = node.password } - }, - congestion_control = node.tuic_congestion_control or "cubic", - zero_rtt_handshake = (node.tuic_zero_rtt_handshake == "1") and true or false, - heartbeat = node.tuic_heartbeat .. "s", - tls = tls - } + end + tls.alpn = (node.tuic_alpn and node.tuic_alpn ~= "") and { + node.tuic_alpn + } or nil + protocol_table = { + users = users, + congestion_control = node.tuic_congestion_control or "cubic", + zero_rtt_handshake = (node.tuic_zero_rtt_handshake == "1") and true or false, + heartbeat = node.tuic_heartbeat .. "s", + tls = tls + } + end end if node.protocol == "hysteria2" then