3x-ui/sub
MHSanaei ef066a19fc
feat(inbounds): one client identity across multiple inbounds via subId
Lets the operator add the same email under the same subId to several
inbounds. Xray reports traffic per email, so a single client_traffics
row acts as the shared accumulator — no aggregation overhead, quota and
expiry stay consistent.

- Email validation allows duplicates only when subId matches
- AddClientStat upserts via OnConflict DoNothing (idempotent on rerun)
- Stat/IP rows survive client deletion when a sibling inbound still
  references the email
- enrichClientStats tops up GORM-preloaded stats with rows whose
  inbound_id points at a sibling, so every panel view sees usage
- disableInvalidClients cascades enable=false and syncs the row's
  total/expiry into every sibling JSON when the shared identity expires
- DelDepletedClients removes the depleted client from all referencing
  inbounds, batched
- Subscription services dedupe traffic by email so shared quota is
  counted once

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 03:57:57 +02:00
..
default.json dokodemo-door, socks renamed to mixed, tunnel 2025-09-09 13:57:40 +02:00
sub.go feat(frontend): migrate subpage.html to Vue 3 SPA 2026-05-08 19:44:50 +02:00
subClashService.go feat(inbounds): one client identity across multiple inbounds via subId 2026-05-09 03:57:57 +02:00
subController.go revert(frontend): keep entry HTML files at frontend/ root 2026-05-09 02:36:26 +02:00
subJsonService.go feat(inbounds): one client identity across multiple inbounds via subId 2026-05-09 03:57:57 +02:00
subService.go feat(inbounds): one client identity across multiple inbounds via subId 2026-05-09 03:57:57 +02:00