forked from mirror/serenity
Merge branch 'dev' of git.puqns67.icu:mirror/serenity into dev
This commit is contained in:
commit
ea629c413d
@ -2,8 +2,10 @@
|
||||
icon: material/alert-decagram
|
||||
---
|
||||
|
||||
#### 1.1.0-alpha.4
|
||||
#### 1.1.0-beta.3
|
||||
|
||||
* Rename `template.servers` to `template.dns_servers`
|
||||
* Set `tun.route_exclude_address_set` for traffic bypassing
|
||||
* Fixes and improvements
|
||||
|
||||
#### 1.1.0-alpha.3
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
"dns": "",
|
||||
"dns_local": "",
|
||||
"dns_servers": [],
|
||||
"enable_fakeip": false,
|
||||
"pre_dns_rules": [],
|
||||
"custom_dns_rules": [],
|
||||
@ -143,6 +144,12 @@ DNS server used for China DNS requests.
|
||||
|
||||
`114.114.114.114` is used by default.
|
||||
|
||||
#### dns_servers
|
||||
|
||||
List of [DNS Server](https://sing-box.sagernet.org/configuration/dns/server/).
|
||||
|
||||
Will be append to DNS servers.
|
||||
|
||||
#### enable_fakeip
|
||||
|
||||
Enable FakeIP.
|
||||
|
@ -1,10 +1,10 @@
|
||||
---
|
||||
description: 欢迎来到该 sing-box 项目的文档页。
|
||||
description: 欢迎来到该 serenity 项目的文档页。
|
||||
---
|
||||
|
||||
# :material-home: 开始
|
||||
|
||||
欢迎来到该 sing-box 项目的文档页。
|
||||
欢迎来到该 serenity 项目的文档页。
|
||||
|
||||
sing-box 配置生成器。
|
||||
|
||||
|
@ -28,7 +28,7 @@ type _Template struct {
|
||||
RemoteResolve bool `json:"remote_resolve,omitempty"`
|
||||
|
||||
// DNS
|
||||
CustomDNSServers []option.DNSServerOptions `json:"custom_dns_servers,omitempty"`
|
||||
DNSServers []option.DNSServerOptions `json:"dns_servers,omitempty"`
|
||||
DNS string `json:"dns,omitempty"`
|
||||
DNSLocal string `json:"dns_local,omitempty"`
|
||||
DNSSetup string `json:"dns_setup,omitempty"`
|
||||
|
@ -39,6 +39,6 @@ func decodeBase64URLSafe(content string) (string, error) {
|
||||
content = strings.ReplaceAll(content, "/", "_")
|
||||
content = strings.ReplaceAll(content, "+", "-")
|
||||
content = strings.ReplaceAll(content, "=", "")
|
||||
result, err := base64.StdEncoding.DecodeString(content)
|
||||
result, err := base64.RawURLEncoding.DecodeString(content)
|
||||
return string(result), err
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ func extendTemplate(ctx context.Context, rawTemplates []option.Template, root, c
|
||||
if err != nil {
|
||||
return option.Template{}, E.Cause(err, "initialize template[", current.Name, "]: merge extended template: ", current.Extend)
|
||||
}
|
||||
newTemplate, err := json.UnmarshalExtended[option.Template](newRawTemplate)
|
||||
newTemplate, err := json.UnmarshalExtendedContext[option.Template](ctx, newRawTemplate)
|
||||
if err != nil {
|
||||
return option.Template{}, E.Cause(err, "initialize template[", current.Name, "]: unmarshal extended template: ", current.Extend)
|
||||
}
|
||||
|
@ -130,11 +130,7 @@ func (t *Template) renderDNS(metadata M.Metadata, options *option.Options) error
|
||||
Address: "fakeip",
|
||||
})
|
||||
}
|
||||
|
||||
if len(t.CustomDNSServers) > 0 {
|
||||
options.DNS.Servers = append(options.DNS.Servers, t.CustomDNSServers...)
|
||||
}
|
||||
|
||||
options.DNS.Servers = append(options.DNS.Servers, t.DNSServers...)
|
||||
options.DNS.Rules = []option.DNSRule{
|
||||
{
|
||||
Type: C.RuleTypeDefault,
|
||||
|
@ -29,6 +29,7 @@ func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options)
|
||||
autoRedirect := t.AutoRedirect &&
|
||||
!metadata.Platform.IsApple() &&
|
||||
(metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.10.0-alpha.2")))
|
||||
tunExclude := metadata.Platform != M.PlatformAndroid && (metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.11.0-beta.14")))
|
||||
disableTun := t.DisableTUN && !metadata.Platform.TunOnly()
|
||||
if !disableTun {
|
||||
options.Route.AutoDetectInterface = true
|
||||
@ -37,18 +38,16 @@ func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options)
|
||||
address = append(address, netip.MustParsePrefix("fdfe:dcba:9876::1/126"))
|
||||
}
|
||||
tunOptions := &option.TunInboundOptions{
|
||||
AutoRoute: true,
|
||||
Address: address,
|
||||
AutoRoute: true,
|
||||
Address: address,
|
||||
AutoRedirect: autoRedirect,
|
||||
}
|
||||
tunInbound := option.Inbound{
|
||||
Type: C.TypeTun,
|
||||
Options: tunOptions,
|
||||
}
|
||||
if autoRedirect {
|
||||
tunOptions.AutoRedirect = true
|
||||
if !t.DisableTrafficBypass && metadata.Platform == "" {
|
||||
tunOptions.RouteExcludeAddressSet = []string{"geoip-cn"}
|
||||
}
|
||||
if tunExclude && !t.DisableTrafficBypass {
|
||||
tunOptions.RouteExcludeAddressSet = []string{"geoip-cn"}
|
||||
}
|
||||
if metadata.Platform == M.PlatformUnknown {
|
||||
tunOptions.StrictRoute = true
|
||||
|
Loading…
Reference in New Issue
Block a user