Compare commits

..

63 Commits

Author SHA1 Message Date
世界
2b18fc4886
documentation: Bump version 2025-03-29 23:13:09 +08:00
世界
73862ac6bf
Fix Tailscale dialer 2025-03-29 23:12:15 +08:00
dyhkwong
c22210da47
Fix DNS over QUIC stream close 2025-03-29 23:12:15 +08:00
anytls
886e379e62
Update anytls
Co-authored-by: anytls <anytls>
2025-03-29 23:12:14 +08:00
Rambling2076
5c793629fe
Fix missing with_tailscale in Dockerfile
Signed-off-by: Rambling2076 <Rambling2076@proton.me>
2025-03-29 23:12:14 +08:00
世界
8b3cab3379
Fail when default DNS server not found 2025-03-29 23:12:14 +08:00
世界
235c4c7a96
Update gVisor to 20250319.0 2025-03-29 23:12:13 +08:00
世界
9bfb76168a
release: Do not build tailscale on iOS and tvOS 2025-03-29 23:12:13 +08:00
世界
fa5a74ec01
Explicitly reject detour to empty direct outbounds 2025-03-29 23:12:12 +08:00
世界
db9f8e8c52
Ignore UDP offload error 2025-03-29 23:12:12 +08:00
世界
680c5e5c28
Add netns support 2025-03-29 23:12:11 +08:00
世界
15a459d7be
Add wildcard name support for predefined records 2025-03-29 23:12:11 +08:00
世界
55eee56da9
Remove map usage in options 2025-03-29 23:12:11 +08:00
世界
eab82bd3df
Fix unhandled DNS loop 2025-03-29 23:12:10 +08:00
世界
1ea1c49c95
Add wildcard-sni support for shadow-tls inbound 2025-03-29 23:12:10 +08:00
世界
80e7df911c
Fix Tailscale DNS 2025-03-29 23:12:10 +08:00
k9982874
a2cac25b23
Add ntp protocol sniffing 2025-03-29 23:12:10 +08:00
世界
a24679fb56
option: Fix marshal legacy DNS options 2025-03-29 23:12:10 +08:00
世界
06f25876b3
Make domain_resolver optional when only one DNS server is configured 2025-03-29 23:12:10 +08:00
世界
f46df03695
Fix DNS lookup context pollution 2025-03-29 23:12:10 +08:00
世界
f76f091096
Fix http3 DNS server connecting to wrong address 2025-03-29 23:12:09 +08:00
Restia-Ashbell
9e8debd4c9
documentation: Fix typo 2025-03-29 23:12:09 +08:00
anytls
90d2cc9043
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-03-29 23:12:08 +08:00
k9982874
bdf86c2552
Fix hosts DNS server 2025-03-29 23:12:08 +08:00
世界
4dcc1812c6
Fix UDP DNS server crash 2025-03-29 23:12:08 +08:00
世界
648692977d
documentation: Fix missing ip_accept_any DNS rule option 2025-03-29 23:12:08 +08:00
世界
6e7650b59a
Fix anytls dialer usage 2025-03-29 23:12:08 +08:00
世界
99379ce244
Move predefined DNS server to rule action 2025-03-29 23:12:08 +08:00
世界
4a75aa1818
Fix domain resolver on direct outbound 2025-03-29 23:12:08 +08:00
Zephyruso
1825629331
Fix missing AnyTLS display name 2025-03-29 23:12:07 +08:00
anytls
15c9b6f72f
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-03-29 23:12:07 +08:00
Estel
fa769014fc
documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-03-29 23:12:06 +08:00
TargetLocked
731ed4c06d
Fix parsing legacy DNS options 2025-03-29 23:12:06 +08:00
世界
c19c6afc76
Fix DNS fallback 2025-03-29 23:12:05 +08:00
世界
331edbacff
documentation: Fix missing hosts DNS server 2025-03-29 23:12:05 +08:00
anytls
e7ad8d294d
Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-03-29 23:12:05 +08:00
ReleTor
1f67c9984c
documentation: Minor fixes 2025-03-29 23:12:05 +08:00
libtry486
7750a86555
documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-03-29 23:12:04 +08:00
Alireza Ahmadi
f7724231e3
Fix Outbound deadlock 2025-03-29 23:12:04 +08:00
世界
09d45fc7cc
documentation: Fix AnyTLS doc 2025-03-29 23:12:04 +08:00
anytls
c2a81243bf
Add AnyTLS protocol 2025-03-29 23:12:03 +08:00
世界
7799b89e8d
Migrate to stdlib ECH support 2025-03-29 23:12:02 +08:00
世界
6b88de19d2
Add fallback local DNS server for iOS 2025-03-29 23:12:02 +08:00
世界
7347b930ea
Get darwin local DNS server from libresolv 2025-03-29 23:12:02 +08:00
世界
a3daf39877
Improve resolve action 2025-03-29 23:12:02 +08:00
世界
75fcb2468f
Fix toolchain version 2025-03-29 23:12:02 +08:00
世界
c15f844727
Add back port hopping to hysteria 1 2025-03-29 23:12:02 +08:00
世界
023ac1c536
Update dependencies 2025-03-29 23:12:01 +08:00
xchacha20-poly1305
bfd1ba1ad6
Remove single quotes of raw Moziila certs 2025-03-29 23:12:00 +08:00
世界
b9a99796d0
Add Tailscale endpoint 2025-03-29 23:12:00 +08:00
世界
334844b4f1
Build legacy binaries with latest Go 2025-03-29 23:12:00 +08:00
世界
d40083a859
documentation: Remove outdated icons 2025-03-29 23:11:59 +08:00
世界
ae41e33b68
documentation: Certificate store 2025-03-29 23:11:59 +08:00
世界
ef63985738
documentation: TLS fragment 2025-03-29 23:11:58 +08:00
世界
8823d7f8d9
documentation: Outbound domain resolver 2025-03-29 23:11:58 +08:00
世界
690f4ab965
documentation: Refactor DNS 2025-03-29 23:11:58 +08:00
世界
d401a6f631
Add certificate store 2025-03-29 23:11:57 +08:00
世界
2179afad5e
Add TLS fragment support 2025-03-29 23:11:57 +08:00
世界
24941ad54c
refactor: Outbound domain resolver 2025-03-29 23:11:56 +08:00
世界
552123a9f1
refactor: DNS 2025-03-29 23:11:56 +08:00
世界
47fc3ebda4
Add duplicate tag check 2025-03-29 23:10:22 +08:00
世界
9774a659b0
Fix DoQ / truncate DNS message 2025-03-29 17:41:22 +08:00
世界
2e4a6de4e7
release: Fix read tag 2025-03-27 20:30:57 +08:00
8 changed files with 77 additions and 11 deletions

View File

@ -27,11 +27,8 @@ func main() {
)
if flagRunNightly {
var version badversion.Version
version, err = build_shared.ReadTagVersionRev()
version, err = build_shared.ReadTagVersion()
if err == nil {
if version.PreReleaseIdentifier == "" {
version.Patch++
}
versionStr = version.String()
}
} else {

View File

@ -102,12 +102,12 @@ func NewWithOptions(options Options) (N.Dialer, error) {
}
dnsQueryOptions.Transport = transport
resolveFallbackDelay = time.Duration(dialOptions.FallbackDelay)
} else if options.NewDialer {
return nil, E.New("missing domain resolver for domain server address")
} else {
transports := dnsTransport.Transports()
if len(transports) < 2 {
dnsQueryOptions.Transport = dnsTransport.Default()
} else if options.NewDialer {
return nil, E.New("missing domain resolver for domain server address")
} else {
deprecated.Report(options.Context, deprecated.OptionMissingDomainResolver)
}

View File

@ -15,6 +15,8 @@ func TruncateDNSMessage(request *dns.Msg, response *dns.Msg, headroom int) (*buf
}
responseLen := response.Len()
if responseLen > maxLen {
copyResponse := *response
response = &copyResponse
response.Truncate(maxLen)
}
buffer := buf.NewSize(headroom*2 + 1 + responseLen)

View File

@ -2,7 +2,7 @@
icon: material/alert-decagram
---
#### 1.12.0-alpha.21
#### 1.12.0-alpha.23
* Fixes and improvements

2
go.mod
View File

@ -35,7 +35,7 @@ require (
github.com/sagernet/sing-tun v0.6.2-0.20250319123703-35b5747b44ec
github.com/sagernet/sing-vmess v0.2.0
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7
github.com/sagernet/tailscale v1.80.3-mod.0
github.com/sagernet/tailscale v1.80.3-mod.2
github.com/sagernet/utls v1.6.7
github.com/sagernet/wireguard-go v0.0.1-beta.5
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854

4
go.sum
View File

@ -196,8 +196,8 @@ github.com/sagernet/sing-vmess v0.2.0 h1:pCMGUXN2k7RpikQV65/rtXtDHzb190foTfF9IGT
github.com/sagernet/sing-vmess v0.2.0/go.mod h1:jDAZ0A0St1zVRkyvhAPRySOFfhC+4SQtO5VYyeFotgA=
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7 h1:DImB4lELfQhplLTxeq2z31Fpv8CQqqrUwTbrIRumZqQ=
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7/go.mod h1:FP9X2xjT/Az1EsG/orYYoC+5MojWnuI7hrffz8fGwwo=
github.com/sagernet/tailscale v1.80.3-mod.0 h1:oHIdivbR/yxoiA9d3a2rRlhYn2shY9XVF35Rr8jW508=
github.com/sagernet/tailscale v1.80.3-mod.0/go.mod h1:EBxXsWu4OH2ELbQLq32WoBeIubG8KgDrg4/Oaxjs6lI=
github.com/sagernet/tailscale v1.80.3-mod.2 h1:hT0CI74q727EuCcgQ+T4pvon8V0aoi4vTAxah7GsNMQ=
github.com/sagernet/tailscale v1.80.3-mod.2/go.mod h1:EBxXsWu4OH2ELbQLq32WoBeIubG8KgDrg4/Oaxjs6lI=
github.com/sagernet/utls v1.6.7 h1:Ep3+aJ8FUGGta+II2IEVNUc3EDhaRCZINWkj/LloIA8=
github.com/sagernet/utls v1.6.7/go.mod h1:Uua1TKO/FFuAhLr9rkaVnnrTmmiItzDjv1BUb2+ERwM=
github.com/sagernet/wireguard-go v0.0.1-beta.5 h1:aBEsxJUMEONwOZqKPIkuAcv4zJV5p6XlzEN04CF0FXc=

View File

@ -4,6 +4,7 @@ import (
"bytes"
"context"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/json"
)
@ -31,7 +32,7 @@ func (o *Options) UnmarshalJSONContext(ctx context.Context, content []byte) erro
return err
}
o.RawMessage = content
return nil
return checkOptions(o)
}
type LogOptions struct {
@ -43,3 +44,52 @@ type LogOptions struct {
}
type StubOptions struct{}
func checkOptions(options *Options) error {
err := checkInbounds(options.Inbounds)
if err != nil {
return err
}
err = checkOutbounds(options.Outbounds, options.Endpoints)
if err != nil {
return err
}
return nil
}
func checkInbounds(inbounds []Inbound) error {
seen := make(map[string]bool)
for _, inbound := range inbounds {
if inbound.Tag == "" {
continue
}
if seen[inbound.Tag] {
return E.New("duplicate inbound tag: ", inbound.Tag)
}
seen[inbound.Tag] = true
}
return nil
}
func checkOutbounds(outbounds []Outbound, endpoints []Endpoint) error {
seen := make(map[string]bool)
for _, outbound := range outbounds {
if outbound.Tag == "" {
continue
}
if seen[outbound.Tag] {
return E.New("duplicate outbound/endpoint tag: ", outbound.Tag)
}
seen[outbound.Tag] = true
}
for _, endpoint := range endpoints {
if endpoint.Tag == "" {
continue
}
if seen[endpoint.Tag] {
return E.New("duplicate outbound/endpoint tag: ", endpoint.Tag)
}
seen[endpoint.Tag] = true
}
return nil
}

View File

@ -2,8 +2,10 @@ package tailscale
import (
"context"
"crypto/tls"
"fmt"
"net"
"net/http"
"net/netip"
"net/url"
"os"
@ -147,6 +149,17 @@ func NewEndpoint(ctx context.Context, router adapter.Router, logger log.ContextL
return dnsRouter.Lookup(ctx, host, outboundDialer.(dialer.ResolveDialer).QueryOptions())
},
DNS: &dnsConfigurtor{},
HTTPClient: &http.Client{
Transport: &http.Transport{
ForceAttemptHTTP2: true,
DialContext: func(ctx context.Context, network, address string) (net.Conn, error) {
return outboundDialer.DialContext(ctx, network, M.ParseSocksaddr(address))
},
TLSClientConfig: &tls.Config{
RootCAs: adapter.RootPoolFromContext(ctx),
},
},
},
}
return &Endpoint{
Adapter: endpoint.NewAdapter(C.TypeTailscale, tag, []string{N.NetworkTCP, N.NetworkUDP}, nil),
@ -446,6 +459,10 @@ func (t *Endpoint) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn,
t.router.RoutePacketConnectionEx(ctx, conn, metadata, onClose)
}
func (t *Endpoint) Server() *tsnet.Server {
return t.server
}
func addressFromAddr(destination netip.Addr) tcpip.Address {
if destination.Is6() {
return tcpip.AddrFrom16(destination.As16())