Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
418 commits
Select commit Hold shift + click to select a range
f462ce5
Update tfo-go
nekohasekai Aug 19, 2025
52fa5f2
Make realityConnWrapper replaceable
wwqgtxx Aug 19, 2025
83f02d0
Make utlsConnWrapper replaceable
wwqgtxx Aug 19, 2025
f4ed684
Update cast using in sing-vmess
wwqgtxx Aug 19, 2025
f1dd0db
Make ReadWaitConn reader replaceable
nekohasekai Aug 20, 2025
ee02532
Fix tlsfragment fallback writeAndWaitAck
dyhkwong Aug 19, 2025
97f0dc8
Bump version
nekohasekai Aug 17, 2025
1468d83
Make realityClientConnWrapper replaceable
nekohasekai Aug 20, 2025
22782ca
Fix outbound start
nekohasekai Aug 21, 2025
b40f642
Bump version
nekohasekai Aug 21, 2025
031f25c
Deprecate common/atomic
nekohasekai Aug 25, 2025
963bc4b
Enforce Tailscale NoLogsNoSupport
nekohasekai Aug 28, 2025
980e962
Bump version
nekohasekai Aug 28, 2025
649163c
Fix domain strategy not taking effect
nekohasekai Sep 2, 2025
30c069f
Fix local DNS server on legacy windows
nekohasekai Sep 2, 2025
2edfed7
Improve DHCP DNS server
nekohasekai Sep 2, 2025
6849288
Fix typo in TestSniffUQUICChrome115
nekohasekai Sep 2, 2025
1a18e43
Fix linux icmp routes
nekohasekai Sep 2, 2025
0ef7e8e
Fix `route.default_interface` not taking effect
nekohasekai Sep 2, 2025
cbf48e9
Fix multiple sniff
nekohasekai Sep 2, 2025
f352f84
Fix read address
nekohasekai Sep 5, 2025
cc30413
Fix DNS cache
nekohasekai Sep 5, 2025
2594745
Fix DNS client
nekohasekai Sep 5, 2025
b14ceca
Fix DNS packet size
nekohasekai Sep 5, 2025
f98a3a4
Treat requests with OPT extra but no options as simple requests
nekohasekai Sep 5, 2025
79c0b9f
Fix tls options ignored in mixed inbounds
nekohasekai Sep 8, 2025
f16468e
Fix ipv6 tproxy listener
nekohasekai Sep 9, 2025
8a200bf
Fix auto redirect output
nekohasekai Sep 9, 2025
c5f2cea
Prevent panic when wintun dll fails to load
nekohasekai Sep 9, 2025
36babe4
Fix hysteria2 handshake timeout
nekohasekai Sep 9, 2025
c331ee3
Fix timeout check
nekohasekai Sep 10, 2025
59ee7be
Fix SyscallVectorisedPacketWriter
nekohasekai Sep 10, 2025
1af83e9
Update Go to 1.25.1
nekohasekai Sep 8, 2025
fcde0c9
Bump version
nekohasekai Sep 10, 2025
e42b818
Fix dhcp fetch
nekohasekai Sep 11, 2025
de13137
Fix auto redirect
nekohasekai Sep 12, 2025
e81a76f
Fix DNS exchange
nekohasekai Sep 12, 2025
1463834
Fix race codes
nekohasekai Sep 12, 2025
5d1d1a1
Fix TCP exchange for local/dhcp DNS servers
nekohasekai Sep 12, 2025
07697bf
release: Fix xcode build
nekohasekai Sep 12, 2025
0977c5c
release: Disable Apple platform CI builds, since ``-allowProvisioning…
nekohasekai Sep 12, 2025
44559fb
Bump version
nekohasekai Sep 12, 2025
1955002
Do not cache DNS responses with empty answers
nekohasekai Sep 12, 2025
ae852e0
Bump version
nekohasekai Sep 12, 2025
510bf05
Fix UDP exchange for local/dhcp DNS servers
nekohasekai Sep 13, 2025
573c617
Bump version
nekohasekai Sep 13, 2025
714a68b
Update .gitignore
nekohasekai Sep 18, 2025
140735d
Fix websocket log handling
nekohasekai Sep 23, 2025
4bca951
Fix adguard matcher
nekohasekai Sep 23, 2025
a031aaf
Do not reset network on sleep or wake
nekohasekai Sep 23, 2025
d9d7f78
Pin gofumpt and golangci-lint versions
nekohasekai Sep 23, 2025
cb7dba3
release: Improve publish testflight
nekohasekai Sep 10, 2025
2159d88
Update anytls v0.0.11
anytls Sep 30, 2025
ced2e39
Update dependencies
nekohasekai Oct 1, 2025
9362d3c
Attempt to fix leak in quic-go
nekohasekai Oct 1, 2025
886be64
Fix dns truncate
Mahdi-zarei Oct 3, 2025
328a6de
Bump version
nekohasekai Oct 1, 2025
0f767d5
Update .gitignore
nekohasekai Oct 7, 2025
41b30c9
Improve HTTPS DNS transport
nekohasekai Oct 7, 2025
6557bd7
Fix dns cache in lookup
Mahdi-zarei Oct 9, 2025
36dc883
Fix DNS negative caching to comply with RFC 2308
nekohasekai Oct 9, 2025
ef14c8c
Disable TCP slow open for anytls
nekohasekai Oct 10, 2025
0679147
Fix DNS reject panic
nekohasekai Oct 10, 2025
17b4d1e
Update uTLS to v1.8.1
nekohasekai Oct 14, 2025
d0e1fd6
Update Go to 1.25.3
nekohasekai Oct 9, 2025
444f454
Bump version
nekohasekai Oct 14, 2025
0e50edc
documentation: Add appreciate for Warp
nekohasekai Oct 16, 2025
5658830
Fix trailing dot handling in local DNS transport
nekohasekai Oct 16, 2025
5de6f4a
Fix tailscale not enforcing NoLogsNoSupport
nekohasekai Oct 16, 2025
541f63f
redirect: Fix compatibility with `/product/bin/su`
nekohasekai Oct 21, 2025
5a40b67
Update dependencies
nekohasekai Oct 21, 2025
4626aa2
Bump version
nekohasekai Oct 21, 2025
a38030c
Fix memory leak in hysteria2
nekohasekai Oct 24, 2025
b1bdc18
Fix socks response
nekohasekai Oct 27, 2025
54ed584
Bump version
nekohasekai Oct 27, 2025
63c8207
Use `--no-cache` `--upgrade` option in `apk add`
Dreista Oct 30, 2025
5841d41
ssm-api: Fix save cache
nekohasekai Nov 4, 2025
216c4c8
Fix adapter handler
nekohasekai Nov 16, 2025
6421252
release: Fix windows7 build
nekohasekai Nov 16, 2025
48e7603
Update Go to 1.25.4
nekohasekai Nov 16, 2025
2747a00
Fix tailscale destination
nekohasekai Dec 1, 2025
670f32b
Fix naive inbound
nekohasekai Dec 12, 2025
e385a98
Update Go to 1.25.5
nekohasekai Dec 13, 2025
f0cd342
Bump version
nekohasekai Nov 16, 2025
1ebff74
Fix DNS cache not working when domain strategy is set
nekohasekai Dec 21, 2025
68448de
Fix missing RootPoolFromContext and TimeFuncFromContext in HTTP clients
nekohasekai Dec 22, 2025
223dd8b
Fix TCP DNS response buffer
nekohasekai Dec 22, 2025
24a1e7c
Ignore darwin IP_DONTFRAG error when not supported
nekohasekai Dec 25, 2025
86fabd6
Update Mozilla certificates
nekohasekai Dec 25, 2025
f56d9ab
Bump version
nekohasekai Dec 25, 2025
d78828f
Fix quic sniffer
nekohasekai Jan 1, 2026
568612f
Fix duplicate tag detection for empty tags
nekohasekai Jan 1, 2026
84bbdc2
Revert "Pin gofumpt and golangci-lint versions"
nekohasekai Dec 30, 2025
f511ebc
Fix lint errors
nekohasekai Jan 2, 2026
7fa7d4f
ducumentation: update Shadowsocks inbound documentation for SSM API
HMBSbige Jan 1, 2026
6fdf27a
Fix Tailscale endpoint using wrong source IP with advertise_routes
nekohasekai Jan 4, 2026
fffe9fc
Fix reset buffer in dhcp response loop
everyx Jan 5, 2026
0a812f2
Bump version
nekohasekai Jan 7, 2026
e69c202
Fix logic issues with BBR impl
nekohasekai Jan 12, 2026
ab18010
Bump version
nekohasekai Jan 12, 2026
29d56fc
Update smux to v1.5.50 & Fix h2mux RST_STREAM on half-close
nekohasekai Jan 16, 2026
3ce94d5
Update uTLS to v1.8.2
nekohasekai Jan 16, 2026
8b404b5
Update Go to 1.25.6
nekohasekai Jan 16, 2026
51ce402
Bump version
nekohasekai Jan 16, 2026
737162e
Add `/dns/flush-clash` meta api
Zephyruso Aug 11, 2025
1f03080
Add support for ech retry configs
neletor Aug 11, 2025
fecdbf2
Fix ECH retry support
nekohasekai Oct 7, 2025
65264af
Add interface address rule items
nekohasekai Aug 14, 2025
5be1887
documentation: Add interface address rule items
nekohasekai Aug 14, 2025
239e6ec
Add `preferred_by` route rule item
nekohasekai Aug 15, 2025
87eaf3c
documentation: Add `preferred_by` route rule item
nekohasekai Aug 15, 2025
0bd98a3
Fix rule set version
xchacha20-poly1305 Aug 15, 2025
1c846df
Use resolved in local DNS server if available
nekohasekai Aug 15, 2025
48f84b3
Improve `local` DNS server on darwin
nekohasekai Aug 18, 2025
bba9214
Stop using DHCP on iOS and tvOS
nekohasekai Aug 19, 2025
e3473d3
documentation: Improve `local` DNS server
nekohasekai Aug 18, 2025
1336987
documentation: Remove outdated icons
nekohasekai Aug 18, 2025
2be8a45
Fix rule-set format
nekohasekai Aug 18, 2025
044eb72
Fix legacy DNS config
nekohasekai Aug 18, 2025
387b42c
Remove use of ldflags `-checklinkname=0` on darwin
nekohasekai Aug 19, 2025
a5e09fc
documentation: Update behavior of `local` DNS server on darwin
nekohasekai Aug 19, 2025
44fafce
Fix resolve using resolved
nekohasekai Aug 26, 2025
f84129c
Add proxy support for ICMP echo request
nekohasekai Feb 17, 2025
107f923
Add support for kTLS
nekohasekai Sep 7, 2025
9110851
ktls: Add warning for inappropriate scenarios
nekohasekai Sep 8, 2025
e9c46cc
Improve compatibility for kTLS
nekohasekai Sep 9, 2025
60d81a7
Improve ktls rx error handling
nekohasekai Sep 9, 2025
c530995
release: Fix linux build
nekohasekai Sep 10, 2025
49056b5
Fix ping domain
nekohasekai Sep 11, 2025
12b0559
Fix preConnectionCopy
nekohasekai Sep 14, 2025
7f3ea8d
Update WireGuard and Tailscale
nekohasekai Sep 15, 2025
ed1ee4c
Update quic-go to v0.55.0
nekohasekai Sep 15, 2025
6b90b61
documentation: Update chinese translations
nekohasekai Sep 17, 2025
cb4deb0
Do not use linkname by default to simplify debugging
nekohasekai Sep 17, 2025
9ac0539
Remove compatibility codes
nekohasekai Sep 17, 2025
ab0869c
Update tfo-go to latest
nekohasekai Sep 17, 2025
dfd95b2
Fix WireGuard input packet
nekohasekai Sep 17, 2025
79bbce3
Add curve preferences, pinned public key SHA256 and mTLS for TLS options
nekohasekai Sep 17, 2025
3dc285b
Fix missing mTLS support in client options
nekohasekai Oct 9, 2025
fce2160
Use a more conservative strategy for resolving with systemd-resolved …
nekohasekai Oct 16, 2025
d87c9fd
Fix compatibility with MPTCP
nekohasekai Oct 17, 2025
0f5cda4
Add claude code multiplexer service
nekohasekai Oct 21, 2025
1c46143
Fix read credentials for ccm service
nekohasekai Oct 21, 2025
e929383
Update quic-go to v0.57.1
nekohasekai Dec 3, 2025
cd56eaa
Add more tcp keep alive options
nekohasekai Dec 6, 2025
8d8ca28
Add Linux WI-FI state support
nekohasekai Dec 7, 2025
743b460
Add Windows WI-FI state support
nekohasekai Dec 7, 2025
5bc0dfa
platform: Refactoring libbox to use gRPC-based protocol
nekohasekai Oct 7, 2025
a930356
Revert "Stop using DHCP on iOS and tvOS"
nekohasekai Oct 13, 2025
a5fb467
daemon: Add clear logs
nekohasekai Oct 22, 2025
ac427b9
platform: Add UsePlatformWIFIMonitor to gRPC interface
nekohasekai Dec 7, 2025
7e68013
Apply ping destination filter for Windows
nekohasekai Dec 13, 2025
ad7b982
Add naiveproxy outbound
nekohasekai Dec 12, 2025
9b0960b
Fix bugs and add UoT option for naiveproxy outbound
nekohasekai Dec 15, 2025
b919039
release: Upload only other apks
nekohasekai Dec 15, 2025
a89680f
Update pricing for CCM service
nekohasekai Dec 16, 2025
e862058
Add OpenAI Codex Multiplexer service
nekohasekai Dec 16, 2025
8101a7b
Fix naiveproxy build
nekohasekai Dec 16, 2025
0585f6d
Add ECH support for NaiveProxy outbound and tls.ech.query_server_name…
nekohasekai Dec 17, 2025
48b7add
Add QUIC support for naiveproxy
nekohasekai Dec 18, 2025
750dc9c
Fix naive network
nekohasekai Dec 18, 2025
4afdf41
platform: Use new crash log api
nekohasekai Dec 18, 2025
143983b
Remove certificate_public_key_sha256 for naive
nekohasekai Dec 19, 2025
2fc1b67
documentation: Minor fixes
nekohasekai Dec 19, 2025
faff317
Add trace logging for lifecycle calls
nekohasekai Dec 20, 2025
0d8c7a9
Fix cronet-go crash
nekohasekai Dec 20, 2025
cba1863
Add Chrome Root Store certificate option
nekohasekai Dec 21, 2025
35ff7d1
Update quic-go to v0.58.0
nekohasekai Dec 21, 2025
ddec2ab
Update dependencies
nekohasekai Dec 21, 2025
c2b697a
Fix missing build constraints for linux wifi state monitor
nekohasekai Dec 21, 2025
203f413
documentation: Add Wi-Fi state shared page
nekohasekai Dec 21, 2025
e0a78fd
documentation: Minor fixes
nekohasekai Dec 21, 2025
b2d90b7
Fix missing RootPoolFromContext and TimeFuncFromContext in HTTP clients
nekohasekai Dec 22, 2025
f5ccf74
platform: Split library for Android SDK 21 and 23
nekohasekai Dec 22, 2025
4273ffa
Update cronet-go to v143.0.7499.109-1
nekohasekai Dec 25, 2025
511d1bb
Update tailscale to v1.92.4
nekohasekai Dec 25, 2025
e392c70
Ignore darwin IP_DONTFRAG error when not supported
nekohasekai Dec 25, 2025
a348684
Fix cronet on iOS
nekohasekai Dec 26, 2025
78b4eac
Add pre-match support for auto redirect
nekohasekai Dec 26, 2025
bf4a9ed
Fix panic when closing Box before Start with file log output
nekohasekai Dec 26, 2025
8ae16aa
Add format_docs command for documentation trailing space formatting
nekohasekai Dec 26, 2025
24b33a4
documentation: Format changes header
nekohasekai Dec 26, 2025
95ccb83
platform: Add GetStartedAt for StartedService
nekohasekai Dec 27, 2025
494990f
Update bypass action behavior for auto redirect
nekohasekai Dec 27, 2025
4e94a64
platform: Expose process info
nekohasekai Dec 27, 2025
aa8dd6e
Fix DNS transports
nekohasekai Dec 29, 2025
46c2cc3
cronet: Fix windows DNS hijack
nekohasekai Dec 30, 2025
6a750f4
Fix missing relay support for Tailscale
nekohasekai Dec 30, 2025
85f5f6c
Disable multipath TCP by default via GODEBUG
nekohasekai Dec 30, 2025
1d4fb83
Fix nfqueue fallback
nekohasekai Dec 30, 2025
157e33f
Add kmod-nft-queue dependency for openwrt package
nekohasekai Dec 31, 2025
708ceb3
Fix openwrt builds
nekohasekai Dec 31, 2025
a5db2fe
Fix linux musl builds
nekohasekai Jan 1, 2026
7d2944e
Downgrade quic-go to v0.57.1
nekohasekai Jan 2, 2026
0caebd3
platform: Improve interface
nekohasekai Jan 3, 2026
0e0e838
platform: Update apple build comamnds
nekohasekai Jan 5, 2026
bd9935e
platform: Fix gomobile build
nekohasekai Jan 6, 2026
f196b7a
tailscale: Add system interface support
nekohasekai Jan 7, 2026
6cd1eb9
Fix tailscale endpoint
nekohasekai Jan 8, 2026
3890bd2
platform: Display k based bytes
nekohasekai Jan 8, 2026
8d88c65
Add dial option `bind_address_no_port`
nekohasekai Jan 9, 2026
e0f1cdf
platform: Uniq network interfaces
nekohasekai Jan 11, 2026
e6c03fd
Update quic-go to v0.59.0
nekohasekai Jan 12, 2026
ccf90ae
release: Improve publish_testflight
nekohasekai Jan 12, 2026
30c3855
Fix logic issues with BBR impl
nekohasekai Jan 12, 2026
e8450b2
platform: Refactor CommandClient & Connections
nekohasekai Jan 14, 2026
8ec58c9
Fix naive outbound on iOS
nekohasekai Jan 16, 2026
4a14d39
release: Log build ID during TestFlight publishing
nekohasekai Jan 17, 2026
725e4ad
release: Update android command
nekohasekai Jan 16, 2026
490d501
Fix trafficontrol Manager
nekohasekai Jan 17, 2026
b9cc87d
Skip strict routing in Windows versions below Windows 10
nekohasekai Jan 17, 2026
5d67c13
documentation: Bump version
nekohasekai Dec 15, 2025
60a1e4c
Add acmedns support
balthild Jan 17, 2026
944a998
release: Always build tailscale for iOS and tvOS
nekohasekai Jan 28, 2026
1af14a0
Remove varbin usages
nekohasekai Jan 28, 2026
a4d5d59
Minor fixes
nekohasekai Jan 28, 2026
79bab39
Fix auto_redirect fallback rule
nekohasekai Jan 29, 2026
ff58edb
Bump version
nekohasekai Jan 28, 2026
8dd8897
Fix varbin serialization
nekohasekai Feb 1, 2026
432fe1b
Disable rp filter atomically
nekohasekai Feb 1, 2026
c1dc6cb
Bump version
nekohasekai Feb 1, 2026
a05e05a
Fix random iproute2 table index was incorrectly removed
nekohasekai Feb 2, 2026
55b6e7d
socks: Fix missing UDP timeout
nekohasekai Feb 2, 2026
baa9f29
documentation: Update release changelog
nekohasekai Feb 2, 2026
e11dbf3
bufio: Refactor copy
nekohasekai Feb 2, 2026
d230dae
Fix vmess crash
nekohasekai Feb 5, 2026
15722b0
Update Go to 1.25.7
nekohasekai Feb 5, 2026
a2d313c
Bump version
nekohasekai Feb 5, 2026
c45ea8d
Recover from bbolt panics on corrupted database
nekohasekai Feb 6, 2026
d8e269e
socks: Fix "Fix missing UDP timeout"
nekohasekai Feb 6, 2026
aba8346
Fix DNS cache lock goroutine leak
nekohasekai Feb 6, 2026
172a9d5
Standardize gomobile usages
nekohasekai Feb 7, 2026
98af3c0
experimental: New FFI
nekohasekai Feb 9, 2026
58fcdce
Fix naive padding
nekohasekai Feb 9, 2026
ceab244
tuic: Fix udp context
nekohasekai Feb 9, 2026
58ccf82
Bump version
nekohasekai Feb 9, 2026
0a69621
wireguard: Fix missing fallback for gso
nekohasekai Feb 12, 2026
657fba4
Fix matching rule-set invert
nekohasekai Feb 13, 2026
8714c15
Fix matching multi predefined
nekohasekai Feb 15, 2026
1f2fdec
release: Fix update_apple_version command
nekohasekai Feb 15, 2026
53f2db3
platform: Add windows build
nekohasekai Feb 12, 2026
8046060
Bump version
nekohasekai Feb 15, 2026
de4fdbe
platform: Add semver helper
nekohasekai Feb 16, 2026
d1f1271
quic-go: Minor fixes
nekohasekai Feb 16, 2026
c0304b8
Bump version
nekohasekai Feb 16, 2026
c599914
Minor fixes for naive
nekohasekai Feb 17, 2026
aa85cbb
Treat H3 RequestCanceled as closed
nekohasekai Feb 20, 2026
b580084
More linux builds for naive
nekohasekai Feb 21, 2026
6a95c66
Pin Go version to 1.25.7
nekohasekai Feb 21, 2026
9bcd715
Bump version
nekohasekai Feb 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .fpm_openwrt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
--depends kmod-inet-diag
--depends kmod-tun
--depends firewall4
--depends kmod-nft-queue

--before-remove release/config/openwrt.prerm

Expand Down
4 changes: 4 additions & 0 deletions .fpm_systemd
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
--deb-field "Bug: https://github.com/SagerNet/sing-box/issues"
--no-deb-generate-changes
--config-files /etc/sing-box/config.json
--after-install release/config/sing-box.postinst

release/config/config.json=/etc/sing-box/config.json

release/config/sing-box.service=/usr/lib/systemd/system/sing-box.service
release/config/sing-box@.service=/usr/lib/systemd/system/sing-box@.service
release/config/sing-box.sysusers=/usr/lib/sysusers.d/sing-box.conf
release/config/sing-box.rules=usr/share/polkit-1/rules.d/sing-box.rules
release/config/sing-box-split-dns.xml=/usr/share/dbus-1/system.d/sing-box-split-dns.conf

release/completions/sing-box.bash=/usr/share/bash-completion/completions/sing-box.bash
release/completions/sing-box.fish=/usr/share/fish/vendor_completions.d/sing-box.fish
Expand Down
1 change: 1 addition & 0 deletions .github/CRONET_GO_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abd78bb191a815236485ad929716845ffb41465a
27 changes: 27 additions & 0 deletions .github/setup_go_for_windows7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

VERSION="1.25.7"

mkdir -p $HOME/go
cd $HOME/go
wget "https://dl.google.com/go/go${VERSION}.linux-amd64.tar.gz"
tar -xzf "go${VERSION}.linux-amd64.tar.gz"
mv go go_win7
cd go_win7

# modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557
# this patch file only works on golang1.25.x
# that means after golang1.26 release it must be changed
# see: https://github.com/MetaCubeX/go/commits/release-branch.go1.25/
# revert:
# 693def151adff1af707d82d28f55dba81ceb08e1: "crypto/rand,runtime: switch RtlGenRandom for ProcessPrng"
# 7c1157f9544922e96945196b47b95664b1e39108: "net: remove sysSocket fallback for Windows 7"
# 48042aa09c2f878c4faa576948b07fe625c4707a: "syscall: remove Windows 7 console handle workaround"
# a17d959debdb04cd550016a3501dd09d50cd62e7: "runtime: always use LoadLibraryEx to load system libraries"

alias curl='curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"'

curl https://github.com/MetaCubeX/go/commit/8cb5472d94c34b88733a81091bd328e70ee565a4.diff | patch --verbose -p 1
curl https://github.com/MetaCubeX/go/commit/6788c4c6f9fafb56729bad6b660f7ee2272d699f.diff | patch --verbose -p 1
curl https://github.com/MetaCubeX/go/commit/a5b2168bb836ed9d6601c626f95e56c07923f906.diff | patch --verbose -p 1
curl https://github.com/MetaCubeX/go/commit/f56f1e23507e646c85243a71bde7b9629b2f970c.diff | patch --verbose -p 1
13 changes: 13 additions & 0 deletions .github/update_cronet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e -o pipefail

SCRIPT_DIR=$(dirname "$0")
PROJECTS=$SCRIPT_DIR/../..

git -C $PROJECTS/cronet-go fetch origin main
git -C $PROJECTS/cronet-go fetch origin go
go get -x github.com/sagernet/cronet-go/all@$(git -C $PROJECTS/cronet-go rev-parse origin/go)
go get -x github.com/sagernet/cronet-go@$(git -C $PROJECTS/cronet-go rev-parse origin/go)
go mod tidy
git -C $PROJECTS/cronet-go rev-parse origin/go > "$SCRIPT_DIR/CRONET_GO_VERSION"
13 changes: 13 additions & 0 deletions .github/update_cronet_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e -o pipefail

SCRIPT_DIR=$(dirname "$0")
PROJECTS=$SCRIPT_DIR/../..

git -C $PROJECTS/cronet-go fetch origin dev
git -C $PROJECTS/cronet-go fetch origin go_dev
go get -x github.com/sagernet/cronet-go/all@$(git -C $PROJECTS/cronet-go rev-parse origin/go_dev)
go get -x github.com/sagernet/cronet-go@$(git -C $PROJECTS/cronet-go rev-parse origin/go_dev)
go mod tidy
git -C $PROJECTS/cronet-go rev-parse origin/dev > "$SCRIPT_DIR/CRONET_GO_VERSION"
444 changes: 379 additions & 65 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

167 changes: 161 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Publish Docker Images

on:
#push:
# branches:
# - main-next
# - dev-next
release:
types:
- published
Expand All @@ -13,8 +17,146 @@ env:
REGISTRY_IMAGE: ghcr.io/sagernet/sing-box

jobs:
build:
build_binary:
name: Build binary
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
# Naive-enabled builds (musl)
- { arch: amd64, naive: true, docker_platform: "linux/amd64" }
- { arch: arm64, naive: true, docker_platform: "linux/arm64" }
- { arch: "386", naive: true, docker_platform: "linux/386" }
- { arch: arm, goarm: "7", naive: true, docker_platform: "linux/arm/v7" }
- { arch: mipsle, gomips: softfloat, naive: true, docker_platform: "linux/mipsle" }
- { arch: riscv64, naive: true, docker_platform: "linux/riscv64" }
- { arch: loong64, naive: true, docker_platform: "linux/loong64" }
# Non-naive builds
- { arch: arm, goarm: "6", docker_platform: "linux/arm/v6" }
- { arch: ppc64le, docker_platform: "linux/ppc64le" }
- { arch: s390x, docker_platform: "linux/s390x" }
steps:
- name: Get commit to build
id: ref
run: |-
if [[ -z "${{ github.event.inputs.tag }}" ]]; then
ref="${{ github.ref_name }}"
else
ref="${{ github.event.inputs.tag }}"
fi
echo "ref=$ref"
echo "ref=$ref" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
ref: ${{ steps.ref.outputs.ref }}
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ~1.25.7
- name: Clone cronet-go
if: matrix.naive
run: |
set -xeuo pipefail
CRONET_GO_VERSION=$(cat .github/CRONET_GO_VERSION)
git init ~/cronet-go
git -C ~/cronet-go remote add origin https://github.com/sagernet/cronet-go.git
git -C ~/cronet-go fetch --depth=1 origin "$CRONET_GO_VERSION"
git -C ~/cronet-go checkout FETCH_HEAD
git -C ~/cronet-go submodule update --init --recursive --depth=1
- name: Regenerate Debian keyring
if: matrix.naive
run: |
set -xeuo pipefail
rm -f ~/cronet-go/naiveproxy/src/build/linux/sysroot_scripts/keyring.gpg
cd ~/cronet-go
GPG_TTY=/dev/null ./naiveproxy/src/build/linux/sysroot_scripts/generate_keyring.sh
- name: Cache Chromium toolchain
if: matrix.naive
id: cache-chromium-toolchain
uses: actions/cache@v4
with:
path: |
~/cronet-go/naiveproxy/src/third_party/llvm-build/
~/cronet-go/naiveproxy/src/gn/out/
~/cronet-go/naiveproxy/src/chrome/build/pgo_profiles/
~/cronet-go/naiveproxy/src/out/sysroot-build/
key: chromium-toolchain-${{ matrix.arch }}-musl-${{ hashFiles('.github/CRONET_GO_VERSION') }}
- name: Download Chromium toolchain
if: matrix.naive
run: |
set -xeuo pipefail
cd ~/cronet-go
go run ./cmd/build-naive --target=linux/${{ matrix.arch }} --libc=musl download-toolchain
- name: Set version
run: |
set -xeuo pipefail
VERSION=$(go run ./cmd/internal/read_tag)
echo "VERSION=${VERSION}" >> "${GITHUB_ENV}"
- name: Set Chromium toolchain environment
if: matrix.naive
run: |
set -xeuo pipefail
cd ~/cronet-go
go run ./cmd/build-naive --target=linux/${{ matrix.arch }} --libc=musl env >> $GITHUB_ENV
- name: Set build tags
run: |
set -xeuo pipefail
TAGS='with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale,with_ccm,with_ocm,badlinkname,tfogo_checklinkname0'
if [[ "${{ matrix.naive }}" == "true" ]]; then
TAGS="${TAGS},with_naive_outbound,with_musl"
fi
echo "BUILD_TAGS=${TAGS}" >> "${GITHUB_ENV}"
- name: Build (naive)
if: matrix.naive
run: |
set -xeuo pipefail
go build -v -trimpath -o sing-box -tags "${BUILD_TAGS}" \
-ldflags "-X \"github.com/sagernet/sing-box/constant.Version=${VERSION}\" -X 'internal/godebug.defaultGODEBUG=multipathtcp=0' -s -w -buildid= -checklinkname=0" \
./cmd/sing-box
env:
CGO_ENABLED: "1"
GOOS: linux
GOARCH: ${{ matrix.arch }}
GOARM: ${{ matrix.goarm }}
GOMIPS: ${{ matrix.gomips }}
- name: Build (non-naive)
if: ${{ ! matrix.naive }}
run: |
set -xeuo pipefail
go build -v -trimpath -o sing-box -tags "${BUILD_TAGS}" \
-ldflags "-X \"github.com/sagernet/sing-box/constant.Version=${VERSION}\" -X 'internal/godebug.defaultGODEBUG=multipathtcp=0' -s -w -buildid= -checklinkname=0" \
./cmd/sing-box
env:
CGO_ENABLED: "0"
GOOS: linux
GOARCH: ${{ matrix.arch }}
GOARM: ${{ matrix.goarm }}
- name: Prepare artifact
run: |
platform=${{ matrix.docker_platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
# Rename binary to include arch info for Dockerfile.binary
BINARY_NAME="sing-box-${{ matrix.arch }}"
if [[ -n "${{ matrix.goarm }}" ]]; then
BINARY_NAME="${BINARY_NAME}v${{ matrix.goarm }}"
fi
mv sing-box "${BINARY_NAME}"
echo "BINARY_NAME=${BINARY_NAME}" >> $GITHUB_ENV
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: binary-${{ env.PLATFORM_PAIR }}
path: ${{ env.BINARY_NAME }}
if-no-files-found: error
retention-days: 1
build_docker:
name: Build Docker image
runs-on: ubuntu-latest
needs:
- build_binary
strategy:
fail-fast: true
matrix:
Expand All @@ -24,9 +166,11 @@ jobs:
- linux/arm/v7
- linux/arm64
- linux/386
- linux/mipsle
- linux/ppc64le
- linux/riscv64
- linux/s390x
- linux/loong64
steps:
- name: Get commit to build
id: ref
Expand All @@ -39,14 +183,24 @@ jobs:
echo "ref=$ref"
echo "ref=$ref" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
ref: ${{ steps.ref.outputs.ref }}
fetch-depth: 0
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Download binary
uses: actions/download-artifact@v5
with:
name: binary-${{ env.PLATFORM_PAIR }}
path: .
- name: Prepare binary
run: |
# Find and make the binary executable
chmod +x sing-box-*
ls -la sing-box-*
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
Expand All @@ -68,8 +222,7 @@ jobs:
with:
platforms: ${{ matrix.platform }}
context: .
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
file: Dockerfile.binary
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
Expand All @@ -87,7 +240,7 @@ jobs:
merge:
runs-on: ubuntu-latest
needs:
- build
- build_docker
steps:
- name: Get commit to build
id: ref
Expand All @@ -107,7 +260,7 @@ jobs:
echo "latest=$latest"
echo "latest=$latest" >> $GITHUB_OUTPUT
- name: Download digests
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
path: /tmp/digests
pattern: digests-*
Expand All @@ -121,13 +274,15 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
if: github.event_name != 'push'
working-directory: /tmp/digests
run: |
docker buildx imagetools create \
-t "${{ env.REGISTRY_IMAGE }}:${{ steps.ref.outputs.latest }}" \
-t "${{ env.REGISTRY_IMAGE }}:${{ steps.ref.outputs.ref }}" \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
if: github.event_name != 'push'
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.ref.outputs.latest }}
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.ref.outputs.ref }}
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ^1.24
go-version: ^1.25
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --timeout=30m
Expand Down
Loading