720 Commits
Author SHA1 Message Date
omar 1482fdf543 feat(stats): persistent log store migrates from sqlite to bbolt
modernc.org/sqlite is the only pure-Go SQLite and costs ~3.5 MB in the
static shaterd link; the stats store never used anything SQL-specific —
it is a ring of two append-only streams with a monotonic seq cursor.
bbolt is already linked via experimental/cachefile, so the swap is free.

sqlitering.go -> boltring.go: buckets queries/conns keyed by 8-byte
big-endian seq (bbolt key order == cursor order), rows as JSON of the
existing LogEntry/ConnLogEntry structs, meta bucket carries the durable
per-stream HWM (same max-only monotonic semantics). The async writer
contract is untouched (writeCh 4096, drop counters, 256-row/500ms
batches, 30s retention tick). Disk cap: chunked oldest-first deletes
with the same hysteresis, then at most one bbolt Compact per pass
(sagernet/bbolt exports Compact) behind the same 110%+1MiB free-space
guard that gated VACUUM. A legacy SQLite-format stats.db (or any
unreadable file) is replaced in place with one warning; open failure
still falls back to the in-memory ring.

Zero user-visible change: the "sqlite" backend selector value and the
Snapshot.Backend string are kept verbatim. Tests ported assert-for-
assert plus new coverage: legacy-file replacement, overflow drops,
memRing parity round-trip, disk-cap convergence.

Router shaterd (linux/amd64): 28,004,478 -> 24,428,670 bytes (-3.58 MB);
modernc.org/* gone from go.mod/go.sum and the dep graph.
2026-07-23 10:57:03 +03:00
omarandClaude Opus 4.8 e84166ab8a feat(daemon+panel): SQLite persistent stats backend (Phase 3)
The stats log rings move behind a logRing seam: memRing (extracted RAM ring,
byte-identical to before) + sqliteRing (new, modernc.org/sqlite v1.38.2 pure-Go,
CGO-free musl-static). backend=sqlite persists the query/conn LOG rows to
/etc/shater/stats.db (WAL, tmpfs fallback /tmp/shater-stats.db, own lock) via an
async batched writer off the DNS/conn hot path; seq = the PK (monotonic, resumes
from the persisted max after restart). Cursor reads = WHERE seq</> ? ORDER BY
seq DESC LIMIT. Retention: keep <= StatsRingSize rows/table + a StatsDiskLimitMB
disk cap (0=unlimited) with prune + wal_checkpoint/VACUUM. Aggregates
(top-domains/timeline/hosts/devices/node-health) stay in RAM (bounded, rebuild
fast) — only the unbounded LOGS persist. Open failure → warn + memRing fallback.
Globals.StatsDiskLimitMB (0=unlimited, intOptAlways round-trip); Settings shows
it when backend=sqlite. Size: +1.2MB UPX (10.5->11.7MB), static/musl OK.

Verified: build (router tags)/vet 0, go test + -race ok (sqliteRing cursor
parity, retention, disk-cap, PERSIST-across-reopen, async no-loss, memory
regression); panel tsc/build clean. VM: backend=sqlite → /etc/shater/stats.db
created, 75 conns logged, **survive daemon restart** (75 rows intact, seq
resumes 76->79), disk cap set 16MB. box.New applies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LLthkP2S8WAfxu7fcYbPfE
2026-07-18 19:47:38 +03:00
Leadaxe 9dc758e43c Merge upstream/testing (L3-forwarding, snell, bridge) into lx-1.14
Merges 14 upstream commits including L3-forwarding support (which bumped
wireguard-go v0.0.3->v0.0.5, already re-grafted in the prior commit),
snell protocol, bridge outbound, flow-tracking/sniff improvements, and
DNS/dialer fixes.

lx conflict resolutions:
- protocol/wireguard/endpoint.go: took upstream's new flow API
  (PreMatchFlow/PortAddresses/PortMTU/AttachReturn/DetachReturn/JudgeFlow),
  dropped our old PrepareConnection/NewDirectRouteConnection. SPEC 020
  idle-suspend wake guard (resumeOnDial) moved to WritePackets — the single
  point every L3-forwarded packet transits, incl. established flows that
  bypass DialContext.
- adapter/outbound.go: kept lx IdleSuspendable/ReachabilityInvalidator,
  restored 'time' import dropped by auto-merge.
- go.mod/go.sum + test/: took upstream dependency bumps (tailscale, sing,
  sing-tun); wireguard-go stays v0.0.5 with local submodule replace.

Green: full sing-box CLI with LX_TAGS (Go 1.24.7), libbox, wireguard/
adapter/dns/daemon packages, transport+protocol/wireguard tests, AWG
config validation.
2026-07-08 15:10:38 +03:00
世界 c9690acdf1 Add windows bridge 2026-07-08 18:22:36 +08:00
世界 9ec7cc8cbe Improve bridge 2026-07-08 16:30:06 +08:00
世界 c7fe778cae Add bridge outbound 2026-07-08 00:34:26 +08:00
世界 f2dd4bfd75 Imrpove flow tracking & sniff action 2026-07-07 18:37:18 +08:00
世界 e6419b945f Add L3 forwarding support 2026-07-06 21:13:33 +08:00
世界 5af56d2cfd Add snell protocol 2026-07-05 12:47:42 +08:00
世界 2c2828cedc Fix cloudflared crash 2026-07-04 14:53:18 +08:00
世界 0a11d45471 tls: Fix read wait buffer sizing 2026-07-04 14:53:03 +08:00
Leadaxe b545cc2717 Merge upstream/testing: udpnat2 buffer fix + apple version script
Trivial upstream sync (2 commits): "Fix udpnat2 buffer size" (go.mod/go.sum bump)
and "release: Fix update apple version script". No lx zones touched (no submodule /
pb.go / box.go / route / adapter changes).
2026-07-01 17:52:50 +03:00
世界 b3c1634d08 Fix udpnat2 buffer size 2026-07-01 19:30:49 +08:00
Leadaxe 6dc83fc109 Merge upstream/testing (bump version, fix linux ping) into lx-1.14 2026-06-30 01:57:50 +03:00
世界 3d734792ca Fix linux ping 2026-06-29 11:43:26 +08:00
Leadaxe 08d1fecd5f Merge upstream/testing (dhcp dns, age report, go mod) into lx-1.14 2026-06-28 17:51:17 +03:00
世界 53e87a7ea5 Add age support for report export 2026-06-28 14:17:41 +08:00
Leadaxe 7804bf9d85 Merge remote-tracking branch 'upstream/testing' into lx-1.14
# Conflicts:
#	box.go
#	cmd/internal/build_libbox/main.go
#	common/certificate/store.go
#	common/trafficcontrol/tracker.go
#	daemon/managed_service.pb.go
#	daemon/managed_service_grpc.pb.go
#	daemon/started_service.pb.go
#	daemon/started_service.proto
#	daemon/started_service_grpc.pb.go
#	docs/changelog.md
#	go.mod
#	go.sum
#	service/oomkiller/service.go
#	service/oomkiller/service_darwin.go
2026-06-26 14:27:59 +03:00
世界 9ac1399094 Add USB/IP support for macOS 2026-06-25 17:39:07 +08:00
世界 36e92fc7a9 Add USB/IP service 2026-06-25 17:39:02 +08:00
世界 f18b01b7fe tailscale: Add tailssh server 2026-06-25 17:38:51 +08:00
世界 d0ef5c028d hysteria2: Add gecko obfs 2026-06-25 17:38:51 +08:00
世界 eb4cef4eab Fix tailscale 2026-06-25 17:38:27 +08:00
世界 eacfa36ff6 realm: Open separate v4 and v6 packet conns on client 2026-06-25 17:38:26 +08:00
世界 ab08bac1d1 gvisor: Fix dialing to self addresses 2026-06-25 17:38:26 +08:00
世界 5d0b87d9bf tailscale: Fix handle peer DNS query 2026-06-25 17:38:26 +08:00
世界 9815feae0a Fix shadowtls handshake 2026-06-25 17:38:24 +08:00
世界 2a6837dd1a Rebase wireguard-go to official 2026-06-25 17:38:13 +08:00
世界 41a2c8cc50 realm: Add stun retry and lazy server start 2026-06-25 17:38:12 +08:00
世界 d8f461cc5a Update hysteria2 realm 2026-06-25 17:38:12 +08:00
世界 094808a4fa Add hysteria2 realm service and support 2026-06-25 17:38:11 +08:00
世界 fb1ddc1702 Fix ACME HTTP-01 challenge for IPv6 literal addresses 2026-06-25 17:38:05 +08:00
世界 cfe83a5dcc Refactor: HTTP clients, unified HTTP2/QUIC options, Apple engines 2026-06-25 17:37:59 +08:00
世界 fd7bc21175 Add cloudflared inbound 2026-06-25 17:37:08 +08:00
世界 f96582c5d1 Add BBR profile and hop interval randomization for Hysteria2 2026-06-25 17:35:24 +08:00
世界 6dd01016da Add MAC and hostname rule items 2026-06-25 17:33:05 +08:00
世界 ef2a012301 Fix http proxy authentication 2026-06-25 16:13:35 +08:00
世界 cf60f76562 Fix Cloudflared edge discovery ignoring configured resolver 2026-06-21 00:13:11 +08:00
世界 38786cf640 Add USB/IP support for macOS 2026-06-20 22:25:00 +08:00
世界 0c7707ca9e Add USB/IP service 2026-06-20 22:24:55 +08:00
世界 8ba1057c10 tailscale: Add tailssh server 2026-06-20 22:23:45 +08:00
世界 940fb6d8c7 hysteria2: Add gecko obfs 2026-06-20 22:23:44 +08:00
世界 7ac2cac7ae sing: Fix comment loop 2026-06-20 22:23:32 +08:00
世界 4559faaaa4 Fix tailscale 2026-06-20 22:23:31 +08:00
世界 6acb02c0fd realm: Open separate v4 and v6 packet conns on client 2026-06-20 22:23:31 +08:00
世界 a2894ffb31 gvisor: Fix dialing to self addresses 2026-06-20 22:23:19 +08:00
世界 67c7243a92 tailscale: Fix handle peer DNS query 2026-06-20 22:23:19 +08:00
世界 2ede989dff Fix shadowtls handshake 2026-06-20 22:23:10 +08:00
世界 3bb9fe630e Rebase wireguard-go to official 2026-06-20 22:23:02 +08:00
世界 22cae36fc6 realm: Add stun retry and lazy server start 2026-06-20 22:23:01 +08:00