update 2026-09-13 02:01:59

This commit is contained in:
action committed 2026-09-13 02:01:59 +08:00
1 parent aff13cf0c6
commit 65075cb38f
1953 files changed
+278 -1523277

No files matched your search

@@ -609,6 +609,9 @@ prepare_clash_runtime_config() {
local client_policy_stats
local client_rules
local enable_fake_ip
local socks5_auth
local socks5_user
local socks5_pass
cache_file="$(get_clash_cache_file "$sid")"
workdir="$(get_clash_workdir "$sid")"
@@ -625,6 +628,16 @@ prepare_clash_runtime_config() {
client_policy_stats=""
client_rules=0
enable_fake_ip="$(uci_get_by_type server_subscribe enable_fake_ip "")"
socks5_auth="$(uci_get_by_type socks5_proxy socks5_auth noauth)"
socks5_user="$(uci_get_by_type socks5_proxy socks5_user "")"
socks5_pass="$(uci_get_by_type socks5_proxy socks5_pass "")"
if [ "$socks5_auth" = "password" ]; then
if [ -z "$socks5_user" ] || [ -z "$socks5_pass" ]; then
echolog "警告:SOCKS5 代理未完整配置用户名或密码,已自动降级为无认证模式 (noauth)。"
socks5_auth="noauth"
fi
fi
[ -s "$cache_file" ] || return 1
@@ -671,6 +684,12 @@ prepare_clash_runtime_config() {
if [ -n "$socks_port" ] && [ "$socks_port" != "0" ]; then
echo "socks-port: $socks_port" >>"$overlay_file"
if [ "$socks5_auth" = "password" ]; then
cat >>"$overlay_file" <<-EOF
authentication:
- "$socks5_user:$socks5_pass"
EOF
fi
fi
merge_stats="$(/usr/bin/lua "$CLASH_YAML_HELPER" merge "$raw_file" "$overlay_file" "$runtime_file" 2>/dev/null)" || return 1
@@ -56,7 +56,7 @@ local function load_yaml(path)
end
local function quote_nameserver_policy_keys(rendered)
rendered = rendered:gsub("[^\n]*", function(line)
rendered = rendered:gsub("[^\n]+", function(line)
local indent = line:match("^(%s*)geosite:geolocation%-!cn:%s*$")
if indent then
return indent .. '"geosite:geolocation-!cn":'