Compare commits

..

96 Commits

Author SHA1 Message Date
世界
3334c7dc47
documentation: Bump version 2025-05-26 18:29:16 +08:00
世界
fc2e1bd5a1
Fix tailscale forward 2025-05-26 18:29:15 +08:00
世界
049cc4cafe
Minor fixes 2025-05-26 18:29:15 +08:00
世界
7e6d7949cf
Update quic-go to v0.52.0 2025-05-26 18:29:15 +08:00
世界
6162fcbe8c
Add SSM API service 2025-05-26 18:29:15 +08:00
世界
be50f24079
Add resolved service and DNS server 2025-05-26 18:29:15 +08:00
世界
63eb6a03dd
Add DERP service 2025-05-26 18:29:15 +08:00
世界
9ae2c9ecd0
Add service component type 2025-05-26 18:29:14 +08:00
世界
0327f94012
Fix tproxy tcp control 2025-05-26 18:29:14 +08:00
愚者
3b2ba01b44
release: Fix build tags for android
Signed-off-by: 愚者 <11926619+FansChou@users.noreply.github.com>
2025-05-26 18:29:14 +08:00
世界
2c25257b3d
prevent creation of bind and mark controls on unsupported platforms 2025-05-26 18:29:14 +08:00
PuerNya
e4824d7bc2
documentation: Fix description of reject DNS action behavior 2025-05-26 18:29:14 +08:00
Restia-Ashbell
f21d686e95
Fix TLS record fragment 2025-05-26 18:29:14 +08:00
世界
3e7569fff3
Add missing accept_routes option for Tailscale 2025-05-26 18:29:13 +08:00
世界
7e883f67f6
Add TLS record fragment support 2025-05-26 18:29:13 +08:00
世界
a49d566cda
release: Update Go to 1.24.3 2025-05-26 18:29:13 +08:00
世界
3608c41789
Fix set edns0 client subnet 2025-05-26 18:29:13 +08:00
世界
d1a12e1ce9
Update minor dependencies 2025-05-26 18:29:12 +08:00
世界
e5b6b503f5
Update certmagic and providers 2025-05-26 18:29:12 +08:00
世界
0131d8b9f4
Update protobuf and grpc 2025-05-26 18:29:12 +08:00
世界
2a407ccb71
Add control options for listeners 2025-05-26 18:29:11 +08:00
世界
2b5abde151
Update quic-go to v0.51.0 2025-05-26 18:29:11 +08:00
世界
639211d3e0
Update utls to v1.7.2 2025-05-26 18:29:11 +08:00
世界
b93a6ff261
Handle EDNS version downgrade 2025-05-26 18:29:02 +08:00
世界
057e5f3cab
documentation: Fix anytls padding scheme description 2025-05-26 18:29:02 +08:00
安容
46a3fabca2
Report invalid DNS address early 2025-05-26 18:29:02 +08:00
世界
2d923b4825
Fix wireguard listen_port 2025-05-26 18:29:01 +08:00
世界
843d591a17
clash-api: Add more meta api 2025-05-26 18:29:01 +08:00
世界
c4ca146a4c
Fix DNS lookup 2025-05-26 18:29:01 +08:00
世界
f4e9c33a0b
Fix fetch ECH configs 2025-05-26 18:29:01 +08:00
reletor
df00507025
documentation: Minor fixes 2025-05-26 18:29:00 +08:00
caelansar
0a1e135839
Fix callback deletion in UDP transport 2025-05-26 18:29:00 +08:00
世界
13b4b72ac6
documentation: Try to make the play review happy 2025-05-26 18:29:00 +08:00
世界
fc425b802b
Fix missing handling of legacy domain_strategy options 2025-05-26 18:29:00 +08:00
世界
a31bbf35c2
Improve local DNS server 2025-05-26 18:29:00 +08:00
anytls
0c0374c749
Update anytls
Co-authored-by: anytls <anytls>
2025-05-26 18:29:00 +08:00
世界
cb95a1bd30
Fix DNS dialer 2025-05-26 18:28:59 +08:00
世界
1669eaf7c0
release: Skip override version for iOS 2025-05-26 18:28:59 +08:00
iikira
f59a14c5f2
Fix UDP DNS server crash
Signed-off-by: iikira <i2@mail.iikira.com>
2025-05-26 18:28:58 +08:00
ReleTor
14c08adcf8
Fix fetch ECH configs 2025-05-26 18:28:58 +08:00
世界
6d7a4bde5c
Allow direct outbounds without domain_resolver 2025-05-26 18:28:58 +08:00
世界
45b7f2a93f
Fix Tailscale dialer 2025-05-26 18:28:57 +08:00
dyhkwong
cd26a95509
Fix DNS over QUIC stream close 2025-05-26 18:28:57 +08:00
anytls
8dc129ef11
Update anytls
Co-authored-by: anytls <anytls>
2025-05-26 18:28:56 +08:00
Rambling2076
c223a6edf6
Fix missing with_tailscale in Dockerfile
Signed-off-by: Rambling2076 <Rambling2076@proton.me>
2025-05-26 18:28:56 +08:00
世界
c416326cb1
Fail when default DNS server not found 2025-05-26 18:28:56 +08:00
世界
f269eb9db5
Update gVisor to 20250319.0 2025-05-26 18:28:56 +08:00
世界
76ffe82e89
Explicitly reject detour to empty direct outbounds 2025-05-26 18:28:56 +08:00
世界
2dc99d86be
Add netns support 2025-05-26 18:28:55 +08:00
世界
691c03ab0a
Add wildcard name support for predefined records 2025-05-26 18:28:55 +08:00
世界
d21800acf7
Remove map usage in options 2025-05-26 18:28:54 +08:00
世界
eeaedfeb9a
Fix unhandled DNS loop 2025-05-26 18:28:54 +08:00
世界
adf68261e7
Add wildcard-sni support for shadow-tls inbound 2025-05-26 18:28:54 +08:00
世界
6cc7b4466f
option: Fix marshal legacy DNS options 2025-05-26 18:26:29 +08:00
世界
4096b0b0e2
Make domain_resolver optional when only one DNS server is configured 2025-05-26 18:26:29 +08:00
世界
45024d08b1
Fix DNS lookup context pollution 2025-05-26 18:26:29 +08:00
世界
76c182e76d
Fix http3 DNS server connecting to wrong address 2025-05-26 18:26:28 +08:00
Restia-Ashbell
1be40e6cd1
documentation: Fix typo 2025-05-26 18:26:28 +08:00
anytls
020463ee09
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-05-26 18:26:27 +08:00
k9982874
95111d2e36
Fix hosts DNS server 2025-05-26 18:26:27 +08:00
世界
f2c95ba744
Fix UDP DNS server crash 2025-05-26 18:26:27 +08:00
世界
a2f4ea2850
documentation: Fix missing ip_accept_any DNS rule option 2025-05-26 18:26:26 +08:00
世界
524636c159
Fix anytls dialer usage 2025-05-26 18:26:26 +08:00
世界
b929e75e3a
Move predefined DNS server to rule action 2025-05-26 18:26:26 +08:00
世界
b5edc19f77
Fix domain resolver on direct outbound 2025-05-26 18:26:26 +08:00
Zephyruso
0cbaff46a3
Fix missing AnyTLS display name 2025-05-26 18:26:25 +08:00
anytls
86514a5f3e
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-05-26 18:26:25 +08:00
Estel
0b55fda8a3
documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-05-26 18:26:25 +08:00
TargetLocked
b5363a3a9f
Fix parsing legacy DNS options 2025-05-26 18:26:24 +08:00
世界
ae3c198a75
Fix DNS fallback 2025-05-26 18:26:24 +08:00
世界
2fbf415fac
documentation: Fix missing hosts DNS server 2025-05-26 18:26:24 +08:00
anytls
00d3807839
Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-05-26 18:26:23 +08:00
ReleTor
fdaa1d32d3
documentation: Minor fixes 2025-05-26 18:26:23 +08:00
libtry486
f8bbebb3f1
documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-05-26 18:26:23 +08:00
Alireza Ahmadi
448cdbcfda
Fix Outbound deadlock 2025-05-26 18:26:22 +08:00
世界
9299b990d2
documentation: Fix AnyTLS doc 2025-05-26 18:26:21 +08:00
anytls
4cb1b54c96
Add AnyTLS protocol 2025-05-26 18:26:21 +08:00
世界
04f026ad0b
Migrate to stdlib ECH support 2025-05-26 18:26:21 +08:00
世界
e6e1cec803
Add fallback local DNS server for iOS 2025-05-26 18:26:20 +08:00
世界
16ea554a65
Get darwin local DNS server from libresolv 2025-05-26 18:26:20 +08:00
世界
8617660fb1
Improve resolve action 2025-05-26 18:26:20 +08:00
世界
2ee29daa85
Add back port hopping to hysteria 1 2025-05-26 18:26:20 +08:00
xchacha20-poly1305
b0bc94f07c
Remove single quotes of raw Moziila certs 2025-05-26 18:26:20 +08:00
世界
587846b7f8
Add Tailscale endpoint 2025-05-26 18:25:58 +08:00
世界
0c20db66bf
Build legacy binaries with latest Go 2025-05-26 18:25:58 +08:00
世界
86c4563c4e
documentation: Remove outdated icons 2025-05-26 18:25:58 +08:00
世界
5939fafca3
documentation: Certificate store 2025-05-26 18:25:58 +08:00
世界
4687f6cf0b
documentation: TLS fragment 2025-05-26 18:25:58 +08:00
世界
f5dfacf32b
documentation: Outbound domain resolver 2025-05-26 18:25:57 +08:00
世界
3d18687f1a
documentation: Refactor DNS 2025-05-26 18:25:57 +08:00
世界
8dff9752d9
Add certificate store 2025-05-26 18:25:57 +08:00
世界
9dc93e97c5
Add TLS fragment support 2025-05-26 18:25:57 +08:00
世界
b93a07b6b8
refactor: Outbound domain resolver 2025-05-26 18:25:57 +08:00
世界
7c55973b99
refactor: DNS 2025-05-26 18:25:53 +08:00
世界
f62318f092
Fix none method read buffer 2025-05-26 18:24:35 +08:00
世界
50227c0f5f
Fix sniff action 2025-05-26 18:24:35 +08:00
11 changed files with 27 additions and 118 deletions

View File

@ -80,7 +80,7 @@ jobs:
- name: Set build tags
run: |
set -xeuo pipefail
TAGS='with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api'
TAGS='with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale'
echo "BUILD_TAGS=${TAGS}" >> "${GITHUB_ENV}"
- name: Build
run: |

View File

@ -105,7 +105,7 @@ func publishTestflight(ctx context.Context) error {
return err
}
tag := tagVersion.VersionString()
client := createClient(10 * time.Minute)
client := createClient(30 * time.Minute)
log.Info(tag, " list build IDs")
buildIDsResponse, _, err := client.TestFlight.ListBuildIDsForBetaGroup(ctx, groupID, nil)
@ -145,7 +145,7 @@ func publishTestflight(ctx context.Context) error {
return err
}
build := builds.Data[0]
if common.Contains(buildIDs, build.ID) || time.Since(build.Attributes.UploadedDate.Time) > 5*time.Minute {
if common.Contains(buildIDs, build.ID) || time.Since(build.Attributes.UploadedDate.Time) > 30*time.Minute {
log.Info(string(platform), " ", tag, " waiting for process")
time.Sleep(15 * time.Second)
continue

View File

@ -1,58 +0,0 @@
package sniff
import (
"context"
"encoding/binary"
"os"
"github.com/sagernet/sing-box/adapter"
C "github.com/sagernet/sing-box/constant"
)
func NTP(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error {
// NTP packets must be at least 48 bytes long (standard NTP header size).
pLen := len(packet)
if pLen < 48 {
return os.ErrInvalid
}
// Check the LI (Leap Indicator) and Version Number (VN) in the first byte.
// We'll primarily focus on ensuring the version is valid for NTP.
// Many NTP versions are used, but let's check for generally accepted ones (3 & 4 for IPv4, plus potential extensions/customizations)
firstByte := packet[0]
li := (firstByte >> 6) & 0x03 // Extract LI
vn := (firstByte >> 3) & 0x07 // Extract VN
mode := firstByte & 0x07 // Extract Mode
// Leap Indicator should be a valid value (0-3).
if li > 3 {
return os.ErrInvalid
}
// Version Check (common NTP versions are 3 and 4)
if vn != 3 && vn != 4 {
return os.ErrInvalid
}
// Check the Mode field for a client request (Mode 3). This validates it *is* a request.
if mode != 3 {
return os.ErrInvalid
}
// Check Root Delay and Root Dispersion. While not strictly *required* for a request,
// we can check if they appear to be reasonable values (not excessively large).
rootDelay := binary.BigEndian.Uint32(packet[4:8])
rootDispersion := binary.BigEndian.Uint32(packet[8:12])
// Check for unreasonably large root delay and dispersion. NTP RFC specifies max values of approximately 16 seconds.
// Convert to milliseconds for easy comparison. Each unit is 1/2^16 seconds.
if float64(rootDelay)/65536.0 > 16.0 {
return os.ErrInvalid
}
if float64(rootDispersion)/65536.0 > 16.0 {
return os.ErrInvalid
}
metadata.Protocol = C.ProtocolNTP
return nil
}

View File

@ -1,33 +0,0 @@
package sniff_test
import (
"context"
"encoding/hex"
"os"
"testing"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/sniff"
C "github.com/sagernet/sing-box/constant"
"github.com/stretchr/testify/require"
)
func TestSniffNTP(t *testing.T) {
t.Parallel()
packet, err := hex.DecodeString("1b0006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
require.NoError(t, err)
var metadata adapter.InboundContext
err = sniff.NTP(context.Background(), &metadata, packet)
require.NoError(t, err)
require.Equal(t, metadata.Protocol, C.ProtocolNTP)
}
func TestSniffNTPFailed(t *testing.T) {
t.Parallel()
packet, err := hex.DecodeString("400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
require.NoError(t, err)
var metadata adapter.InboundContext
err = sniff.NTP(context.Background(), &metadata, packet)
require.ErrorIs(t, err, os.ErrInvalid)
}

View File

@ -2,7 +2,7 @@
icon: material/alert-decagram
---
#### 1.12.0-beta.18
#### 1.12.0-beta.19
* Fixes and improvements

View File

@ -22,7 +22,6 @@ If enabled in the inbound, the protocol and domain name (if present) of by the c
| UDP | `dtls` | / | / |
| TCP | `ssh` | / | SSH Client Name |
| TCP | `rdp` | / | / |
| UDP | `ntp` | / | / |
| QUIC Client | Type |
|:------------------------:|:----------:|

View File

@ -22,7 +22,6 @@
| UDP | `dtls` | / | / |
| TCP | `ssh` | / | SSH 客户端名称 |
| TCP | `rdp` | / | / |
| UDP | `ntp` | / | / |
| QUIC 客户端 | 类型 |
|:------------------------:|:----------:|

2
go.mod
View File

@ -32,7 +32,7 @@ require (
github.com/sagernet/sing-mux v0.3.2
github.com/sagernet/sing-quic v0.5.0-beta.1
github.com/sagernet/sing-shadowsocks v0.2.7
github.com/sagernet/sing-shadowsocks2 v0.2.0
github.com/sagernet/sing-shadowsocks2 v0.2.1
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11
github.com/sagernet/sing-tun v0.6.6-0.20250428031943-0686f8c4f210
github.com/sagernet/sing-vmess v0.2.2-0.20250503051933-9b4cf17393f8

4
go.sum
View File

@ -176,8 +176,8 @@ github.com/sagernet/sing-quic v0.5.0-beta.1 h1:nC0i/s8LhlZB8ev6laZCXF/uiwAE4kRdT
github.com/sagernet/sing-quic v0.5.0-beta.1/go.mod h1:SAv/qdeDN+75msGG5U5ZIwG+3Ua50jVIKNrRSY8pkx0=
github.com/sagernet/sing-shadowsocks v0.2.7 h1:zaopR1tbHEw5Nk6FAkM05wCslV6ahVegEZaKMv9ipx8=
github.com/sagernet/sing-shadowsocks v0.2.7/go.mod h1:0rIKJZBR65Qi0zwdKezt4s57y/Tl1ofkaq6NlkzVuyE=
github.com/sagernet/sing-shadowsocks2 v0.2.0 h1:wpZNs6wKnR7mh1wV9OHwOyUr21VkS3wKFHi+8XwgADg=
github.com/sagernet/sing-shadowsocks2 v0.2.0/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ=
github.com/sagernet/sing-shadowsocks2 v0.2.1 h1:dWV9OXCeFPuYGHb6IRqlSptVnSzOelnqqs2gQ2/Qioo=
github.com/sagernet/sing-shadowsocks2 v0.2.1/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ=
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11 h1:tK+75l64tm9WvEFrYRE1t0YxoFdWQqw/h7Uhzj0vJ+w=
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11/go.mod h1:sWqKnGlMipCHaGsw1sTTlimyUpgzP4WP3pjhCsYt9oA=
github.com/sagernet/sing-tun v0.6.6-0.20250428031943-0686f8c4f210 h1:6H4BZaTqKI3YcDMyTV3E576LuJM4S4wY99xoq2T1ECw=

View File

@ -499,7 +499,9 @@ func (r *Router) actionSniff(
return
}
if inputConn != nil {
sniffBuffer := buf.NewPacket()
if len(action.StreamSniffers) == 0 && len(action.PacketSniffers) > 0 {
return
}
var streamSniffers []sniff.StreamSniffer
if len(action.StreamSniffers) > 0 {
streamSniffers = action.StreamSniffers
@ -513,6 +515,7 @@ func (r *Router) actionSniff(
sniff.RDP,
}
}
sniffBuffer := buf.NewPacket()
err := sniff.PeekStream(
ctx,
metadata,
@ -544,10 +547,25 @@ func (r *Router) actionSniff(
sniffBuffer.Release()
}
} else if inputPacketConn != nil {
if metadata.PacketSniffError != nil && !errors.Is(metadata.PacketSniffError, sniff.ErrNeedMoreData) {
if len(action.PacketSniffers) == 0 && len(action.StreamSniffers) > 0 {
return
} else if metadata.PacketSniffError != nil && !errors.Is(metadata.PacketSniffError, sniff.ErrNeedMoreData) {
r.logger.DebugContext(ctx, "packet sniff skipped due to previous error: ", metadata.PacketSniffError)
return
}
var packetSniffers []sniff.PacketSniffer
if len(action.PacketSniffers) > 0 {
packetSniffers = action.PacketSniffers
} else {
packetSniffers = []sniff.PacketSniffer{
sniff.DomainNameQuery,
sniff.QUICClientHello,
sniff.STUNMessage,
sniff.UTP,
sniff.UDPTracker,
sniff.DTLSRecord,
}
}
for {
var (
sniffBuffer = buf.NewPacket()
@ -587,20 +605,6 @@ func (r *Router) actionSniff(
sniff.QUICClientHello,
)
} else {
var packetSniffers []sniff.PacketSniffer
if len(action.PacketSniffers) > 0 {
packetSniffers = action.PacketSniffers
} else {
packetSniffers = []sniff.PacketSniffer{
sniff.DomainNameQuery,
sniff.QUICClientHello,
sniff.STUNMessage,
sniff.UTP,
sniff.UDPTracker,
sniff.DTLSRecord,
sniff.NTP,
}
}
err = sniff.PeekPacket(
ctx, metadata,
sniffBuffer.Bytes(),

View File

@ -379,8 +379,6 @@ func (r *RuleActionSniff) build() error {
r.StreamSniffers = append(r.StreamSniffers, sniff.SSH)
case C.ProtocolRDP:
r.StreamSniffers = append(r.StreamSniffers, sniff.RDP)
case C.ProtocolNTP:
r.PacketSniffers = append(r.PacketSniffers, sniff.NTP)
default:
return E.New("unknown sniffer: ", name)
}