@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.js
CHANGED
|
@@ -39,10 +39,11 @@ const CertificateOptions = z.object({
|
|
|
39
39
|
store: z.enum([
|
|
40
40
|
"system",
|
|
41
41
|
"mozilla",
|
|
42
|
+
"chrome",
|
|
42
43
|
"none"
|
|
43
44
|
]).optional().meta({
|
|
44
|
-
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).",
|
|
45
|
-
description_zh: "默认的 X509 受信任 CA 证书列表。可选项:`system`(系统受信任的 CA 证书)、`mozilla`(移除中国 CA 证书的 Mozilla 包含列表)、`none`(空列表)。"
|
|
45
|
+
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).",
|
|
46
|
+
description_zh: "默认的 X509 受信任 CA 证书列表。可选项:`system`(系统受信任的 CA 证书)、`mozilla`(移除中国 CA 证书的 Mozilla 包含列表)、`chrome`(移除中国 CA 证书的 Chrome Root Store)、`none`(空列表)。"
|
|
46
47
|
}),
|
|
47
48
|
certificate: listableString.optional().meta({
|
|
48
49
|
description: "The certificate line array to trust, in PEM format.",
|
|
@@ -100,37 +101,6 @@ const HttpHeader = z.record(z.string(), z.string()).meta({
|
|
|
100
101
|
description: "HTTP headers.",
|
|
101
102
|
description_zh: "HTTP 标头。"
|
|
102
103
|
});
|
|
103
|
-
const InboundOptions = z.object({
|
|
104
|
-
sniff: z.boolean().optional().meta({
|
|
105
|
-
description: "Enable sniffing. Deprecated in sing-box 1.11.0 and removed in 1.13.0.",
|
|
106
|
-
description_zh: "启用协议探测。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
107
|
-
deprecated: true
|
|
108
|
-
}),
|
|
109
|
-
sniff_override_destination: z.boolean().optional().meta({
|
|
110
|
-
description: "Override the connection destination address with the sniffed domain. Deprecated in sing-box 1.11.0 and removed in 1.13.0.",
|
|
111
|
-
description_zh: "用探测出的域名覆盖连接目标地址。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
112
|
-
deprecated: true
|
|
113
|
-
}),
|
|
114
|
-
sniff_timeout: z.string().optional().meta({
|
|
115
|
-
description: "Timeout for sniffing (default `300ms`). Deprecated in sing-box 1.11.0 and removed in 1.13.0.",
|
|
116
|
-
description_zh: "探测超时时间(默认 `300ms`)。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
117
|
-
deprecated: true
|
|
118
|
-
}),
|
|
119
|
-
domain_strategy: DomainStrategy.optional().meta({
|
|
120
|
-
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.",
|
|
121
|
-
description_zh: "如果设置,请求的域名将在路由之前解析为 IP。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
122
|
-
deprecated: true
|
|
123
|
-
}),
|
|
124
|
-
udp_disable_domain_unmapping: z.boolean().optional().meta({
|
|
125
|
-
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.",
|
|
126
|
-
description_zh: "如果启用,对于地址为域的 UDP 代理请求,将在响应中发送原始包地址而不是映射的域。已在 sing-box 1.11.0 弃用,并将在 1.13.0 移除。",
|
|
127
|
-
deprecated: true
|
|
128
|
-
}),
|
|
129
|
-
detour: z.string().optional().meta({
|
|
130
|
-
description: "If set, connections will be forwarded to the specified inbound. Requires target inbound support.",
|
|
131
|
-
description_zh: "如果设置,连接将被转发到指定的入站。需要目标入站支持。"
|
|
132
|
-
})
|
|
133
|
-
});
|
|
134
104
|
const ListenOptions = z.object({
|
|
135
105
|
listen: z.string().optional().meta({
|
|
136
106
|
description: "Listen address.",
|
|
@@ -184,6 +154,10 @@ const ListenOptions = z.object({
|
|
|
184
154
|
description: "UDP NAT expiration time. `5m` will be used by default.",
|
|
185
155
|
description_zh: "UDP NAT 过期时间。默认使用 `5m`。"
|
|
186
156
|
}),
|
|
157
|
+
detour: z.string().optional().meta({
|
|
158
|
+
description: "If set, connections will be forwarded to the specified inbound. Requires target inbound support.",
|
|
159
|
+
description_zh: "如果设置,连接将被转发到指定的入站。需要目标入站支持。"
|
|
160
|
+
}),
|
|
187
161
|
proxy_protocol: z.boolean().optional().meta({
|
|
188
162
|
description: "Accept proxy protocol.",
|
|
189
163
|
description_zh: "接受代理协议。",
|
|
@@ -193,8 +167,7 @@ const ListenOptions = z.object({
|
|
|
193
167
|
description: "Accept connections without proxy protocol header.",
|
|
194
168
|
description_zh: "接受没有代理协议头的连接。",
|
|
195
169
|
deprecated: true
|
|
196
|
-
})
|
|
197
|
-
...InboundOptions.shape
|
|
170
|
+
})
|
|
198
171
|
}).meta({
|
|
199
172
|
id: "ListenOptions",
|
|
200
173
|
title: "Listen Options",
|
|
@@ -1033,11 +1006,11 @@ const DNSRouteAction = z.object({
|
|
|
1033
1006
|
description: "Disable cache and save cache in this query.",
|
|
1034
1007
|
description_zh: "在此查询中禁用缓存。"
|
|
1035
1008
|
}),
|
|
1036
|
-
rewrite_ttl: z.number().int().optional().meta({
|
|
1009
|
+
rewrite_ttl: z.number().int().optional().nullable().meta({
|
|
1037
1010
|
description: "Rewrite TTL in DNS responses.",
|
|
1038
1011
|
description_zh: "重写 DNS 回应中的 TTL。"
|
|
1039
1012
|
}),
|
|
1040
|
-
client_subnet: z.string().optional().meta({
|
|
1013
|
+
client_subnet: z.string().optional().nullable().meta({
|
|
1041
1014
|
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`.",
|
|
1042
1015
|
description_zh: "默认情况下,将带有指定 IP 前缀的 `edns0-subnet` OPT 附加记录附加到每个查询。如果值是 IP 地址而不是前缀,则会自动附加 `/32` 或 `/128`。将覆盖 `dns.client_subnet`。"
|
|
1043
1016
|
})
|
|
@@ -1077,11 +1050,11 @@ const DNSRouteOptionsAction = z.object({
|
|
|
1077
1050
|
description: "Disable cache and save cache in this query.",
|
|
1078
1051
|
description_zh: "在此查询中禁用缓存。"
|
|
1079
1052
|
}),
|
|
1080
|
-
rewrite_ttl: z.number().int().optional().meta({
|
|
1053
|
+
rewrite_ttl: z.number().int().optional().nullable().meta({
|
|
1081
1054
|
description: "Rewrite TTL in DNS responses.",
|
|
1082
1055
|
description_zh: "重写 DNS 回应中的 TTL。"
|
|
1083
1056
|
}),
|
|
1084
|
-
client_subnet: z.string().optional().meta({
|
|
1057
|
+
client_subnet: z.string().optional().nullable().meta({
|
|
1085
1058
|
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`.",
|
|
1086
1059
|
description_zh: "默认情况下,将带有指定 IP 前缀的 `edns0-subnet` OPT 附加记录附加到每个查询。如果值是 IP 地址而不是前缀,则会自动附加 `/32` 或 `/128`。将覆盖 `dns.client_subnet`。"
|
|
1087
1060
|
})
|
|
@@ -1296,6 +1269,11 @@ const BaseDNSRule = z.object({
|
|
|
1296
1269
|
description: "Make `ip_cidr` rule items in rule-sets match the source IP.",
|
|
1297
1270
|
description_zh: "使规则集中的 `ip_cidr` 规则匹配源 IP。"
|
|
1298
1271
|
}),
|
|
1272
|
+
rule_set_ipcidr_match_source: z.boolean().optional().meta({
|
|
1273
|
+
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.",
|
|
1274
|
+
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。",
|
|
1275
|
+
deprecated: true
|
|
1276
|
+
}),
|
|
1299
1277
|
rule_set_ip_cidr_accept_empty: z.boolean().optional().meta({
|
|
1300
1278
|
description: "Make `ip_cidr` rules in rule-sets accept empty query response. Only takes effect for address requests (A/AAAA/HTTPS).",
|
|
1301
1279
|
description_zh: "使规则集中的 `ip_cidr` 规则接受空查询响应。仅对地址请求(A/AAAA/HTTPS)生效。"
|
|
@@ -1316,7 +1294,7 @@ const DefaultDNSRule = z.union([
|
|
|
1316
1294
|
BaseDNSRule.extend(DNSRejectAction.shape),
|
|
1317
1295
|
BaseDNSRule.extend(DNSRouteActionPredefined.shape)
|
|
1318
1296
|
]);
|
|
1319
|
-
const
|
|
1297
|
+
const BaseLogicalDNSRule = z.object({
|
|
1320
1298
|
type: z.literal("logical").meta({
|
|
1321
1299
|
description: "Rule type.",
|
|
1322
1300
|
description_zh: "规则类型。"
|
|
@@ -1335,7 +1313,13 @@ const LogicalDNSRule = z.object({
|
|
|
1335
1313
|
description: "Invert match result.",
|
|
1336
1314
|
description_zh: "反选匹配结果。"
|
|
1337
1315
|
})
|
|
1338
|
-
})
|
|
1316
|
+
});
|
|
1317
|
+
const LogicalDNSRule = z.union([
|
|
1318
|
+
BaseLogicalDNSRule.extend(DNSRouteAction.shape),
|
|
1319
|
+
BaseLogicalDNSRule.extend(DNSRouteOptionsAction.shape),
|
|
1320
|
+
BaseLogicalDNSRule.extend(DNSRejectAction.shape),
|
|
1321
|
+
BaseLogicalDNSRule.extend(DNSRouteActionPredefined.shape)
|
|
1322
|
+
]).meta({
|
|
1339
1323
|
id: "LogicalDNSRule",
|
|
1340
1324
|
title: "Logical DNS Rule",
|
|
1341
1325
|
title_zh: "逻辑 DNS 规则"
|
|
@@ -1420,6 +1404,10 @@ const LegacyDNSServerAddress = z.union([
|
|
|
1420
1404
|
})
|
|
1421
1405
|
]);
|
|
1422
1406
|
const LegacyDNSServerOptions = z.object({
|
|
1407
|
+
type: z.literal("legacy").optional().meta({
|
|
1408
|
+
description: "DNS server type.",
|
|
1409
|
+
description_zh: "DNS 服务器类型。"
|
|
1410
|
+
}),
|
|
1423
1411
|
tag: z.string().meta({
|
|
1424
1412
|
description: "The tag of the dns server.",
|
|
1425
1413
|
description_zh: "DNS 服务器的标签。"
|
|
@@ -1614,6 +1602,10 @@ const HTTP3DNSServerOptions = z.object({
|
|
|
1614
1602
|
description: "The path of the HTTP3 DNS server. `/dns-query` will be used by default.",
|
|
1615
1603
|
description_zh: "HTTP3 DNS 服务器的路径。默认使用 `/dns-query`。"
|
|
1616
1604
|
}),
|
|
1605
|
+
method: z.string().optional().meta({
|
|
1606
|
+
description: "The HTTP method for DNS-over-HTTP/3 requests.",
|
|
1607
|
+
description_zh: "DNS-over-HTTP/3 请求使用的 HTTP 方法。"
|
|
1608
|
+
}),
|
|
1617
1609
|
headers: HttpHeader.optional().meta({
|
|
1618
1610
|
description: "Additional headers to be sent to the DNS server.",
|
|
1619
1611
|
description_zh: "要发送到 DNS 服务器的额外请求头。"
|
|
@@ -1689,7 +1681,7 @@ const ResolvedDNSServerOptions = z.object({
|
|
|
1689
1681
|
title: "Resolved DNS Server",
|
|
1690
1682
|
title_zh: "Resolved DNS 服务器"
|
|
1691
1683
|
});
|
|
1692
|
-
const DNSServer = z.discriminatedUnion("type", [
|
|
1684
|
+
const DNSServer = z.union([z.lazy(() => LegacyDNSServerOptions), z.lazy(() => z.discriminatedUnion("type", [
|
|
1693
1685
|
LocalDNSServerOptions,
|
|
1694
1686
|
HostsDNSServerOptions,
|
|
1695
1687
|
TCPDNSServerOptions,
|
|
@@ -1701,9 +1693,8 @@ const DNSServer = z.discriminatedUnion("type", [
|
|
|
1701
1693
|
DHCPDNSServerOptions,
|
|
1702
1694
|
FakeIPDNSServerOptions,
|
|
1703
1695
|
TailscaleDNSServerOptions,
|
|
1704
|
-
ResolvedDNSServerOptions
|
|
1705
|
-
|
|
1706
|
-
]).meta({
|
|
1696
|
+
ResolvedDNSServerOptions
|
|
1697
|
+
]))]).meta({
|
|
1707
1698
|
id: "DNSServer",
|
|
1708
1699
|
title: "DNS Server",
|
|
1709
1700
|
title_zh: "DNS 服务器"
|
|
@@ -1828,6 +1819,10 @@ const TailscaleEndpointOptions = z.object({
|
|
|
1828
1819
|
description: "Indicates whether the node should advertise itself as an exit node.",
|
|
1829
1820
|
description_zh: "指示节点是否应将自己通告为出口节点。"
|
|
1830
1821
|
}),
|
|
1822
|
+
advertise_tags: listableString.optional().meta({
|
|
1823
|
+
description: "ACL tags to request when registering the node. Tags must be pre-authorized in the Tailscale ACL policy. Example: `[\"tag:server\", \"tag:prod\"]`.",
|
|
1824
|
+
description_zh: "注册节点时请求的 ACL 标签。标签必须在 Tailscale ACL 策略中预先授权。示例:`[\"tag:server\", \"tag:prod\"]`。"
|
|
1825
|
+
}),
|
|
1831
1826
|
relay_server_port: z.number().int().optional().meta({
|
|
1832
1827
|
description: "The port to listen on for incoming relay connections from other Tailscale nodes.",
|
|
1833
1828
|
description_zh: "监听来自其他 Tailscale 节点的中继连接的端口。"
|
|
@@ -1937,84 +1932,6 @@ const WireGuardEndpointOptions = z$1.object({
|
|
|
1937
1932
|
title: "WireGuard Endpoint",
|
|
1938
1933
|
title_zh: "WireGuard 端点"
|
|
1939
1934
|
});
|
|
1940
|
-
const LegacyWireGuardPeer = z$1.object({
|
|
1941
|
-
public_key: z$1.string().optional().meta({
|
|
1942
|
-
description: "WireGuard peer public key.",
|
|
1943
|
-
description_zh: "WireGuard 对等公钥。"
|
|
1944
|
-
}),
|
|
1945
|
-
pre_shared_key: z$1.string().optional().meta({
|
|
1946
|
-
description: "WireGuard pre-shared key.",
|
|
1947
|
-
description_zh: "WireGuard 预共享密钥。"
|
|
1948
|
-
}),
|
|
1949
|
-
allowed_ips: z$1.union([z$1.string(), z$1.array(z$1.string())]).optional().meta({
|
|
1950
|
-
description: "WireGuard allowed IPs.",
|
|
1951
|
-
description_zh: "WireGuard 允许 IP。"
|
|
1952
|
-
}),
|
|
1953
|
-
reserved: Reserved.optional().meta({
|
|
1954
|
-
description: "WireGuard reserved field bytes.",
|
|
1955
|
-
description_zh: "WireGuard 保留字段字节。"
|
|
1956
|
-
}),
|
|
1957
|
-
...ServerOptions.shape
|
|
1958
|
-
});
|
|
1959
|
-
const LegacyWireGuardOutboundOptions = z$1.object({
|
|
1960
|
-
type: z$1.literal("wireguard"),
|
|
1961
|
-
tag: z$1.string().optional(),
|
|
1962
|
-
system_interface: z$1.boolean().optional().meta({
|
|
1963
|
-
description: "Use system interface. Requires privilege and cannot conflict with existing system interfaces. Forced if gVisor is not included in the build.",
|
|
1964
|
-
description_zh: "使用系统设备。需要特权且不能与已有系统接口冲突。如果未包含 gVisor 构建标签,则强制使用。"
|
|
1965
|
-
}),
|
|
1966
|
-
gso: z$1.boolean().optional().meta({
|
|
1967
|
-
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.",
|
|
1968
|
-
description_zh: "尝试启用通用分段卸载。已在 sing-box 1.11.0 废弃;可用时将自动启用 GSO。仅在 Linux 上支持。",
|
|
1969
|
-
deprecated: true
|
|
1970
|
-
}),
|
|
1971
|
-
interface_name: z$1.string().optional().meta({
|
|
1972
|
-
description: "Custom interface name for system interface.",
|
|
1973
|
-
description_zh: "为系统接口自定义设备名称。"
|
|
1974
|
-
}),
|
|
1975
|
-
local_address: z$1.union([z$1.string(), z$1.array(z$1.string())]).meta({
|
|
1976
|
-
description: "List of IP (v4 or v6) address prefixes to be assigned to the interface. Required.",
|
|
1977
|
-
description_zh: "接口的 IPv4/IPv6 地址或地址段的列表(必填)。"
|
|
1978
|
-
}),
|
|
1979
|
-
private_key: z$1.string().meta({
|
|
1980
|
-
description: "WireGuard requires base64-encoded public and private keys. These can be generated using wg(8) or `sing-box generate wg-keypair`. Required.",
|
|
1981
|
-
description_zh: "WireGuard 需要 base64 编码的公钥和私钥。可以使用 wg(8) 或 `sing-box generate wg-keypair` 生成。必填。"
|
|
1982
|
-
}),
|
|
1983
|
-
peers: z$1.array(LegacyWireGuardPeer).optional().meta({
|
|
1984
|
-
description: "Multi-peer support. If enabled, `server`, `server_port`, `peer_public_key`, and `pre_shared_key` will be ignored.",
|
|
1985
|
-
description_zh: "多对等支持。启用后将忽略 `server`、`server_port`、`peer_public_key` 和 `pre_shared_key`。"
|
|
1986
|
-
}),
|
|
1987
|
-
peer_public_key: z$1.string().meta({
|
|
1988
|
-
description: "WireGuard peer public key. Required if multi-peer is disabled.",
|
|
1989
|
-
description_zh: "WireGuard 对等公钥(未启用多对等支持时必填)。"
|
|
1990
|
-
}),
|
|
1991
|
-
pre_shared_key: z$1.string().optional().meta({
|
|
1992
|
-
description: "WireGuard pre-shared key.",
|
|
1993
|
-
description_zh: "WireGuard 预共享密钥。"
|
|
1994
|
-
}),
|
|
1995
|
-
reserved: Reserved.optional().meta({
|
|
1996
|
-
description: "WireGuard reserved field bytes. `$outbound.reserved` will be used if empty.",
|
|
1997
|
-
description_zh: "WireGuard 保留字段字节。置空时将使用 `$outbound.reserved`。"
|
|
1998
|
-
}),
|
|
1999
|
-
workers: z$1.number().int().optional().meta({
|
|
2000
|
-
description: "WireGuard worker count. CPU count is used by default.",
|
|
2001
|
-
description_zh: "WireGuard worker 数量。默认使用 CPU 数量。"
|
|
2002
|
-
}),
|
|
2003
|
-
mtu: z$1.number().int().optional().meta({
|
|
2004
|
-
description: "WireGuard MTU. `1408` will be used if empty.",
|
|
2005
|
-
description_zh: "WireGuard MTU。默认使用 1408。"
|
|
2006
|
-
}),
|
|
2007
|
-
network: Network.optional().meta({
|
|
2008
|
-
description: "Enabled network. One of `tcp` `udp`. Both is enabled by default.",
|
|
2009
|
-
description_zh: "启用的网络协议。`tcp` 或 `udp`。默认所有。"
|
|
2010
|
-
}),
|
|
2011
|
-
...ServerOptions.shape,
|
|
2012
|
-
...DialerOptions.shape
|
|
2013
|
-
}).meta({
|
|
2014
|
-
id: "LegacyWireGuardOutboundOptions",
|
|
2015
|
-
title: "Legacy WireGuard Outbound",
|
|
2016
|
-
title_zh: "旧版 WireGuard 出站"
|
|
2017
|
-
});
|
|
2018
1935
|
|
|
2019
1936
|
//#endregion
|
|
2020
1937
|
//#region src/schema/endpoint.ts
|
|
@@ -2061,8 +1978,9 @@ const DebugOptions = z.object({
|
|
|
2061
1978
|
description_zh: "内存限制(字节),如 `128MiB`,参见 https://pkg.go.dev/runtime/debug#SetMemoryLimit。"
|
|
2062
1979
|
}),
|
|
2063
1980
|
oom_killer: z.boolean().optional().meta({
|
|
2064
|
-
|
|
2065
|
-
|
|
1981
|
+
deprecated: true,
|
|
1982
|
+
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.",
|
|
1983
|
+
description_zh: "**已在 v1.13.0 中移除。** 此字段不再受支持,设置后将返回错误。请改用 `oom-killer` 服务。"
|
|
2066
1984
|
})
|
|
2067
1985
|
}).meta({
|
|
2068
1986
|
id: "DebugOptions",
|
|
@@ -2147,6 +2065,31 @@ const ClashAPIOptions = z.object({
|
|
|
2147
2065
|
access_control_allow_private_network: z.boolean().optional().meta({
|
|
2148
2066
|
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.",
|
|
2149
2067
|
description_zh: "允许从私有网络访问。要从公共网站访问私有网络上的 Clash API,必须启用 `access_control_allow_private_network`。"
|
|
2068
|
+
}),
|
|
2069
|
+
store_mode: z.boolean().optional().meta({
|
|
2070
|
+
description: "Store Clash mode in cache file. Deprecated in sing-box 1.8.0 and migrated to the global cache file.",
|
|
2071
|
+
description_zh: "将 Clash 模式存储在缓存文件中。已在 sing-box 1.8.0 弃用并迁移到全局缓存文件。",
|
|
2072
|
+
deprecated: true
|
|
2073
|
+
}),
|
|
2074
|
+
store_selected: z.boolean().optional().meta({
|
|
2075
|
+
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.",
|
|
2076
|
+
description_zh: "将 Selector 出站中选定的出站存储在缓存文件中。已在 sing-box 1.8.0 弃用并迁移到全局缓存文件。",
|
|
2077
|
+
deprecated: true
|
|
2078
|
+
}),
|
|
2079
|
+
store_fakeip: z.boolean().optional().meta({
|
|
2080
|
+
description: "Store fakeip in cache file. Deprecated in sing-box 1.8.0 and migrated to `cache_file.store_fakeip`.",
|
|
2081
|
+
description_zh: "将 fakeip 存储在缓存文件中。已在 sing-box 1.8.0 弃用并迁移到 `cache_file.store_fakeip`。",
|
|
2082
|
+
deprecated: true
|
|
2083
|
+
}),
|
|
2084
|
+
cache_file: z.string().optional().meta({
|
|
2085
|
+
description: "Cache file path. Deprecated in sing-box 1.8.0 and migrated to `cache_file.enabled` and `cache_file.path`.",
|
|
2086
|
+
description_zh: "缓存文件路径。已在 sing-box 1.8.0 弃用并迁移到 `cache_file.enabled` 和 `cache_file.path`。",
|
|
2087
|
+
deprecated: true
|
|
2088
|
+
}),
|
|
2089
|
+
cache_id: z.string().optional().meta({
|
|
2090
|
+
description: "Identifier in cache file. Deprecated in sing-box 1.8.0 and migrated to `cache_file.cache_id`.",
|
|
2091
|
+
description_zh: "缓存文件中的标识符。已在 sing-box 1.8.0 弃用并迁移到 `cache_file.cache_id`。",
|
|
2092
|
+
deprecated: true
|
|
2150
2093
|
})
|
|
2151
2094
|
}).meta({
|
|
2152
2095
|
id: "ClashAPIOptions",
|
|
@@ -2312,16 +2255,6 @@ const DirectInboundOptions = z.object({
|
|
|
2312
2255
|
const DirectOutboundOptions = z.object({
|
|
2313
2256
|
type: z.literal("direct"),
|
|
2314
2257
|
tag: z.string().optional(),
|
|
2315
|
-
override_address: z.string().optional().meta({
|
|
2316
|
-
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).",
|
|
2317
|
-
description_zh: "覆盖连接目标地址。自 sing-box 1.11.0 起已废弃,并将于 1.13.0 移除;请参阅 [迁移指南](/zh/migration/#migrate-destination-override-fields-to-route-options)。",
|
|
2318
|
-
deprecated: true
|
|
2319
|
-
}),
|
|
2320
|
-
override_port: z.number().int().optional().meta({
|
|
2321
|
-
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).",
|
|
2322
|
-
description_zh: "覆盖连接目标端口。自 sing-box 1.11.0 起已废弃,并将于 1.13.0 移除;请参阅 [迁移指南](/zh/migration/#migrate-destination-override-fields-to-route-options)。",
|
|
2323
|
-
deprecated: true
|
|
2324
|
-
}),
|
|
2325
2258
|
...DialerOptions.shape
|
|
2326
2259
|
}).meta({
|
|
2327
2260
|
id: "DirectOutboundOptions",
|
|
@@ -2721,6 +2654,10 @@ const NaiveInboundOptions = z.object({
|
|
|
2721
2654
|
description: "Naive users. Required.",
|
|
2722
2655
|
description_zh: "Naive 用户。必填。"
|
|
2723
2656
|
}),
|
|
2657
|
+
quic_congestion_control: z.string().optional().meta({
|
|
2658
|
+
description: "QUIC congestion control algorithm.",
|
|
2659
|
+
description_zh: "QUIC 拥塞控制算法。"
|
|
2660
|
+
}),
|
|
2724
2661
|
tls: InboundTLSOptions.optional().meta({
|
|
2725
2662
|
description: "TLS configuration, see [TLS](/configuration/shared/tls/#inbound).",
|
|
2726
2663
|
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#inbound)。"
|
|
@@ -2731,6 +2668,56 @@ const NaiveInboundOptions = z.object({
|
|
|
2731
2668
|
title: "Naive Inbound",
|
|
2732
2669
|
title_zh: "Naive 入站"
|
|
2733
2670
|
});
|
|
2671
|
+
const NaiveOutboundOptions = z.object({
|
|
2672
|
+
type: z.literal("naive"),
|
|
2673
|
+
tag: z.string().optional(),
|
|
2674
|
+
username: z.string().optional().meta({
|
|
2675
|
+
description: "Authentication username.",
|
|
2676
|
+
description_zh: "认证用户名。"
|
|
2677
|
+
}),
|
|
2678
|
+
password: z.string().optional().meta({
|
|
2679
|
+
description: "Authentication password.",
|
|
2680
|
+
description_zh: "认证密码。"
|
|
2681
|
+
}),
|
|
2682
|
+
insecure_concurrency: z.number().int().optional().meta({
|
|
2683
|
+
description: "Number of concurrent tunnel connections. Multiple connections make the tunneling easier to detect through traffic analysis.",
|
|
2684
|
+
description_zh: "并发隧道连接数。多个连接会使隧道更容易通过流量分析被检测到。"
|
|
2685
|
+
}),
|
|
2686
|
+
extra_headers: HttpHeader.optional().meta({
|
|
2687
|
+
description: "Extra headers to send in HTTP requests.",
|
|
2688
|
+
description_zh: "HTTP 请求中发送的额外标头。"
|
|
2689
|
+
}),
|
|
2690
|
+
stream_receive_window: z.string().optional().meta({
|
|
2691
|
+
description: "Stream receive window size.",
|
|
2692
|
+
description_zh: "流接收窗口大小。"
|
|
2693
|
+
}),
|
|
2694
|
+
udp_over_tcp: z.union([z.boolean(), UDPOverTCPOptions]).optional().meta({
|
|
2695
|
+
description: "UDP over TCP protocol settings. See [UDP Over TCP](/configuration/shared/udp-over-tcp/) for details.",
|
|
2696
|
+
description_zh: "UDP over TCP 协议设置。参阅 [UDP Over TCP](/zh/configuration/shared/udp-over-tcp/) 以获取详细信息。"
|
|
2697
|
+
}),
|
|
2698
|
+
quic: z.boolean().optional().meta({
|
|
2699
|
+
description: "Use QUIC instead of HTTP/2.",
|
|
2700
|
+
description_zh: "使用 QUIC 而非 HTTP/2。"
|
|
2701
|
+
}),
|
|
2702
|
+
quic_congestion_control: z.string().optional().meta({
|
|
2703
|
+
description: "QUIC congestion control algorithm.",
|
|
2704
|
+
description_zh: "QUIC 拥塞控制算法。"
|
|
2705
|
+
}),
|
|
2706
|
+
quic_session_receive_window: z.string().optional().meta({
|
|
2707
|
+
description: "QUIC session receive window size.",
|
|
2708
|
+
description_zh: "QUIC 会话接收窗口大小。"
|
|
2709
|
+
}),
|
|
2710
|
+
tls: OutboundTLSOptions.meta({
|
|
2711
|
+
description: "TLS configuration, see [TLS](/configuration/shared/tls/#outbound). Required.",
|
|
2712
|
+
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#outbound)。必填。"
|
|
2713
|
+
}),
|
|
2714
|
+
...ServerOptions.shape,
|
|
2715
|
+
...DialerOptions.shape
|
|
2716
|
+
}).meta({
|
|
2717
|
+
id: "NaiveOutboundOptions",
|
|
2718
|
+
title: "Naive Outbound",
|
|
2719
|
+
title_zh: "Naive 出站"
|
|
2720
|
+
});
|
|
2734
2721
|
|
|
2735
2722
|
//#endregion
|
|
2736
2723
|
//#region src/schema/protocols/redirect.ts
|
|
@@ -3288,6 +3275,10 @@ const TunInboundOptions = z.object({
|
|
|
3288
3275
|
description: "Exclude android packages in route. Android package rules are only supported on Android and require `auto_route`.",
|
|
3289
3276
|
description_zh: "排除路由的 Android 应用包名。Android 应用规则仅在 Android 下被支持,并且需要 `auto_route`。"
|
|
3290
3277
|
}),
|
|
3278
|
+
udp_timeout: z.union([z.string(), z.number()]).optional().meta({
|
|
3279
|
+
description: "UDP NAT expiration time. `5m` will be used by default.",
|
|
3280
|
+
description_zh: "UDP NAT 过期时间。默认使用 `5m`。"
|
|
3281
|
+
}),
|
|
3291
3282
|
stack: z.enum([
|
|
3292
3283
|
"system",
|
|
3293
3284
|
"gvisor",
|
|
@@ -3299,48 +3290,7 @@ const TunInboundOptions = z.object({
|
|
|
3299
3290
|
platform: TunPlatformOptions.optional().meta({
|
|
3300
3291
|
description: "Platform-specific settings, provided by client applications.",
|
|
3301
3292
|
description_zh: "平台特定的设置,由客户端应用提供。"
|
|
3302
|
-
})
|
|
3303
|
-
gso: z.boolean().optional().meta({
|
|
3304
|
-
description: "Enable generic segmentation offload.",
|
|
3305
|
-
description_zh: "启用通用分段卸载。",
|
|
3306
|
-
deprecated: true
|
|
3307
|
-
}),
|
|
3308
|
-
inet4_address: listableString.optional().meta({
|
|
3309
|
-
description: "IPv4 prefix for the tun interface.",
|
|
3310
|
-
description_zh: "tun 接口的 IPv4 前缀。",
|
|
3311
|
-
deprecated: true
|
|
3312
|
-
}),
|
|
3313
|
-
inet6_address: listableString.optional().meta({
|
|
3314
|
-
description: "IPv6 prefix for the tun interface.",
|
|
3315
|
-
description_zh: "tun 接口的 IPv6 前缀。",
|
|
3316
|
-
deprecated: true
|
|
3317
|
-
}),
|
|
3318
|
-
inet4_route_address: listableString.optional().meta({
|
|
3319
|
-
description: "Use custom routes instead of default when `auto_route` is enabled.",
|
|
3320
|
-
description_zh: "启用 `auto_route` 时使用自定义路由而不是默认路由。",
|
|
3321
|
-
deprecated: true
|
|
3322
|
-
}),
|
|
3323
|
-
inet6_route_address: listableString.optional().meta({
|
|
3324
|
-
description: "Use custom routes instead of default when `auto_route` is enabled.",
|
|
3325
|
-
description_zh: "启用 `auto_route` 时使用自定义路由而不是默认路由。",
|
|
3326
|
-
deprecated: true
|
|
3327
|
-
}),
|
|
3328
|
-
inet4_route_exclude_address: listableString.optional().meta({
|
|
3329
|
-
description: "Exclude custom routes when `auto_route` is enabled.",
|
|
3330
|
-
description_zh: "启用 `auto_route` 时排除自定义路由。",
|
|
3331
|
-
deprecated: true
|
|
3332
|
-
}),
|
|
3333
|
-
inet6_route_exclude_address: listableString.optional().meta({
|
|
3334
|
-
description: "Exclude custom routes when `auto_route` is enabled.",
|
|
3335
|
-
description_zh: "启用 `auto_route` 时排除自定义路由。",
|
|
3336
|
-
deprecated: true
|
|
3337
|
-
}),
|
|
3338
|
-
endpoint_independent_nat: z.boolean().optional().meta({
|
|
3339
|
-
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.",
|
|
3340
|
-
description_zh: "启用独立于端点的 NAT。此项仅在 gvisor 栈上可用,其他栈默认启用独立于端点的 NAT。性能可能略有下降,因此不建议在不需要时启用。",
|
|
3341
|
-
deprecated: true
|
|
3342
|
-
}),
|
|
3343
|
-
...ListenOptions.shape
|
|
3293
|
+
})
|
|
3344
3294
|
}).meta({
|
|
3345
3295
|
id: "TunInboundOptions",
|
|
3346
3296
|
title: "Tun Inbound",
|
|
@@ -3657,24 +3607,16 @@ const URLTestOutbound = z.object({
|
|
|
3657
3607
|
});
|
|
3658
3608
|
|
|
3659
3609
|
//#endregion
|
|
3660
|
-
//#region src/schema/protocols/
|
|
3661
|
-
const
|
|
3662
|
-
type: z.literal("
|
|
3663
|
-
tag: z.string().optional()
|
|
3664
|
-
method: z.string(),
|
|
3665
|
-
password: z.string(),
|
|
3666
|
-
obfs: z.string().optional(),
|
|
3667
|
-
obfs_param: z.string().optional(),
|
|
3668
|
-
protocol: z.string().optional(),
|
|
3669
|
-
protocol_param: z.string().optional(),
|
|
3670
|
-
network: Network.optional(),
|
|
3671
|
-
...ServerOptions.shape,
|
|
3672
|
-
...DialerOptions.shape
|
|
3610
|
+
//#region src/schema/protocols/block.ts
|
|
3611
|
+
const BlockOutboundOptions = z.object({
|
|
3612
|
+
type: z.literal("block"),
|
|
3613
|
+
tag: z.string().optional()
|
|
3673
3614
|
}).meta({
|
|
3674
|
-
id: "
|
|
3675
|
-
title: "
|
|
3676
|
-
title_zh: "
|
|
3677
|
-
|
|
3615
|
+
id: "BlockOutboundOptions",
|
|
3616
|
+
title: "Block Outbound",
|
|
3617
|
+
title_zh: "Block 出站",
|
|
3618
|
+
description: "Block outbound closes all incoming requests.",
|
|
3619
|
+
description_zh: "Block 出站关闭所有传入请求。"
|
|
3678
3620
|
});
|
|
3679
3621
|
|
|
3680
3622
|
//#endregion
|
|
@@ -3759,14 +3701,14 @@ const Outbound = z.discriminatedUnion("type", [
|
|
|
3759
3701
|
ShadowsocksOutboundOptions,
|
|
3760
3702
|
VMessOutboundOptions,
|
|
3761
3703
|
TrojanOutboundOptions,
|
|
3762
|
-
|
|
3704
|
+
BlockOutboundOptions,
|
|
3763
3705
|
HysteriaOutboundOptions,
|
|
3764
3706
|
ShadowTLSOutboundOptions,
|
|
3765
3707
|
AnyTLSOutboundOptions,
|
|
3766
3708
|
Hysteria2OutboundOptions,
|
|
3767
3709
|
TUICOutboundOptions,
|
|
3768
3710
|
VLESSOutboundOptions,
|
|
3769
|
-
|
|
3711
|
+
NaiveOutboundOptions,
|
|
3770
3712
|
SSHOutboundOptions,
|
|
3771
3713
|
TorOutboundOptions,
|
|
3772
3714
|
SelectorOutbound,
|
|
@@ -3799,14 +3741,6 @@ const RuleActionRouteOptions = z.object({
|
|
|
3799
3741
|
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.",
|
|
3800
3742
|
description_zh: "详情参阅 [拨号字段](/configuration/shared/dial/#network_strategy)。仅当出站为 direct 且 `outbound.bind_interface`、`outbound.inet4_bind_address` 与 `outbound.inet6_bind_address` 均未设置时生效。"
|
|
3801
3743
|
}),
|
|
3802
|
-
network_type: listable(NetworkType).optional().meta({
|
|
3803
|
-
description: "See Dial Fields (/configuration/shared/dial/#network_type) for details.",
|
|
3804
|
-
description_zh: "详情参阅 [拨号字段](/configuration/shared/dial/#network_type)。"
|
|
3805
|
-
}),
|
|
3806
|
-
fallback_network_type: listable(NetworkType).optional().meta({
|
|
3807
|
-
description: "See Dial Fields (/configuration/shared/dial/#fallback_network_type) for details.",
|
|
3808
|
-
description_zh: "详情参阅 [拨号字段](/configuration/shared/dial/#fallback_network_type)。"
|
|
3809
|
-
}),
|
|
3810
3744
|
fallback_delay: z.string().optional().meta({
|
|
3811
3745
|
description: "See Dial Fields (/configuration/shared/dial/#fallback_delay) for details.",
|
|
3812
3746
|
description_zh: "详情参阅 [拨号字段](/configuration/shared/dial/#fallback_delay)。"
|
|
@@ -3911,14 +3845,33 @@ const RuleActionRoute = z.object({
|
|
|
3911
3845
|
title: "Rule Action Route",
|
|
3912
3846
|
title_zh: "规则动作路由"
|
|
3913
3847
|
});
|
|
3848
|
+
const RuleActionBypass = z.object({
|
|
3849
|
+
action: z.literal("bypass").meta({
|
|
3850
|
+
description: "Action type.",
|
|
3851
|
+
description_zh: "动作类型。"
|
|
3852
|
+
}),
|
|
3853
|
+
outbound: z.string().optional().meta({
|
|
3854
|
+
description: "Tag of target outbound.",
|
|
3855
|
+
description_zh: "目标出站的标签。"
|
|
3856
|
+
}),
|
|
3857
|
+
...RuleActionRouteOptions.shape
|
|
3858
|
+
}).meta({
|
|
3859
|
+
id: "RuleActionBypass",
|
|
3860
|
+
title: "Rule Action Bypass",
|
|
3861
|
+
title_zh: "规则动作绕过"
|
|
3862
|
+
});
|
|
3914
3863
|
const RuleActionReject = z.object({
|
|
3915
3864
|
action: z.literal("reject").meta({
|
|
3916
3865
|
description: "Action type.",
|
|
3917
3866
|
description_zh: "动作类型。"
|
|
3918
3867
|
}),
|
|
3919
|
-
method: z.enum([
|
|
3920
|
-
|
|
3921
|
-
|
|
3868
|
+
method: z.enum([
|
|
3869
|
+
"default",
|
|
3870
|
+
"drop",
|
|
3871
|
+
"reply"
|
|
3872
|
+
]).optional().meta({
|
|
3873
|
+
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.",
|
|
3874
|
+
description_zh: "`default`: 对 TCP 连接回复 RST,对 UDP 包回复 ICMP 端口不可达,并对 ICMP 回显请求回复 ICMP 主机不可达。`drop`: 丢弃数据包。`reply`: 对 ICMP 回显请求回复 ICMP 回显响应。"
|
|
3922
3875
|
}),
|
|
3923
3876
|
no_drop: z.boolean().optional().meta({
|
|
3924
3877
|
description: "If not enabled, `method` will be temporarily overwritten to `drop` after 50 triggers in 30s.",
|
|
@@ -3929,12 +3882,13 @@ const RuleActionReject = z.object({
|
|
|
3929
3882
|
title: "Rule Action Reject",
|
|
3930
3883
|
title_zh: "规则动作拒绝"
|
|
3931
3884
|
});
|
|
3885
|
+
const DirectActionDialerOptions = DialerOptions.omit({ detour: true });
|
|
3932
3886
|
const RuleActionDirect = z.object({
|
|
3933
3887
|
action: z.literal("direct").meta({
|
|
3934
3888
|
description: "Action type.",
|
|
3935
3889
|
description_zh: "动作类型。"
|
|
3936
3890
|
}),
|
|
3937
|
-
...
|
|
3891
|
+
...DirectActionDialerOptions.shape
|
|
3938
3892
|
}).meta({
|
|
3939
3893
|
id: "RuleActionDirect",
|
|
3940
3894
|
title: "Rule Action Direct",
|
|
@@ -4158,6 +4112,7 @@ const BaseRouteRule = z.object({
|
|
|
4158
4112
|
const DefaultRouteRule = z.union([
|
|
4159
4113
|
BaseRouteRule.extend(RuleActionRouteByDefault.shape),
|
|
4160
4114
|
BaseRouteRule.extend(RuleActionRoute.shape),
|
|
4115
|
+
BaseRouteRule.extend(RuleActionBypass.shape),
|
|
4161
4116
|
BaseRouteRule.extend(RuleActionReject.shape),
|
|
4162
4117
|
BaseRouteRule.extend(RuleActionHijackDNS.shape),
|
|
4163
4118
|
BaseRouteRule.extend(RuleActionRouteOptionsWithAction.shape),
|
|
@@ -4165,7 +4120,7 @@ const DefaultRouteRule = z.union([
|
|
|
4165
4120
|
BaseRouteRule.extend(RuleActionResolve.shape),
|
|
4166
4121
|
BaseRouteRule.extend(RuleActionDirect.shape)
|
|
4167
4122
|
]);
|
|
4168
|
-
const
|
|
4123
|
+
const BaseLogicalRouteRule = z.object({
|
|
4169
4124
|
type: z.literal("logical").meta({
|
|
4170
4125
|
description: "Rule type.",
|
|
4171
4126
|
description_zh: "规则类型。"
|
|
@@ -4184,7 +4139,18 @@ const LogicalRouteRule = z.object({
|
|
|
4184
4139
|
description: "Invert match result.",
|
|
4185
4140
|
description_zh: "反选匹配结果。"
|
|
4186
4141
|
})
|
|
4187
|
-
})
|
|
4142
|
+
});
|
|
4143
|
+
const LogicalRouteRule = z.union([
|
|
4144
|
+
BaseLogicalRouteRule.extend(RuleActionRouteByDefault.shape),
|
|
4145
|
+
BaseLogicalRouteRule.extend(RuleActionRoute.shape),
|
|
4146
|
+
BaseLogicalRouteRule.extend(RuleActionBypass.shape),
|
|
4147
|
+
BaseLogicalRouteRule.extend(RuleActionReject.shape),
|
|
4148
|
+
BaseLogicalRouteRule.extend(RuleActionHijackDNS.shape),
|
|
4149
|
+
BaseLogicalRouteRule.extend(RuleActionRouteOptionsWithAction.shape),
|
|
4150
|
+
BaseLogicalRouteRule.extend(RuleActionSniff.shape),
|
|
4151
|
+
BaseLogicalRouteRule.extend(RuleActionResolve.shape),
|
|
4152
|
+
BaseLogicalRouteRule.extend(RuleActionDirect.shape)
|
|
4153
|
+
]).meta({
|
|
4188
4154
|
id: "LogicalRouteRule",
|
|
4189
4155
|
title: "Logical Route Rule",
|
|
4190
4156
|
title_zh: "逻辑路由规则"
|
|
@@ -4334,7 +4300,7 @@ const HeadlessRule = z.union([DefaultHeadlessRule, LogicalHeadlessRule]).meta({
|
|
|
4334
4300
|
title_zh: "无头规则"
|
|
4335
4301
|
});
|
|
4336
4302
|
const InlineRuleSetOptions = z.object({
|
|
4337
|
-
type: z.literal("inline").meta({
|
|
4303
|
+
type: z.literal("inline").optional().meta({
|
|
4338
4304
|
description: "Rule set type.",
|
|
4339
4305
|
description_zh: "规则集类型。"
|
|
4340
4306
|
}),
|
|
@@ -4403,7 +4369,7 @@ const RemoteRuleSetOptions = z.object({
|
|
|
4403
4369
|
title: "Remote Rule Set Options",
|
|
4404
4370
|
title_zh: "远程规则集选项"
|
|
4405
4371
|
});
|
|
4406
|
-
const RuleSet = z.
|
|
4372
|
+
const RuleSet = z.union([
|
|
4407
4373
|
InlineRuleSetOptions,
|
|
4408
4374
|
LocalRuleSetOptions,
|
|
4409
4375
|
RemoteRuleSetOptions
|
|
@@ -4556,7 +4522,11 @@ const CCMServiceOptions = z.object({
|
|
|
4556
4522
|
description: "TLS configuration, see [TLS](/configuration/shared/tls/#inbound).",
|
|
4557
4523
|
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#inbound)。"
|
|
4558
4524
|
}),
|
|
4559
|
-
...ListenOptions.shape
|
|
4525
|
+
...ListenOptions.shape,
|
|
4526
|
+
detour: z.string().optional().meta({
|
|
4527
|
+
description: "Outbound tag for connecting to the Claude API.",
|
|
4528
|
+
description_zh: "用于连接到 Claude API 的出站标签。"
|
|
4529
|
+
})
|
|
4560
4530
|
}).meta({
|
|
4561
4531
|
id: "CCMServiceOptions",
|
|
4562
4532
|
title: "CCM",
|
|
@@ -4615,7 +4585,7 @@ const DERPServiceOptions = z.object({
|
|
|
4615
4585
|
description: "TLS configuration, see [TLS](/configuration/shared/tls/#inbound).",
|
|
4616
4586
|
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#inbound)。"
|
|
4617
4587
|
}),
|
|
4618
|
-
config_path: z.string().meta({
|
|
4588
|
+
config_path: z.string().optional().meta({
|
|
4619
4589
|
description: "Derper configuration file path. Example: `derper.key`.",
|
|
4620
4590
|
description_zh: "Derper 配置文件路径。示例:`derper.key`。"
|
|
4621
4591
|
}),
|
|
@@ -4694,7 +4664,11 @@ const OCMServiceOptions = z.object({
|
|
|
4694
4664
|
description: "TLS configuration, see [TLS](/configuration/shared/tls/#inbound).",
|
|
4695
4665
|
description_zh: "TLS 配置,参阅 [TLS](/zh/configuration/shared/tls/#inbound)。"
|
|
4696
4666
|
}),
|
|
4697
|
-
...ListenOptions.shape
|
|
4667
|
+
...ListenOptions.shape,
|
|
4668
|
+
detour: z.string().optional().meta({
|
|
4669
|
+
description: "Outbound tag for connecting to the OpenAI API.",
|
|
4670
|
+
description_zh: "用于连接到 OpenAI API 的出站标签。"
|
|
4671
|
+
})
|
|
4698
4672
|
}).meta({
|
|
4699
4673
|
id: "OCMServiceOptions",
|
|
4700
4674
|
title: "OCM",
|
|
@@ -4703,6 +4677,42 @@ const OCMServiceOptions = z.object({
|
|
|
4703
4677
|
description_zh: "OCM(OpenAI Codex 多路复用器)服务是一个多路复用服务,允许您通过自定义令牌远程访问本地的 OpenAI Codex 订阅。"
|
|
4704
4678
|
});
|
|
4705
4679
|
|
|
4680
|
+
//#endregion
|
|
4681
|
+
//#region src/schema/services/oom-killer.ts
|
|
4682
|
+
/**
|
|
4683
|
+
* OOM Killer service options for sing-box.
|
|
4684
|
+
*/
|
|
4685
|
+
const OOMKillerServiceOptions = z.object({
|
|
4686
|
+
type: z.literal("oom-killer"),
|
|
4687
|
+
tag: z.string().optional(),
|
|
4688
|
+
memory_limit: z.string().optional().meta({
|
|
4689
|
+
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.",
|
|
4690
|
+
description_zh: "触发 OOM 强杀的内存限制,支持可读的字节大小格式,如 `128MiB`、`1GiB`。当内存使用量超过该阈值时,OOM killer 将被激活。"
|
|
4691
|
+
}),
|
|
4692
|
+
safety_margin: z.string().optional().meta({
|
|
4693
|
+
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.",
|
|
4694
|
+
description_zh: "在执行限制前额外减去的内存缓冲量,支持可读的字节大小格式,如 `32MiB`。提供一定余量以避免过于激进的强杀行为。"
|
|
4695
|
+
}),
|
|
4696
|
+
min_interval: z.union([z.string(), z.number()]).optional().meta({
|
|
4697
|
+
description: "The minimum interval between consecutive OOM kill checks. Accepts a duration string such as `1s`. Prevents excessive kill frequency.",
|
|
4698
|
+
description_zh: "两次 OOM 检测之间的最小间隔,支持时间字符串格式如 `1s`。防止过于频繁的强杀操作。"
|
|
4699
|
+
}),
|
|
4700
|
+
max_interval: z.union([z.string(), z.number()]).optional().meta({
|
|
4701
|
+
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`.",
|
|
4702
|
+
description_zh: "两次 OOM 检测之间的最大间隔,支持时间字符串格式如 `30s`。检测间隔会在 `min_interval` 与 `max_interval` 之间动态调整。"
|
|
4703
|
+
}),
|
|
4704
|
+
checks_before_limit: z.number().int().optional().meta({
|
|
4705
|
+
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.",
|
|
4706
|
+
description_zh: "在 OOM killer 采取行动之前,内存需要连续超过限制的检测次数。用于减少因瞬时内存峰值引发的误杀。"
|
|
4707
|
+
})
|
|
4708
|
+
}).meta({
|
|
4709
|
+
id: "OOMKillerServiceOptions",
|
|
4710
|
+
title: "OOM Killer Service",
|
|
4711
|
+
title_zh: "OOM Killer 服务",
|
|
4712
|
+
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.",
|
|
4713
|
+
description_zh: "OOM Killer 服务监控内存使用情况,并在超过配置限制时终止进程,从而防止系统级内存耗尽情况的发生。"
|
|
4714
|
+
});
|
|
4715
|
+
|
|
4706
4716
|
//#endregion
|
|
4707
4717
|
//#region src/schema/services/resolved.ts
|
|
4708
4718
|
/**
|
|
@@ -4758,6 +4768,7 @@ const Service = z.discriminatedUnion("type", [
|
|
|
4758
4768
|
CCMServiceOptions,
|
|
4759
4769
|
DERPServiceOptions,
|
|
4760
4770
|
OCMServiceOptions,
|
|
4771
|
+
OOMKillerServiceOptions,
|
|
4761
4772
|
ResolvedServiceOptions,
|
|
4762
4773
|
SSMAPIServiceOptions
|
|
4763
4774
|
]).meta({
|
|
@@ -4784,12 +4795,12 @@ const Configuration = z.object({
|
|
|
4784
4795
|
experimental: ExperimentalOptions.optional()
|
|
4785
4796
|
}).meta({
|
|
4786
4797
|
id: "Configuration",
|
|
4787
|
-
title: "Sing-box v1.13.
|
|
4788
|
-
title_zh: "Sing-box v1.13.
|
|
4789
|
-
description: "Sing-box v1.13.
|
|
4790
|
-
description_zh: "Sing-box v1.13.
|
|
4791
|
-
version: "1.13.
|
|
4798
|
+
title: "Sing-box v1.13.13 Configuration",
|
|
4799
|
+
title_zh: "Sing-box v1.13.13 配置文件",
|
|
4800
|
+
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.",
|
|
4801
|
+
description_zh: "Sing-box v1.13.13 配置文件定义。sing-box 使用 JSON 作为配置文件格式,包含 log、dns、ntp、certificate、endpoints、inbounds、outbounds、route、services 与 experimental 字段。",
|
|
4802
|
+
version: "1.13.13"
|
|
4792
4803
|
});
|
|
4793
4804
|
|
|
4794
4805
|
//#endregion
|
|
4795
|
-
export { AnyTLSInboundOptions, AnyTLSOutboundOptions, AnyTLSUser, CertificateOptions, Configuration, DHCPDNSServerOptions, DNSClientOptions, DNSOptions, DNSRule, DNSServer, DebugOptions, DialerOptions, DirectInboundOptions, DirectOutboundOptions, DomainResolverOptions, DomainStrategy, Endpoint, ExperimentalOptions, FakeIPDNSServerOptions, FwMark, GeoIPOptions, GeositeOptions, HTTP3DNSServerOptions, HTTPInboundOptions, HTTPOutboundOptions, HTTPProxyOptions, HTTPSDNSServerOptions, HeadlessRule, HostsDNSServerOptions, HttpHeader, Hysteria2InboundOptions, Hysteria2Masquerade, Hysteria2Obfs, Hysteria2OutboundOptions, Hysteria2User, HysteriaInboundOptions, HysteriaOutboundOptions, HysteriaUser, Inbound, InboundMultiplexOptions,
|
|
4806
|
+
export { AnyTLSInboundOptions, AnyTLSOutboundOptions, AnyTLSUser, BlockOutboundOptions, CertificateOptions, Configuration, DHCPDNSServerOptions, DNSClientOptions, DNSOptions, DNSRule, DNSServer, DebugOptions, DialerOptions, DirectInboundOptions, DirectOutboundOptions, DomainResolverOptions, DomainStrategy, Endpoint, ExperimentalOptions, FakeIPDNSServerOptions, FwMark, GeoIPOptions, GeositeOptions, HTTP3DNSServerOptions, HTTPInboundOptions, HTTPOutboundOptions, HTTPProxyOptions, HTTPSDNSServerOptions, HeadlessRule, HostsDNSServerOptions, HttpHeader, Hysteria2InboundOptions, Hysteria2Masquerade, Hysteria2Obfs, Hysteria2OutboundOptions, Hysteria2User, HysteriaInboundOptions, HysteriaOutboundOptions, HysteriaUser, Inbound, InboundMultiplexOptions, InboundTLSOptions, IpVersion, LegacyDNSFakeIPOptions, LegacyDNSServerOptions, ListenOptions, LocalDNSServerOptions, LogOptions, MixedInboundOptions, NTPOptions, NaiveInboundOptions, NaiveOutboundOptions, Network, NetworkStrategy, NetworkType, Outbound, OutboundMultiplexOptions, OutboundTLSOptions, QUICDNSServerOptions, RedirectInboundOptions, ResolvedDNSServerOptions, RouteOptions, RouteRule, RuleSet, SSHOutboundOptions, SelectorOutbound, ServerOptions, Service, ShadowTLSInboundOptions, ShadowTLSOutboundOptions, ShadowsocksDestination, ShadowsocksInboundOptions, ShadowsocksOutboundOptions, ShadowsocksUser, SocksInboundOptions, SocksOutboundOptions, TCPDNSServerOptions, TLSDNSServerOptions, TProxyInboundOptions, TUICInboundOptions, TUICOutboundOptions, TUICUser, Tag, TailscaleDNSServerOptions, TailscaleEndpointOptions, TorOutboundOptions, TrojanInboundOptions, TrojanOutboundOptions, TrojanUser, TunInboundOptions, TunPlatformOptions, UDPDNSServerOptions, UDPOverTCPOptions, URLTestOutbound, V2RayTransportOptions, VLESSInboundOptions, VLESSOutboundOptions, VLESSUser, VMessInboundOptions, VMessOutboundOptions, VMessUser, WireGuardEndpointOptions, WireGuardPeer };
|