Commit graph

7 commits

Author SHA1 Message Date
Alireza Ahmadi
aa11bee31e Sing-Box v1.14.3 2026-10-13 19:31:40 +02:00
Alireza Ahmadi
cc01bbdeff Sing-Box v1.14.2 2026-10-07 23:22:29 +02:00
Alireza Ahmadi
62d337951f quic: close sessions with CONNECTION_CLOSE on restart, kick and removal #1271 #1278 2026-10-07 21:31:06 +02:00
Alireza Ahmadi
158a204b5f feat: live traffic 2026-09-16 00:53:43 +02:00
Alireza Ahmadi
afe16b4d2d Sing-Box v1.14.0-rc.2: compile-level upgrade
Re-sync core/protocol/* from upstream (they were verbatim copies), re-fork
core/box.go onto the new upstream box.go, and adapt to changed APIs:

- adapter.ConnectionTracker gained RoutedFlow; add no-op impls to both trackers
- log.ObservableFactory gained AttachPlatformWriter; add no-op impl
- box.Context now takes a CertificateProviderRegistry; wire one up with
  the origin_ca provider
- box.go now depends on debug*.go; copy them from upstream
- hysteria inbound moved QUIC option building into quic.go; copy it

Deps: sing v0.9.0-beta.4, sing-quic v0.7.0-beta.4, sing-tun v0.9.0-beta.2.

Runtime behaviour is not yet validated and config migration for options
deprecated in 1.14 is not done, so this is not ready for main.
2026-08-31 14:06:23 +02:00
LiGaAmG
bb4baebb13
fix(hysteria2): preserve user identity across hot updates (#1231)
* fix(hysteria2): use stable user identity on hot updates

Replace Service[int] (position-based) with Service[string] (name-based)
so that existing sessions retain a correct stable identity when the user
list changes via UpdateUsers. Remove the now-redundant userNameList field.

Fixes panic: runtime error: index out of range after user deletion,
and wrong username attribution when list positions shift.

* fix(hysteria2): gofmt struct field alignment after userNameList removal

* fix: extend stable user identity fix to hysteria, tuic, trojan, vless, vmess

The same Service[int] → Service[string] bug fixed for hysteria2 in the
previous commit affects all five remaining inbound protocols. When users
are deleted or reordered, integer position-based identity causes panics
(index out of range) and wrong username attribution in logs and traffic
stats.

Apply the same fix across hysteria v1, tuic, trojan, vless, and vmess:
- Service[int] → Service[string] in all five inbound structs
- Pass user.Name as the stable identity instead of the list index
- Remove the now-unnecessary cached `users []option.*User` fields from
  trojan, vless, and vmess structs (they existed solely to map indexes
  back to names)
- UpdateUsers helpers rebuilt to pass names, keeping auth/password
  fields unchanged

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ci: add go vet + gofmt check for patched protocols

* fix: gofmt struct field alignment in hysteria and tuic inbound

* fix: address review feedback on stable-identity PR

Three fixes from maintainer review:

1. Logging regression (trojan/vless/vmess): when a client has no name,
   the old code fell back to the index as a log label; the new code was
   emitting `[] inbound connection`. Align with the hysteria2 pattern:
   omit the `[name]` prefix entirely when name is empty.

2. Duplicate/empty client names: trojan's Service.UpdateUsers rejects a
   repeated identity, so two clients with the same name on the same
   inbound would make UpdateUsers fail. vmess silently overwrites the
   earlier entry. vless misattributes flow. Add server-side validation
   in ClientService.Save (new, edit, addbulk) that rejects empty names
   and names already in use on any shared inbound within the same tx.

3. Remove .github/workflows/check.yml: the workflow only triggered on
   the feature branch, so it would be permanently dead after merge.

* fix: make client name validation global and trim whitespace

* ci: temporarily re-add check workflow for CI verification

* ci: remove temporary check workflow

* validate client names on bulk save paths too

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Alireza Ahmadi <alireza7@gmail.com>
2026-08-31 13:57:48 +02:00
Alireza Ahmadi
2be943e5d8 fix user disconneciton on each change
Some checks failed
Release S-UI / build-frontend (push) Has been cancelled
Build S-UI for Windows / build-frontend (push) Has been cancelled
Release S-UI / build-386 (push) Has been cancelled
Release S-UI / build-amd64 (push) Has been cancelled
Release S-UI / build-armv5 (push) Has been cancelled
Release S-UI / build-armv6 (push) Has been cancelled
Release S-UI / build-armv7 (push) Has been cancelled
Release S-UI / build-arm64 (push) Has been cancelled
Release S-UI / build-s390x (push) Has been cancelled
Build S-UI for Windows / build-windows-amd64 (push) Has been cancelled
Build S-UI for Windows / build-windows-arm64 (push) Has been cancelled
Fixing quic based authentication problem causes users to be disconnected on each changes on inbound or users

#1136 #1085 and same
2026-07-10 22:22:35 +02:00