@black-duty/sing-box-schema 1.13.0-rc.4 → 1.13.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -11
- package/dist/index.cjs +233 -224
- package/dist/index.d.cts +21930 -24986
- package/dist/index.d.ts +21930 -24986
- package/dist/index.js +232 -221
- package/package.json +2 -1
- package/schema.json +3103 -2697
- package/schema.zh.json +3106 -2700
package/dist/index.cjs
CHANGED
|
@@ -62,10 +62,11 @@ const CertificateOptions = zod.z.object({
|
|
|
62
62
|
store: zod.z.enum([
|
|
63
63
|
"system",
|
|
64
64
|
"mozilla",
|
|
65
|
+
"chrome",
|
|
65
66
|
"none"
|
|
66
67
|
]).optional().meta({
|
|
67
|
-
description: "The default X509 trusted CA certificate list. Options: `system` (System trusted CA certificates), `mozilla` (Mozilla Included List with China CA certificates removed), `none` (Empty list).",
|
|
68
|
-
description_zh: "默认的 X509 受信任 CA 证书列表。可选项:`system`(系统受信任的 CA 证书)、`mozilla`(移除中国 CA 证书的 Mozilla 包含列表)、`none`(空列表)。"
|
|
68
|
+
description: "The default X509 trusted CA certificate list. Options: `system` (System trusted CA certificates), `mozilla` (Mozilla Included List with China CA certificates removed), `chrome` (Chrome Root Store with China CA certificates removed), `none` (Empty list).",
|
|
69
|
+
description_zh: "默认的 X509 受信任 CA 证书列表。可选项:`system`(系统受信任的 CA 证书)、`mozilla`(移除中国 CA 证书的 Mozilla 包含列表)、`chrome`(移除中国 CA 证书的 Chrome Root Store)、`none`(空列表)。"
|
|
69
70
|
}),
|
|
70
71
|
certificate: listableString.optional().meta({
|
|
71
72
|
description: "The certificate line array to trust, in PEM format.",
|
|
@@ -123,37 +124,6 @@ const HttpHeader = zod.z.record(zod.z.string(), zod.z.string()).meta({
|
|
|
123
124
|
description: "HTTP headers.",
|
|
124
125
|
description_zh: "HTTP 标头。"
|
|
125
126
|
});
|
|
126
|
-
const InboundOptions = zod.z.object({
|
|
127
|
-
sniff: zod.z.boolean().optional().meta({
|
|
128
|
-
description: "Enable sniffing. Deprecated in sing-box 1.11.0 and removed in 1.13.0.",
|
|
129
|
-
description_zh: "启用协议探测。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
130
|
-
deprecated: true
|
|
131
|
-
}),
|
|
132
|
-
sniff_override_destination: zod.z.boolean().optional().meta({
|
|
133
|
-
description: "Override the connection destination address with the sniffed domain. Deprecated in sing-box 1.11.0 and removed in 1.13.0.",
|
|
134
|
-
description_zh: "用探测出的域名覆盖连接目标地址。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
135
|
-
deprecated: true
|
|
136
|
-
}),
|
|
137
|
-
sniff_timeout: zod.z.string().optional().meta({
|
|
138
|
-
description: "Timeout for sniffing (default `300ms`). Deprecated in sing-box 1.11.0 and removed in 1.13.0.",
|
|
139
|
-
description_zh: "探测超时时间(默认 `300ms`)。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
140
|
-
deprecated: true
|
|
141
|
-
}),
|
|
142
|
-
domain_strategy: DomainStrategy.optional().meta({
|
|
143
|
-
description: "If set, the requested domain name will be resolved to IP before routing. Deprecated in sing-box 1.11.0 and removed in 1.13.0.",
|
|
144
|
-
description_zh: "如果设置,请求的域名将在路由之前解析为 IP。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
145
|
-
deprecated: true
|
|
146
|
-
}),
|
|
147
|
-
udp_disable_domain_unmapping: zod.z.boolean().optional().meta({
|
|
148
|
-
description: "If enabled, for UDP proxy requests addressed to a domain, the original packet address will be sent in the response instead of the mapped domain. Deprecated in sing-box 1.11.0 and removed in 1.13.0.",
|
|
149
|
-
description_zh: "如果启用,对于地址为域的 UDP 代理请求,将在响应中发送原始包地址而不是映射的域。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
150
|
-
deprecated: true
|
|
151
|
-
}),
|
|
152
|
-
detour: zod.z.string().optional().meta({
|
|
153
|
-
description: "If set, connections will be forwarded to the specified inbound. Requires target inbound support.",
|
|
154
|
-
description_zh: "如果设置,连接将被转发到指定的入站。需要目标入站支持。"
|
|
155
|
-
})
|
|
156
|
-
});
|
|
157
127
|
const ListenOptions = zod.z.object({
|
|
158
128
|
listen: zod.z.string().optional().meta({
|
|
159
129
|
description: "Listen address.",
|
|
@@ -207,6 +177,10 @@ const ListenOptions = zod.z.object({
|
|
|
207
177
|
description: "UDP NAT expiration time. `5m` will be used by default.",
|
|
208
178
|
description_zh: "UDP NAT 过期时间。默认使用 `5m`。"
|
|
209
179
|
}),
|
|
180
|
+
detour: zod.z.string().optional().meta({
|
|
181
|
+
description: "If set, connections will be forwarded to the specified inbound. Requires target inbound support.",
|
|
182
|
+
description_zh: "如果设置,连接将被转发到指定的入站。需要目标入站支持。"
|
|
183
|
+
}),
|
|
210
184
|
proxy_protocol: zod.z.boolean().optional().meta({
|
|
211
185
|
description: "Accept proxy protocol.",
|
|
212
186
|
description_zh: "接受代理协议。",
|
|
@@ -216,8 +190,7 @@ const ListenOptions = zod.z.object({
|
|
|
216
190
|
description: "Accept connections without proxy protocol header.",
|
|
217
191
|
description_zh: "接受没有代理协议头的连接。",
|
|
218
192
|
deprecated: true
|
|
219
|
-
})
|
|
220
|
-
...InboundOptions.shape
|
|
193
|
+
})
|
|
221
194
|
}).meta({
|
|
222
195
|
id: "ListenOptions",
|
|
223
196
|
title: "Listen Options",
|
|
@@ -1056,11 +1029,11 @@ const DNSRouteAction = zod.z.object({
|
|
|
1056
1029
|
description: "Disable cache and save cache in this query.",
|
|
1057
1030
|
description_zh: "在此查询中禁用缓存。"
|
|
1058
1031
|
}),
|
|
1059
|
-
rewrite_ttl: zod.z.number().int().optional().meta({
|
|
1032
|
+
rewrite_ttl: zod.z.number().int().optional().nullable().meta({
|
|
1060
1033
|
description: "Rewrite TTL in DNS responses.",
|
|
1061
1034
|
description_zh: "重写 DNS 回应中的 TTL。"
|
|
1062
1035
|
}),
|
|
1063
|
-
client_subnet: zod.z.string().optional().meta({
|
|
1036
|
+
client_subnet: zod.z.string().optional().nullable().meta({
|
|
1064
1037
|
description: "Append a `edns0-subnet` OPT extra record with the specified IP prefix to every query by default. If the value is an IP address instead of a prefix, `/32` or `/128` will be appended automatically. Will override `dns.client_subnet`.",
|
|
1065
1038
|
description_zh: "默认情况下,将带有指定 IP 前缀的 `edns0-subnet` OPT 附加记录附加到每个查询。如果值是 IP 地址而不是前缀,则会自动附加 `/32` 或 `/128`。将覆盖 `dns.client_subnet`。"
|
|
1066
1039
|
})
|
|
@@ -1100,11 +1073,11 @@ const DNSRouteOptionsAction = zod.z.object({
|
|
|
1100
1073
|
description: "Disable cache and save cache in this query.",
|
|
1101
1074
|
description_zh: "在此查询中禁用缓存。"
|
|
1102
1075
|
}),
|
|
1103
|
-
rewrite_ttl: zod.z.number().int().optional().meta({
|
|
1076
|
+
rewrite_ttl: zod.z.number().int().optional().nullable().meta({
|
|
1104
1077
|
description: "Rewrite TTL in DNS responses.",
|
|
1105
1078
|
description_zh: "重写 DNS 回应中的 TTL。"
|
|
1106
1079
|
}),
|
|
1107
|
-
client_subnet: zod.z.string().optional().meta({
|
|
1080
|
+
client_subnet: zod.z.string().optional().nullable().meta({
|
|
1108
1081
|
description: "Append a `edns0-subnet` OPT extra record with the specified IP prefix to every query by default. If the value is an IP address instead of a prefix, `/32` or `/128` will be appended automatically. Will override `dns.client_subnet`.",
|
|
1109
1082
|
description_zh: "默认情况下,将带有指定 IP 前缀的 `edns0-subnet` OPT 附加记录附加到每个查询。如果值是 IP 地址而不是前缀,则会自动附加 `/32` 或 `/128`。将覆盖 `dns.client_subnet`。"
|
|
1110
1083
|
})
|
|
@@ -1319,6 +1292,11 @@ const BaseDNSRule = zod.z.object({
|
|
|
1319
1292
|
description: "Make `ip_cidr` rule items in rule-sets match the source IP.",
|
|
1320
1293
|
description_zh: "使规则集中的 `ip_cidr` 规则匹配源 IP。"
|
|
1321
1294
|
}),
|
|
1295
|
+
rule_set_ipcidr_match_source: zod.z.boolean().optional().meta({
|
|
1296
|
+
description: "Deprecated in sing-box 1.10.0. `rule_set_ipcidr_match_source` is renamed to `rule_set_ip_cidr_match_source` and will be remove in sing-box 1.11.0. Make `ip_cidr` rule items in rule-sets match the source IP.",
|
|
1297
|
+
description_zh: "已在 sing-box 1.10.0 废弃。`rule_set_ipcidr_match_source` 已重命名为 `rule_set_ip_cidr_match_source` 且将在 sing-box 1.11.0 中被移除。使规则集中的 `ip_cidr` 规则匹配源 IP。",
|
|
1298
|
+
deprecated: true
|
|
1299
|
+
}),
|
|
1322
1300
|
rule_set_ip_cidr_accept_empty: zod.z.boolean().optional().meta({
|
|
1323
1301
|
description: "Make `ip_cidr` rules in rule-sets accept empty query response. Only takes effect for address requests (A/AAAA/HTTPS).",
|
|
1324
1302
|
description_zh: "使规则集中的 `ip_cidr` 规则接受空查询响应。仅对地址请求(A/AAAA/HTTPS)生效。"
|
|
@@ -1339,7 +1317,7 @@ const DefaultDNSRule = zod.z.union([
|
|
|
1339
1317
|
BaseDNSRule.extend(DNSRejectAction.shape),
|
|
1340
1318
|
BaseDNSRule.extend(DNSRouteActionPredefined.shape)
|
|
1341
1319
|
]);
|
|
1342
|
-
const
|
|
1320
|
+
const BaseLogicalDNSRule = zod.z.object({
|
|
1343
1321
|
type: zod.z.literal("logical").meta({
|
|
1344
1322
|
description: "Rule type.",
|
|
1345
1323
|
description_zh: "规则类型。"
|
|
@@ -1358,7 +1336,13 @@ const LogicalDNSRule = zod.z.object({
|
|
|
1358
1336
|
description: "Invert match result.",
|
|
1359
1337
|
description_zh: "反选匹配结果。"
|
|
1360
1338
|
})
|
|
1361
|
-
})
|
|
1339
|
+
});
|
|
1340
|
+
const LogicalDNSRule = zod.z.union([
|
|
1341
|
+
BaseLogicalDNSRule.extend(DNSRouteAction.shape),
|
|
1342
|
+
BaseLogicalDNSRule.extend(DNSRouteOptionsAction.shape),
|
|
1343
|
+
BaseLogicalDNSRule.extend(DNSRejectAction.shape),
|
|
1344
|
+
BaseLogicalDNSRule.extend(DNSRouteActionPredefined.shape)
|
|
1345
|
+
]).meta({
|
|
1362
1346
|
id: "LogicalDNSRule",
|
|
1363
1347
|
title: "Logical DNS Rule",
|
|
1364
1348
|
title_zh: "逻辑 DNS 规则"
|
|
@@ -1443,6 +1427,10 @@ const LegacyDNSServerAddress = zod.z.union([
|
|
|
1443
1427
|
})
|
|
1444
1428
|
]);
|
|
1445
1429
|
const LegacyDNSServerOptions = zod.z.object({
|
|
1430
|
+
type: zod.z.literal("legacy").optional().meta({
|
|
1431
|
+
description: "DNS server type.",
|
|
1432
|
+
description_zh: "DNS 服务器类型。"
|
|
1433
|
+
}),
|
|
1446
1434
|
tag: zod.z.string().meta({
|
|
1447
1435
|
description: "The tag of the dns server.",
|
|
1448
1436
|
description_zh: "DNS 服务器的标签。"
|
|
@@ -1637,6 +1625,10 @@ const HTTP3DNSServerOptions = zod.z.object({
|
|
|
1637
1625
|
description: "The path of the HTTP3 DNS server. `/dns-query` will be used by default.",
|
|
1638
1626
|
description_zh: "HTTP3 DNS 服务器的路径。默认使用 `/dns-query`。"
|
|
1639
1627
|
}),
|
|
1628
|
+
method: zod.z.string().optional().meta({
|
|
1629
|
+
description: "The HTTP method for DNS-over-HTTP/3 requests.",
|
|
1630
|
+
description_zh: "DNS-over-HTTP/3 请求使用的 HTTP 方法。"
|
|
1631
|
+
}),
|
|
1640
1632
|
headers: HttpHeader.optional().meta({
|
|
1641
1633
|
description: "Additional headers to be sent to the DNS server.",
|
|
1642
1634
|
description_zh: "要发送到 DNS 服务器的额外请求头。"
|
|
@@ -1712,7 +1704,7 @@ const ResolvedDNSServerOptions = zod.z.object({
|
|
|
1712
1704
|
title: "Resolved DNS Server",
|
|
1713
1705
|
title_zh: "Resolved DNS 服务器"
|
|
1714
1706
|
});
|
|
1715
|
-
const DNSServer = zod.z.discriminatedUnion("type", [
|
|
1707
|
+
const DNSServer = zod.z.union([zod.z.lazy(() => LegacyDNSServerOptions), zod.z.lazy(() => zod.z.discriminatedUnion("type", [
|
|
1716
1708
|
LocalDNSServerOptions,
|
|
1717
1709
|
HostsDNSServerOptions,
|
|
1718
1710
|
TCPDNSServerOptions,
|
|
@@ -1724,9 +1716,8 @@ const DNSServer = zod.z.discriminatedUnion("type", [
|
|
|
1724
1716
|
DHCPDNSServerOptions,
|
|
1725
1717
|
FakeIPDNSServerOptions,
|
|
1726
1718
|
TailscaleDNSServerOptions,
|
|
1727
|
-
ResolvedDNSServerOptions
|
|
1728
|
-
|
|
1729
|
-
]).meta({
|
|
1719
|
+
ResolvedDNSServerOptions
|
|
1720
|
+
]))]).meta({
|
|
1730
1721
|
id: "DNSServer",
|
|
1731
1722
|
title: "DNS Server",
|
|
1732
1723
|
title_zh: "DNS 服务器"
|
|
@@ -1851,6 +1842,10 @@ const TailscaleEndpointOptions = zod.z.object({
|
|
|
1851
1842
|
description: "Indicates whether the node should advertise itself as an exit node.",
|
|
1852
1843
|
description_zh: "指示节点是否应将自己通告为出口节点。"
|
|
1853
1844
|
}),
|
|
1845
|
+
advertise_tags: listableString.optional().meta({
|
|
1846
|
+
description: "ACL tags to request when registering the node. Tags must be pre-authorized in the Tailscale ACL policy. Example: `[\"tag:server\", \"tag:prod\"]`.",
|
|
1847
|
+
description_zh: "注册节点时请求的 ACL 标签。标签必须在 Tailscale ACL 策略中预先授权。示例:`[\"tag:server\", \"tag:prod\"]`。"
|
|
1848
|
+
}),
|
|
1854
1849
|
relay_server_port: zod.z.number().int().optional().meta({
|
|
1855
1850
|
description: "The port to listen on for incoming relay connections from other Tailscale nodes.",
|
|
1856
1851
|
description_zh: "监听来自其他 Tailscale 节点的中继连接的端口。"
|
|
@@ -1960,84 +1955,6 @@ const WireGuardEndpointOptions = zod.default.object({
|
|
|
1960
1955
|
title: "WireGuard Endpoint",
|
|
1961
1956
|
title_zh: "WireGuard 端点"
|
|
1962
1957
|
});
|
|
1963
|
-
const LegacyWireGuardPeer = zod.default.object({
|
|
1964
|
-
public_key: zod.default.string().optional().meta({
|
|
1965
|
-
description: "WireGuard peer public key.",
|
|
1966
|
-
description_zh: "WireGuard 对等公钥。"
|
|
1967
|
-
}),
|
|
1968
|
-
pre_shared_key: zod.default.string().optional().meta({
|
|
1969
|
-
description: "WireGuard pre-shared key.",
|
|
1970
|
-
description_zh: "WireGuard 预共享密钥。"
|
|
1971
|
-
}),
|
|
1972
|
-
allowed_ips: zod.default.union([zod.default.string(), zod.default.array(zod.default.string())]).optional().meta({
|
|
1973
|
-
description: "WireGuard allowed IPs.",
|
|
1974
|
-
description_zh: "WireGuard 允许 IP。"
|
|
1975
|
-
}),
|
|
1976
|
-
reserved: Reserved.optional().meta({
|
|
1977
|
-
description: "WireGuard reserved field bytes.",
|
|
1978
|
-
description_zh: "WireGuard 保留字段字节。"
|
|
1979
|
-
}),
|
|
1980
|
-
...ServerOptions.shape
|
|
1981
|
-
});
|
|
1982
|
-
const LegacyWireGuardOutboundOptions = zod.default.object({
|
|
1983
|
-
type: zod.default.literal("wireguard"),
|
|
1984
|
-
tag: zod.default.string().optional(),
|
|
1985
|
-
system_interface: zod.default.boolean().optional().meta({
|
|
1986
|
-
description: "Use system interface. Requires privilege and cannot conflict with existing system interfaces. Forced if gVisor is not included in the build.",
|
|
1987
|
-
description_zh: "使用系统设备。需要特权且不能与已有系统接口冲突。如果未包含 gVisor 构建标签,则强制使用。"
|
|
1988
|
-
}),
|
|
1989
|
-
gso: zod.default.boolean().optional().meta({
|
|
1990
|
-
description: "Try to enable generic segmentation offload. Deprecated in sing-box 1.11.0; GSO will be automatically enabled when available. Only supported on Linux.",
|
|
1991
|
-
description_zh: "尝试启用通用分段卸载。已在 sing-box 1.11.0 废弃;可用时将自动启用 GSO。仅在 Linux 上支持。",
|
|
1992
|
-
deprecated: true
|
|
1993
|
-
}),
|
|
1994
|
-
interface_name: zod.default.string().optional().meta({
|
|
1995
|
-
description: "Custom interface name for system interface.",
|
|
1996
|
-
description_zh: "为系统接口自定义设备名称。"
|
|
1997
|
-
}),
|
|
1998
|
-
local_address: zod.default.union([zod.default.string(), zod.default.array(zod.default.string())]).meta({
|
|
1999
|
-
description: "List of IP (v4 or v6) address prefixes to be assigned to the interface. Required.",
|
|
2000
|
-
description_zh: "接口的 IPv4/IPv6 地址或地址段的列表(必填)。"
|
|
2001
|
-
}),
|
|
2002
|
-
private_key: zod.default.string().meta({
|
|
2003
|
-
description: "WireGuard requires base64-encoded public and private keys. These can be generated using wg(8) or `sing-box generate wg-keypair`. Required.",
|
|
2004
|
-
description_zh: "WireGuard 需要 base64 编码的公钥和私钥。可以使用 wg(8) 或 `sing-box generate wg-keypair` 生成。必填。"
|
|
2005
|
-
}),
|
|
2006
|
-
peers: zod.default.array(LegacyWireGuardPeer).optional().meta({
|
|
2007
|
-
description: "Multi-peer support. If enabled, `server`, `server_port`, `peer_public_key`, and `pre_shared_key` will be ignored.",
|
|
2008
|
-
description_zh: "多对等支持。启用后将忽略 `server`、`server_port`、`peer_public_key` 和 `pre_shared_key`。"
|
|
2009
|
-
}),
|
|
2010
|
-
peer_public_key: zod.default.string().meta({
|
|
2011
|
-
description: "WireGuard peer public key. Required if multi-peer is disabled.",
|
|
2012
|
-
description_zh: "WireGuard 对等公钥(未启用多对等支持时必填)。"
|
|
2013
|
-
}),
|
|
2014
|
-
pre_shared_key: zod.default.string().optional().meta({
|
|
2015
|
-
description: "WireGuard pre-shared key.",
|
|
2016
|
-
description_zh: "WireGuard 预共享密钥。"
|
|
2017
|
-
}),
|
|
2018
|
-
reserved: Reserved.optional().meta({
|
|
2019
|
-
description: "WireGuard reserved field bytes. `$outbound.reserved` will be used if empty.",
|
|
2020
|
-
description_zh: "WireGuard 保留字段字节。置空时将使用 `$outbound.reserved`。"
|
|
2021
|
-
}),
|
|
2022
|
-
workers: zod.default.number().int().optional().meta({
|
|
2023
|
-
description: "WireGuard worker count. CPU count is used by default.",
|
|
2024
|
-
description_zh: "WireGuard worker 数量。默认使用 CPU 数量。"
|
|
2025
|
-
}),
|
|
2026
|
-
mtu: zod.default.number().int().optional().meta({
|
|
2027
|
-
description: "WireGuard MTU. `1408` will be used if empty.",
|
|
2028
|
-
description_zh: "WireGuard MTU。默认使用 1408。"
|
|
2029
|
-
}),
|
|
2030
|
-
network: Network.optional().meta({
|
|
2031
|
-
description: "Enabled network. One of `tcp` `udp`. Both is enabled by default.",
|
|
2032
|
-
description_zh: "启用的网络协议。`tcp` 或 `udp`。默认所有。"
|
|
2033
|
-
}),
|
|
2034
|
-
...ServerOptions.shape,
|
|
2035
|
-
...DialerOptions.shape
|
|
2036
|
-
}).meta({
|
|
2037
|
-
id: "LegacyWireGuardOutboundOptions",
|
|
2038
|
-
title: "Legacy WireGuard Outbound",
|
|
2039
|
-
title_zh: "旧版 WireGuard 出站"
|
|
2040
|
-
});
|
|
2041
1958
|
|
|
2042
1959
|
//#endregion
|
|
2043
1960
|
//#region src/schema/endpoint.ts
|
|
@@ -2084,8 +2001,9 @@ const DebugOptions = zod.z.object({
|
|
|
2084
2001
|
description_zh: "内存限制(字节),如 `128MiB`,参见 https://pkg.go.dev/runtime/debug#SetMemoryLimit。"
|
|
2085
2002
|
}),
|
|
2086
2003
|
oom_killer: zod.z.boolean().optional().meta({
|
|
2087
|
-
|
|
2088
|
-
|
|
2004
|
+
deprecated: true,
|
|
2005
|
+
description: "**Removed in v1.13.0.** This field is no longer supported and will return an error if set. Use the `oom-killer` service instead.",
|
|
2006
|
+
description_zh: "**已在 v1.13.0 中移除。** 此字段不再受支持,设置后将返回错误。请改用 `oom-killer` 服务。"
|
|
2089
2007
|
})
|
|
2090
2008
|
}).meta({
|
|
2091
2009
|
id: "DebugOptions",
|
|
@@ -2170,6 +2088,31 @@ const ClashAPIOptions = zod.z.object({
|
|
|
2170
2088
|
access_control_allow_private_network: zod.z.boolean().optional().meta({
|
|
2171
2089
|
description: "Allow access from private network. To access the Clash API on a private network from a public website, `access_control_allow_private_network` must be enabled.",
|
|
2172
2090
|
description_zh: "允许从私有网络访问。要从公共网站访问私有网络上的 Clash API,必须启用 `access_control_allow_private_network`。"
|
|
2091
|
+
}),
|
|
2092
|
+
store_mode: zod.z.boolean().optional().meta({
|
|
2093
|
+
description: "Store Clash mode in cache file. Deprecated in sing-box 1.8.0 and migrated to the global cache file.",
|
|
2094
|
+
description_zh: "将 Clash 模式存储在缓存文件中。已在 sing-box 1.8.0 弃用并迁移到全局缓存文件。",
|
|
2095
|
+
deprecated: true
|
|
2096
|
+
}),
|
|
2097
|
+
store_selected: zod.z.boolean().optional().meta({
|
|
2098
|
+
description: "Store selected outbound for the Selector outbound in cache file. Deprecated in sing-box 1.8.0 and migrated to the global cache file.",
|
|
2099
|
+
description_zh: "将 Selector 出站中选定的出站存储在缓存文件中。已在 sing-box 1.8.0 弃用并迁移到全局缓存文件。",
|
|
2100
|
+
deprecated: true
|
|
2101
|
+
}),
|
|
2102
|
+
store_fakeip: zod.z.boolean().optional().meta({
|
|
2103
|
+
description: "Store fakeip in cache file. Deprecated in sing-box 1.8.0 and migrated to `cache_file.store_fakeip`.",
|
|
2104
|
+
description_zh: "将 fakeip 存储在缓存文件中。已在 sing-box 1.8.0 弃用并迁移到 `cache_file.store_fakeip`。",
|
|
2105
|
+
deprecated: true
|
|
2106
|
+
}),
|
|
2107
|
+
cache_file: zod.z.string().optional().meta({
|
|
2108
|
+
description: "Cache file path. Deprecated in sing-box 1.8.0 and migrated to `cache_file.enabled` and `cache_file.path`.",
|
|
2109
|
+
description_zh: "缓存文件路径。已在 sing-box 1.8.0 弃用并迁移到 `cache_file.enabled` 和 `cache_file.path`。",
|
|
2110
|
+
deprecated: true
|
|
2111
|
+
}),
|
|
2112
|
+
cache_id: zod.z.string().optional().meta({
|
|
2113
|
+
description: "Identifier in cache file. Deprecated in sing-box 1.8.0 and migrated to `cache_file.cache_id`.",
|
|
2114
|
+
description_zh: "缓存文件中的标识符。已在 sing-box 1.8.0 弃用并迁移到 `cache_file.cache_id`。",
|
|
2115
|
+
deprecated: true
|
|
2173
2116
|
})
|
|
2174
2117
|
}).meta({
|
|
2175
2118
|
id: "ClashAPIOptions",
|
|
@@ -2335,16 +2278,6 @@ const DirectInboundOptions = zod.z.object({
|
|
|
2335
2278
|
const DirectOutboundOptions = zod.z.object({
|
|
2336
2279
|
type: zod.z.literal("direct"),
|
|
2337
2280
|
tag: zod.z.string().optional(),
|
|
2338
|
-
override_address: zod.z.string().optional().meta({
|
|
2339
|
-
description: "Override the connection destination address. Deprecated since sing-box 1.11.0 and will be removed in 1.13.0; see [Migration](/migration/#migrate-destination-override-fields-to-route-options).",
|
|
2340
|
-
description_zh: "覆盖连接目标地址。自 sing-box 1.11.0 起已废弃,并将于 1.13.0 移除;请参阅 [迁移指南](/zh/migration/#migrate-destination-override-fields-to-route-options)。",
|
|
2341
|
-
deprecated: true
|
|
2342
|
-
}),
|
|
2343
|
-
override_port: zod.z.number().int().optional().meta({
|
|
2344
|
-
description: "Override the connection destination port. Deprecated since sing-box 1.11.0 and will be removed in 1.13.0; see [Migration](/migration/#migrate-destination-override-fields-to-route-options).",
|
|
2345
|
-
description_zh: "覆盖连接目标端口。自 sing-box 1.11.0 起已废弃,并将于 1.13.0 移除;请参阅 [迁移指南](/zh/migration/#migrate-destination-override-fields-to-route-options)。",
|
|
2346
|
-
deprecated: true
|
|
2347
|
-
}),
|
|
2348
2281
|
...DialerOptions.shape
|
|
2349
2282
|
}).meta({
|
|
2350
2283
|
id: "DirectOutboundOptions",
|
|
@@ -2744,6 +2677,10 @@ const NaiveInboundOptions = zod.z.object({
|
|
|
2744
2677
|
description: "Naive users. Required.",
|
|
2745
2678
|
description_zh: "Naive 用户。必填。"
|
|
2746
2679
|
}),
|
|
2680
|
+
quic_congestion_control: zod.z.string().optional().meta({
|
|
2681
|
+
description: "QUIC congestion control algorithm.",
|
|
2682
|
+
description_zh: "QUIC 拥塞控制算法。"
|
|
2683
|
+
}),
|
|
2747
2684
|
tls: InboundTLSOptions.optional().meta({
|
|
2748
2685
|
description: "TLS configuration, see [TLS](/configuration/shared/tls/#inbound).",
|
|
2749
2686
|
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#inbound)。"
|
|
@@ -2754,6 +2691,56 @@ const NaiveInboundOptions = zod.z.object({
|
|
|
2754
2691
|
title: "Naive Inbound",
|
|
2755
2692
|
title_zh: "Naive 入站"
|
|
2756
2693
|
});
|
|
2694
|
+
const NaiveOutboundOptions = zod.z.object({
|
|
2695
|
+
type: zod.z.literal("naive"),
|
|
2696
|
+
tag: zod.z.string().optional(),
|
|
2697
|
+
username: zod.z.string().optional().meta({
|
|
2698
|
+
description: "Authentication username.",
|
|
2699
|
+
description_zh: "认证用户名。"
|
|
2700
|
+
}),
|
|
2701
|
+
password: zod.z.string().optional().meta({
|
|
2702
|
+
description: "Authentication password.",
|
|
2703
|
+
description_zh: "认证密码。"
|
|
2704
|
+
}),
|
|
2705
|
+
insecure_concurrency: zod.z.number().int().optional().meta({
|
|
2706
|
+
description: "Number of concurrent tunnel connections. Multiple connections make the tunneling easier to detect through traffic analysis.",
|
|
2707
|
+
description_zh: "并发隧道连接数。多个连接会使隧道更容易通过流量分析被检测到。"
|
|
2708
|
+
}),
|
|
2709
|
+
extra_headers: HttpHeader.optional().meta({
|
|
2710
|
+
description: "Extra headers to send in HTTP requests.",
|
|
2711
|
+
description_zh: "HTTP 请求中发送的额外标头。"
|
|
2712
|
+
}),
|
|
2713
|
+
stream_receive_window: zod.z.string().optional().meta({
|
|
2714
|
+
description: "Stream receive window size.",
|
|
2715
|
+
description_zh: "流接收窗口大小。"
|
|
2716
|
+
}),
|
|
2717
|
+
udp_over_tcp: zod.z.union([zod.z.boolean(), UDPOverTCPOptions]).optional().meta({
|
|
2718
|
+
description: "UDP over TCP protocol settings. See [UDP Over TCP](/configuration/shared/udp-over-tcp/) for details.",
|
|
2719
|
+
description_zh: "UDP over TCP 协议设置。参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp/) 以获取详细信息。"
|
|
2720
|
+
}),
|
|
2721
|
+
quic: zod.z.boolean().optional().meta({
|
|
2722
|
+
description: "Use QUIC instead of HTTP/2.",
|
|
2723
|
+
description_zh: "使用 QUIC 而非 HTTP/2。"
|
|
2724
|
+
}),
|
|
2725
|
+
quic_congestion_control: zod.z.string().optional().meta({
|
|
2726
|
+
description: "QUIC congestion control algorithm.",
|
|
2727
|
+
description_zh: "QUIC 拥塞控制算法。"
|
|
2728
|
+
}),
|
|
2729
|
+
quic_session_receive_window: zod.z.string().optional().meta({
|
|
2730
|
+
description: "QUIC session receive window size.",
|
|
2731
|
+
description_zh: "QUIC 会话接收窗口大小。"
|
|
2732
|
+
}),
|
|
2733
|
+
tls: OutboundTLSOptions.meta({
|
|
2734
|
+
description: "TLS configuration, see [TLS](/configuration/shared/tls/#outbound). Required.",
|
|
2735
|
+
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#outbound)。必填。"
|
|
2736
|
+
}),
|
|
2737
|
+
...ServerOptions.shape,
|
|
2738
|
+
...DialerOptions.shape
|
|
2739
|
+
}).meta({
|
|
2740
|
+
id: "NaiveOutboundOptions",
|
|
2741
|
+
title: "Naive Outbound",
|
|
2742
|
+
title_zh: "Naive 出站"
|
|
2743
|
+
});
|
|
2757
2744
|
|
|
2758
2745
|
//#endregion
|
|
2759
2746
|
//#region src/schema/protocols/redirect.ts
|
|
@@ -3311,6 +3298,10 @@ const TunInboundOptions = zod.z.object({
|
|
|
3311
3298
|
description: "Exclude android packages in route. Android package rules are only supported on Android and require `auto_route`.",
|
|
3312
3299
|
description_zh: "排除路由的 Android 应用包名。Android 应用规则仅在 Android 下被支持,并且需要 `auto_route`。"
|
|
3313
3300
|
}),
|
|
3301
|
+
udp_timeout: zod.z.union([zod.z.string(), zod.z.number()]).optional().meta({
|
|
3302
|
+
description: "UDP NAT expiration time. `5m` will be used by default.",
|
|
3303
|
+
description_zh: "UDP NAT 过期时间。默认使用 `5m`。"
|
|
3304
|
+
}),
|
|
3314
3305
|
stack: zod.z.enum([
|
|
3315
3306
|
"system",
|
|
3316
3307
|
"gvisor",
|
|
@@ -3322,48 +3313,7 @@ const TunInboundOptions = zod.z.object({
|
|
|
3322
3313
|
platform: TunPlatformOptions.optional().meta({
|
|
3323
3314
|
description: "Platform-specific settings, provided by client applications.",
|
|
3324
3315
|
description_zh: "平台特定的设置,由客户端应用提供。"
|
|
3325
|
-
})
|
|
3326
|
-
gso: zod.z.boolean().optional().meta({
|
|
3327
|
-
description: "Enable generic segmentation offload.",
|
|
3328
|
-
description_zh: "启用通用分段卸载。",
|
|
3329
|
-
deprecated: true
|
|
3330
|
-
}),
|
|
3331
|
-
inet4_address: listableString.optional().meta({
|
|
3332
|
-
description: "IPv4 prefix for the tun interface.",
|
|
3333
|
-
description_zh: "tun 接口的 IPv4 前缀。",
|
|
3334
|
-
deprecated: true
|
|
3335
|
-
}),
|
|
3336
|
-
inet6_address: listableString.optional().meta({
|
|
3337
|
-
description: "IPv6 prefix for the tun interface.",
|
|
3338
|
-
description_zh: "tun 接口的 IPv6 前缀。",
|
|
3339
|
-
deprecated: true
|
|
3340
|
-
}),
|
|
3341
|
-
inet4_route_address: listableString.optional().meta({
|
|
3342
|
-
description: "Use custom routes instead of default when `auto_route` is enabled.",
|
|
3343
|
-
description_zh: "启用 `auto_route` 时使用自定义路由而不是默认路由。",
|
|
3344
|
-
deprecated: true
|
|
3345
|
-
}),
|
|
3346
|
-
inet6_route_address: listableString.optional().meta({
|
|
3347
|
-
description: "Use custom routes instead of default when `auto_route` is enabled.",
|
|
3348
|
-
description_zh: "启用 `auto_route` 时使用自定义路由而不是默认路由。",
|
|
3349
|
-
deprecated: true
|
|
3350
|
-
}),
|
|
3351
|
-
inet4_route_exclude_address: listableString.optional().meta({
|
|
3352
|
-
description: "Exclude custom routes when `auto_route` is enabled.",
|
|
3353
|
-
description_zh: "启用 `auto_route` 时排除自定义路由。",
|
|
3354
|
-
deprecated: true
|
|
3355
|
-
}),
|
|
3356
|
-
inet6_route_exclude_address: listableString.optional().meta({
|
|
3357
|
-
description: "Exclude custom routes when `auto_route` is enabled.",
|
|
3358
|
-
description_zh: "启用 `auto_route` 时排除自定义路由。",
|
|
3359
|
-
deprecated: true
|
|
3360
|
-
}),
|
|
3361
|
-
endpoint_independent_nat: zod.z.boolean().optional().meta({
|
|
3362
|
-
description: "Enable endpoint-independent NAT. This item is only available on the gvisor stack; other stacks are endpoint-independent NAT by default. Performance may degrade slightly, so it is not recommended to enable when it is not needed.",
|
|
3363
|
-
description_zh: "启用独立于端点的 NAT。此项仅在 gvisor 栈上可用,其他栈默认启用独立于端点的 NAT。性能可能略有下降,因此不建议在不需要时启用。",
|
|
3364
|
-
deprecated: true
|
|
3365
|
-
}),
|
|
3366
|
-
...ListenOptions.shape
|
|
3316
|
+
})
|
|
3367
3317
|
}).meta({
|
|
3368
3318
|
id: "TunInboundOptions",
|
|
3369
3319
|
title: "Tun Inbound",
|
|
@@ -3680,24 +3630,16 @@ const URLTestOutbound = zod.z.object({
|
|
|
3680
3630
|
});
|
|
3681
3631
|
|
|
3682
3632
|
//#endregion
|
|
3683
|
-
//#region src/schema/protocols/
|
|
3684
|
-
const
|
|
3685
|
-
type: zod.z.literal("
|
|
3686
|
-
tag: zod.z.string().optional()
|
|
3687
|
-
method: zod.z.string(),
|
|
3688
|
-
password: zod.z.string(),
|
|
3689
|
-
obfs: zod.z.string().optional(),
|
|
3690
|
-
obfs_param: zod.z.string().optional(),
|
|
3691
|
-
protocol: zod.z.string().optional(),
|
|
3692
|
-
protocol_param: zod.z.string().optional(),
|
|
3693
|
-
network: Network.optional(),
|
|
3694
|
-
...ServerOptions.shape,
|
|
3695
|
-
...DialerOptions.shape
|
|
3633
|
+
//#region src/schema/protocols/block.ts
|
|
3634
|
+
const BlockOutboundOptions = zod.z.object({
|
|
3635
|
+
type: zod.z.literal("block"),
|
|
3636
|
+
tag: zod.z.string().optional()
|
|
3696
3637
|
}).meta({
|
|
3697
|
-
id: "
|
|
3698
|
-
title: "
|
|
3699
|
-
title_zh: "
|
|
3700
|
-
|
|
3638
|
+
id: "BlockOutboundOptions",
|
|
3639
|
+
title: "Block Outbound",
|
|
3640
|
+
title_zh: "Block 出站",
|
|
3641
|
+
description: "Block outbound closes all incoming requests.",
|
|
3642
|
+
description_zh: "Block 出站关闭所有传入请求。"
|
|
3701
3643
|
});
|
|
3702
3644
|
|
|
3703
3645
|
//#endregion
|
|
@@ -3782,14 +3724,14 @@ const Outbound = zod.z.discriminatedUnion("type", [
|
|
|
3782
3724
|
ShadowsocksOutboundOptions,
|
|
3783
3725
|
VMessOutboundOptions,
|
|
3784
3726
|
TrojanOutboundOptions,
|
|
3785
|
-
|
|
3727
|
+
BlockOutboundOptions,
|
|
3786
3728
|
HysteriaOutboundOptions,
|
|
3787
3729
|
ShadowTLSOutboundOptions,
|
|
3788
3730
|
AnyTLSOutboundOptions,
|
|
3789
3731
|
Hysteria2OutboundOptions,
|
|
3790
3732
|
TUICOutboundOptions,
|
|
3791
3733
|
VLESSOutboundOptions,
|
|
3792
|
-
|
|
3734
|
+
NaiveOutboundOptions,
|
|
3793
3735
|
SSHOutboundOptions,
|
|
3794
3736
|
TorOutboundOptions,
|
|
3795
3737
|
SelectorOutbound,
|
|
@@ -3822,14 +3764,6 @@ const RuleActionRouteOptions = zod.z.object({
|
|
|
3822
3764
|
description: "See Dial Fields (/configuration/shared/dial/#network_strategy) for details. Only take effect if outbound is direct without `outbound.bind_interface`, `outbound.inet4_bind_address` and `outbound.inet6_bind_address` set.",
|
|
3823
3765
|
description_zh: "详情参阅 [拨号字段](/configuration/shared/dial/#network_strategy)。仅当出站为 direct 且 `outbound.bind_interface`、`outbound.inet4_bind_address` 与 `outbound.inet6_bind_address` 均未设置时生效。"
|
|
3824
3766
|
}),
|
|
3825
|
-
network_type: listable(NetworkType).optional().meta({
|
|
3826
|
-
description: "See Dial Fields (/configuration/shared/dial/#network_type) for details.",
|
|
3827
|
-
description_zh: "详情参阅 [拨号字段](/configuration/shared/dial/#network_type)。"
|
|
3828
|
-
}),
|
|
3829
|
-
fallback_network_type: listable(NetworkType).optional().meta({
|
|
3830
|
-
description: "See Dial Fields (/configuration/shared/dial/#fallback_network_type) for details.",
|
|
3831
|
-
description_zh: "详情参阅 [拨号字段](/configuration/shared/dial/#fallback_network_type)。"
|
|
3832
|
-
}),
|
|
3833
3767
|
fallback_delay: zod.z.string().optional().meta({
|
|
3834
3768
|
description: "See Dial Fields (/configuration/shared/dial/#fallback_delay) for details.",
|
|
3835
3769
|
description_zh: "详情参阅 [拨号字段](/configuration/shared/dial/#fallback_delay)。"
|
|
@@ -3934,14 +3868,33 @@ const RuleActionRoute = zod.z.object({
|
|
|
3934
3868
|
title: "Rule Action Route",
|
|
3935
3869
|
title_zh: "规则动作路由"
|
|
3936
3870
|
});
|
|
3871
|
+
const RuleActionBypass = zod.z.object({
|
|
3872
|
+
action: zod.z.literal("bypass").meta({
|
|
3873
|
+
description: "Action type.",
|
|
3874
|
+
description_zh: "动作类型。"
|
|
3875
|
+
}),
|
|
3876
|
+
outbound: zod.z.string().optional().meta({
|
|
3877
|
+
description: "Tag of target outbound.",
|
|
3878
|
+
description_zh: "目标出站的标签。"
|
|
3879
|
+
}),
|
|
3880
|
+
...RuleActionRouteOptions.shape
|
|
3881
|
+
}).meta({
|
|
3882
|
+
id: "RuleActionBypass",
|
|
3883
|
+
title: "Rule Action Bypass",
|
|
3884
|
+
title_zh: "规则动作绕过"
|
|
3885
|
+
});
|
|
3937
3886
|
const RuleActionReject = zod.z.object({
|
|
3938
3887
|
action: zod.z.literal("reject").meta({
|
|
3939
3888
|
description: "Action type.",
|
|
3940
3889
|
description_zh: "动作类型。"
|
|
3941
3890
|
}),
|
|
3942
|
-
method: zod.z.enum([
|
|
3943
|
-
|
|
3944
|
-
|
|
3891
|
+
method: zod.z.enum([
|
|
3892
|
+
"default",
|
|
3893
|
+
"drop",
|
|
3894
|
+
"reply"
|
|
3895
|
+
]).optional().meta({
|
|
3896
|
+
description: "`default`: Reply with TCP RST for TCP connections, ICMP port unreachable for UDP packets, and ICMP host unreachable for ICMP echo requests. `drop`: Drop packets. `reply`: Reply with ICMP echo reply for ICMP echo requests.",
|
|
3897
|
+
description_zh: "`default`: 对 TCP 连接回复 RST,对 UDP 包回复 ICMP 端口不可达,并对 ICMP 回显请求回复 ICMP 主机不可达。`drop`: 丢弃数据包。`reply`: 对 ICMP 回显请求回复 ICMP 回显响应。"
|
|
3945
3898
|
}),
|
|
3946
3899
|
no_drop: zod.z.boolean().optional().meta({
|
|
3947
3900
|
description: "If not enabled, `method` will be temporarily overwritten to `drop` after 50 triggers in 30s.",
|
|
@@ -3952,12 +3905,13 @@ const RuleActionReject = zod.z.object({
|
|
|
3952
3905
|
title: "Rule Action Reject",
|
|
3953
3906
|
title_zh: "规则动作拒绝"
|
|
3954
3907
|
});
|
|
3908
|
+
const DirectActionDialerOptions = DialerOptions.omit({ detour: true });
|
|
3955
3909
|
const RuleActionDirect = zod.z.object({
|
|
3956
3910
|
action: zod.z.literal("direct").meta({
|
|
3957
3911
|
description: "Action type.",
|
|
3958
3912
|
description_zh: "动作类型。"
|
|
3959
3913
|
}),
|
|
3960
|
-
...
|
|
3914
|
+
...DirectActionDialerOptions.shape
|
|
3961
3915
|
}).meta({
|
|
3962
3916
|
id: "RuleActionDirect",
|
|
3963
3917
|
title: "Rule Action Direct",
|
|
@@ -4181,6 +4135,7 @@ const BaseRouteRule = zod.z.object({
|
|
|
4181
4135
|
const DefaultRouteRule = zod.z.union([
|
|
4182
4136
|
BaseRouteRule.extend(RuleActionRouteByDefault.shape),
|
|
4183
4137
|
BaseRouteRule.extend(RuleActionRoute.shape),
|
|
4138
|
+
BaseRouteRule.extend(RuleActionBypass.shape),
|
|
4184
4139
|
BaseRouteRule.extend(RuleActionReject.shape),
|
|
4185
4140
|
BaseRouteRule.extend(RuleActionHijackDNS.shape),
|
|
4186
4141
|
BaseRouteRule.extend(RuleActionRouteOptionsWithAction.shape),
|
|
@@ -4188,7 +4143,7 @@ const DefaultRouteRule = zod.z.union([
|
|
|
4188
4143
|
BaseRouteRule.extend(RuleActionResolve.shape),
|
|
4189
4144
|
BaseRouteRule.extend(RuleActionDirect.shape)
|
|
4190
4145
|
]);
|
|
4191
|
-
const
|
|
4146
|
+
const BaseLogicalRouteRule = zod.z.object({
|
|
4192
4147
|
type: zod.z.literal("logical").meta({
|
|
4193
4148
|
description: "Rule type.",
|
|
4194
4149
|
description_zh: "规则类型。"
|
|
@@ -4207,7 +4162,18 @@ const LogicalRouteRule = zod.z.object({
|
|
|
4207
4162
|
description: "Invert match result.",
|
|
4208
4163
|
description_zh: "反选匹配结果。"
|
|
4209
4164
|
})
|
|
4210
|
-
})
|
|
4165
|
+
});
|
|
4166
|
+
const LogicalRouteRule = zod.z.union([
|
|
4167
|
+
BaseLogicalRouteRule.extend(RuleActionRouteByDefault.shape),
|
|
4168
|
+
BaseLogicalRouteRule.extend(RuleActionRoute.shape),
|
|
4169
|
+
BaseLogicalRouteRule.extend(RuleActionBypass.shape),
|
|
4170
|
+
BaseLogicalRouteRule.extend(RuleActionReject.shape),
|
|
4171
|
+
BaseLogicalRouteRule.extend(RuleActionHijackDNS.shape),
|
|
4172
|
+
BaseLogicalRouteRule.extend(RuleActionRouteOptionsWithAction.shape),
|
|
4173
|
+
BaseLogicalRouteRule.extend(RuleActionSniff.shape),
|
|
4174
|
+
BaseLogicalRouteRule.extend(RuleActionResolve.shape),
|
|
4175
|
+
BaseLogicalRouteRule.extend(RuleActionDirect.shape)
|
|
4176
|
+
]).meta({
|
|
4211
4177
|
id: "LogicalRouteRule",
|
|
4212
4178
|
title: "Logical Route Rule",
|
|
4213
4179
|
title_zh: "逻辑路由规则"
|
|
@@ -4357,7 +4323,7 @@ const HeadlessRule = zod.z.union([DefaultHeadlessRule, LogicalHeadlessRule]).met
|
|
|
4357
4323
|
title_zh: "无头规则"
|
|
4358
4324
|
});
|
|
4359
4325
|
const InlineRuleSetOptions = zod.z.object({
|
|
4360
|
-
type: zod.z.literal("inline").meta({
|
|
4326
|
+
type: zod.z.literal("inline").optional().meta({
|
|
4361
4327
|
description: "Rule set type.",
|
|
4362
4328
|
description_zh: "规则集类型。"
|
|
4363
4329
|
}),
|
|
@@ -4426,7 +4392,7 @@ const RemoteRuleSetOptions = zod.z.object({
|
|
|
4426
4392
|
title: "Remote Rule Set Options",
|
|
4427
4393
|
title_zh: "远程规则集选项"
|
|
4428
4394
|
});
|
|
4429
|
-
const RuleSet = zod.z.
|
|
4395
|
+
const RuleSet = zod.z.union([
|
|
4430
4396
|
InlineRuleSetOptions,
|
|
4431
4397
|
LocalRuleSetOptions,
|
|
4432
4398
|
RemoteRuleSetOptions
|
|
@@ -4579,7 +4545,11 @@ const CCMServiceOptions = zod.z.object({
|
|
|
4579
4545
|
description: "TLS configuration, see [TLS](/configuration/shared/tls/#inbound).",
|
|
4580
4546
|
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#inbound)。"
|
|
4581
4547
|
}),
|
|
4582
|
-
...ListenOptions.shape
|
|
4548
|
+
...ListenOptions.shape,
|
|
4549
|
+
detour: zod.z.string().optional().meta({
|
|
4550
|
+
description: "Outbound tag for connecting to the Claude API.",
|
|
4551
|
+
description_zh: "用于连接到 Claude API 的出站标签。"
|
|
4552
|
+
})
|
|
4583
4553
|
}).meta({
|
|
4584
4554
|
id: "CCMServiceOptions",
|
|
4585
4555
|
title: "CCM",
|
|
@@ -4638,7 +4608,7 @@ const DERPServiceOptions = zod.z.object({
|
|
|
4638
4608
|
description: "TLS configuration, see [TLS](/configuration/shared/tls/#inbound).",
|
|
4639
4609
|
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#inbound)。"
|
|
4640
4610
|
}),
|
|
4641
|
-
config_path: zod.z.string().meta({
|
|
4611
|
+
config_path: zod.z.string().optional().meta({
|
|
4642
4612
|
description: "Derper configuration file path. Example: `derper.key`.",
|
|
4643
4613
|
description_zh: "Derper 配置文件路径。示例:`derper.key`。"
|
|
4644
4614
|
}),
|
|
@@ -4717,7 +4687,11 @@ const OCMServiceOptions = zod.z.object({
|
|
|
4717
4687
|
description: "TLS configuration, see [TLS](/configuration/shared/tls/#inbound).",
|
|
4718
4688
|
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#inbound)。"
|
|
4719
4689
|
}),
|
|
4720
|
-
...ListenOptions.shape
|
|
4690
|
+
...ListenOptions.shape,
|
|
4691
|
+
detour: zod.z.string().optional().meta({
|
|
4692
|
+
description: "Outbound tag for connecting to the OpenAI API.",
|
|
4693
|
+
description_zh: "用于连接到 OpenAI API 的出站标签。"
|
|
4694
|
+
})
|
|
4721
4695
|
}).meta({
|
|
4722
4696
|
id: "OCMServiceOptions",
|
|
4723
4697
|
title: "OCM",
|
|
@@ -4726,6 +4700,42 @@ const OCMServiceOptions = zod.z.object({
|
|
|
4726
4700
|
description_zh: "OCM(OpenAI Codex 多路复用器)服务是一个多路复用服务,允许您通过自定义令牌远程访问本地的 OpenAI Codex 订阅。"
|
|
4727
4701
|
});
|
|
4728
4702
|
|
|
4703
|
+
//#endregion
|
|
4704
|
+
//#region src/schema/services/oom-killer.ts
|
|
4705
|
+
/**
|
|
4706
|
+
* OOM Killer service options for sing-box.
|
|
4707
|
+
*/
|
|
4708
|
+
const OOMKillerServiceOptions = zod.z.object({
|
|
4709
|
+
type: zod.z.literal("oom-killer"),
|
|
4710
|
+
tag: zod.z.string().optional(),
|
|
4711
|
+
memory_limit: zod.z.string().optional().meta({
|
|
4712
|
+
description: "The memory limit that triggers OOM killing. Accepts human-readable byte sizes such as `128MiB` or `1GiB`. When memory usage exceeds this threshold, the OOM killer becomes active.",
|
|
4713
|
+
description_zh: "触发 OOM 强杀的内存限制,支持可读的字节大小格式,如 `128MiB`、`1GiB`。当内存使用量超过该阈值时,OOM killer 将被激活。"
|
|
4714
|
+
}),
|
|
4715
|
+
safety_margin: zod.z.string().optional().meta({
|
|
4716
|
+
description: "An additional memory buffer subtracted from the limit before enforcement. Accepts human-readable byte sizes such as `32MiB`. Provides headroom to avoid aggressive killing.",
|
|
4717
|
+
description_zh: "在执行限制前额外减去的内存缓冲量,支持可读的字节大小格式,如 `32MiB`。提供一定余量以避免过于激进的强杀行为。"
|
|
4718
|
+
}),
|
|
4719
|
+
min_interval: zod.z.union([zod.z.string(), zod.z.number()]).optional().meta({
|
|
4720
|
+
description: "The minimum interval between consecutive OOM kill checks. Accepts a duration string such as `1s`. Prevents excessive kill frequency.",
|
|
4721
|
+
description_zh: "两次 OOM 检测之间的最小间隔,支持时间字符串格式如 `1s`。防止过于频繁的强杀操作。"
|
|
4722
|
+
}),
|
|
4723
|
+
max_interval: zod.z.union([zod.z.string(), zod.z.number()]).optional().meta({
|
|
4724
|
+
description: "The maximum interval between consecutive OOM kill checks. Accepts a duration string such as `30s`. The interval is dynamically adjusted between `min_interval` and `max_interval`.",
|
|
4725
|
+
description_zh: "两次 OOM 检测之间的最大间隔,支持时间字符串格式如 `30s`。检测间隔会在 `min_interval` 与 `max_interval` 之间动态调整。"
|
|
4726
|
+
}),
|
|
4727
|
+
checks_before_limit: zod.z.number().int().optional().meta({
|
|
4728
|
+
description: "The number of consecutive checks that must exceed the memory limit before the OOM killer takes action. Reduces false positives from transient memory spikes.",
|
|
4729
|
+
description_zh: "在 OOM killer 采取行动之前,内存需要连续超过限制的检测次数。用于减少因瞬时内存峰值引发的误杀。"
|
|
4730
|
+
})
|
|
4731
|
+
}).meta({
|
|
4732
|
+
id: "OOMKillerServiceOptions",
|
|
4733
|
+
title: "OOM Killer Service",
|
|
4734
|
+
title_zh: "OOM Killer 服务",
|
|
4735
|
+
description: "The OOM Killer service monitors memory usage and terminates the process when it exceeds the configured limit, preventing system-level out-of-memory conditions.",
|
|
4736
|
+
description_zh: "OOM Killer 服务监控内存使用情况,并在超过配置限制时终止进程,从而防止系统级内存耗尽情况的发生。"
|
|
4737
|
+
});
|
|
4738
|
+
|
|
4729
4739
|
//#endregion
|
|
4730
4740
|
//#region src/schema/services/resolved.ts
|
|
4731
4741
|
/**
|
|
@@ -4781,6 +4791,7 @@ const Service = zod.z.discriminatedUnion("type", [
|
|
|
4781
4791
|
CCMServiceOptions,
|
|
4782
4792
|
DERPServiceOptions,
|
|
4783
4793
|
OCMServiceOptions,
|
|
4794
|
+
OOMKillerServiceOptions,
|
|
4784
4795
|
ResolvedServiceOptions,
|
|
4785
4796
|
SSMAPIServiceOptions
|
|
4786
4797
|
]).meta({
|
|
@@ -4807,17 +4818,18 @@ const Configuration = zod.z.object({
|
|
|
4807
4818
|
experimental: ExperimentalOptions.optional()
|
|
4808
4819
|
}).meta({
|
|
4809
4820
|
id: "Configuration",
|
|
4810
|
-
title: "Sing-box v1.13.
|
|
4811
|
-
title_zh: "Sing-box v1.13.
|
|
4812
|
-
description: "Sing-box v1.13.
|
|
4813
|
-
description_zh: "Sing-box v1.13.
|
|
4814
|
-
version: "1.13.
|
|
4821
|
+
title: "Sing-box v1.13.13 Configuration",
|
|
4822
|
+
title_zh: "Sing-box v1.13.13 配置文件",
|
|
4823
|
+
description: "Sing-box v1.13.13 configuration file schema. Sing-box uses JSON for configuration files with log, dns, ntp, certificate, endpoints, inbounds, outbounds, route, services, and experimental sections.",
|
|
4824
|
+
description_zh: "Sing-box v1.13.13 配置文件定义。sing-box 使用 JSON 作为配置文件格式,包含 log、dns、ntp、certificate、endpoints、inbounds、outbounds、route、services 与 experimental 字段。",
|
|
4825
|
+
version: "1.13.13"
|
|
4815
4826
|
});
|
|
4816
4827
|
|
|
4817
4828
|
//#endregion
|
|
4818
4829
|
exports.AnyTLSInboundOptions = AnyTLSInboundOptions;
|
|
4819
4830
|
exports.AnyTLSOutboundOptions = AnyTLSOutboundOptions;
|
|
4820
4831
|
exports.AnyTLSUser = AnyTLSUser;
|
|
4832
|
+
exports.BlockOutboundOptions = BlockOutboundOptions;
|
|
4821
4833
|
exports.CertificateOptions = CertificateOptions;
|
|
4822
4834
|
exports.Configuration = Configuration;
|
|
4823
4835
|
exports.DHCPDNSServerOptions = DHCPDNSServerOptions;
|
|
@@ -4855,19 +4867,17 @@ exports.HysteriaOutboundOptions = HysteriaOutboundOptions;
|
|
|
4855
4867
|
exports.HysteriaUser = HysteriaUser;
|
|
4856
4868
|
exports.Inbound = Inbound;
|
|
4857
4869
|
exports.InboundMultiplexOptions = InboundMultiplexOptions;
|
|
4858
|
-
exports.InboundOptions = InboundOptions;
|
|
4859
4870
|
exports.InboundTLSOptions = InboundTLSOptions;
|
|
4860
4871
|
exports.IpVersion = IpVersion;
|
|
4861
4872
|
exports.LegacyDNSFakeIPOptions = LegacyDNSFakeIPOptions;
|
|
4862
4873
|
exports.LegacyDNSServerOptions = LegacyDNSServerOptions;
|
|
4863
|
-
exports.LegacyWireGuardOutboundOptions = LegacyWireGuardOutboundOptions;
|
|
4864
|
-
exports.LegacyWireGuardPeer = LegacyWireGuardPeer;
|
|
4865
4874
|
exports.ListenOptions = ListenOptions;
|
|
4866
4875
|
exports.LocalDNSServerOptions = LocalDNSServerOptions;
|
|
4867
4876
|
exports.LogOptions = LogOptions;
|
|
4868
4877
|
exports.MixedInboundOptions = MixedInboundOptions;
|
|
4869
4878
|
exports.NTPOptions = NTPOptions;
|
|
4870
4879
|
exports.NaiveInboundOptions = NaiveInboundOptions;
|
|
4880
|
+
exports.NaiveOutboundOptions = NaiveOutboundOptions;
|
|
4871
4881
|
exports.Network = Network;
|
|
4872
4882
|
exports.NetworkStrategy = NetworkStrategy;
|
|
4873
4883
|
exports.NetworkType = NetworkType;
|
|
@@ -4889,7 +4899,6 @@ exports.ShadowTLSOutboundOptions = ShadowTLSOutboundOptions;
|
|
|
4889
4899
|
exports.ShadowsocksDestination = ShadowsocksDestination;
|
|
4890
4900
|
exports.ShadowsocksInboundOptions = ShadowsocksInboundOptions;
|
|
4891
4901
|
exports.ShadowsocksOutboundOptions = ShadowsocksOutboundOptions;
|
|
4892
|
-
exports.ShadowsocksROutboundOptions = ShadowsocksROutboundOptions;
|
|
4893
4902
|
exports.ShadowsocksUser = ShadowsocksUser;
|
|
4894
4903
|
exports.SocksInboundOptions = SocksInboundOptions;
|
|
4895
4904
|
exports.SocksOutboundOptions = SocksOutboundOptions;
|