3x-ui/internal/sub
MHSanaei 9c8cd08f90
Some checks are pending
CI / go-test (push) Waiting to run
CI / codegen (push) Waiting to run
CI / govulncheck (push) Waiting to run
CI / race (push) Waiting to run
CI / fuzz-smoke (push) Waiting to run
CI / golangci (push) Waiting to run
CI / frontend (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Release 3X-UI / build (386) (push) Waiting to run
Release 3X-UI / build (amd64) (push) Waiting to run
Release 3X-UI / build (arm64) (push) Waiting to run
Release 3X-UI / build (armv5) (push) Waiting to run
Release 3X-UI / build (armv6) (push) Waiting to run
Release 3X-UI / build (armv7) (push) Waiting to run
Release 3X-UI / build (s390x) (push) Waiting to run
Release 3X-UI / Build for Windows (push) Waiting to run
Release 3X-UI / Publish rolling dev release (push) Blocked by required conditions
feat(wireguard): multi-client support
WireGuard inbounds now manage per-client peers using xray-core's native WireGuard users (AddUser/RemoveUser). Each client lives in settings.clients (canonical, like every other protocol) and is projected to peers[] only when emitting the xray config, at level 0 so the dispatcher's per-user traffic/online counters work with no extra plumbing.

Backend: internal/util/wireguard gains KeyToHex (base64 to hex for the gRPC path), PublicKeyFromPrivate and GenerateWireguardPSK; xray/api.go builds a wireguard account in AddUser with hex keys (RemoveUser already worked); client CRUD generates a keypair and allocates a unique tunnel address per client and never rotates keys on edit; an idempotent migration converts legacy settings.peers into managed clients; WireGuard is included in the raw subscription.

Frontend: WireGuard in the add-client modal with keys on the credential tab, client schema, per-client QR/link/.conf, inbound form reduced to server settings; i18n added across 13 locales.

Fix: guard the settings[clients] assertion in add/update so a legacy WireGuard inbound stored without a clients key no longer panics.
2026-06-28 00:44:38 +02:00
..
build_urls_test.go fix: resolve a batch of open bug-tagged issues (traffic accounting, share strategy, sub address, CPU) (#5477) 2026-06-22 00:22:28 +02:00
characterization_test.go fix(sub): restore client email in panel copy/QR link remark (#5532) 2026-06-24 15:25:41 +02:00
clash_external.go refactor(frontend): move form-item hints from extra to tooltip 2026-06-17 17:24:16 +02:00
clash_service.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
clash_service_test.go feat(xhttp): support sessionID* rename + sessionIDTable/Length (xray v26.6.22) (#5506) 2026-06-23 17:38:16 +02:00
controller.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
controller_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
default.json refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
dist.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
endpoint.go feat(sub): add dynamic remark variables with Jalali date, transport, and status tokens (#5430) 2026-06-21 02:00:27 +02:00
endpoint_test.go fix(sub): restore client email in panel copy/QR link remark (#5532) 2026-06-24 15:25:41 +02:00
export_all_links_test.go feat(inbounds): apply remark template to Export all inbound links 2026-06-27 11:22:45 +02:00
external_config.go feat(sub): per-client external links and remote subscriptions 2026-06-14 20:57:14 +02:00
external_config_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
external_only_sub_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
external_subscription.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
external_subscription_test.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
host_sub.go feat(tls,reality): port xray TLS/REALITY fields, cert-hash helpers, fallback UX 2026-06-21 15:58:42 +02:00
host_sub_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
json_service.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
json_service_test.go fix(sub): preserve non-default scMinPostsIntervalMs and use per-inbound xmux in JSON subscriptions (#5393) 2026-06-20 00:57:47 +02:00
links.go feat(inbounds): apply remark template to Export all inbound links 2026-06-27 11:22:45 +02:00
links_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
mutation_audit_test.go fix(sub): preserve non-default scMinPostsIntervalMs and use per-inbound xmux in JSON subscriptions (#5393) 2026-06-20 00:57:47 +02:00
page_data_test.go fix(sub): drive display remarks from the template and split multi-host subpage links 2026-06-24 16:45:23 +02:00
remark_vars.go fix(sub): show {{EMAIL}} on first sub-body link only 2026-06-27 12:42:12 +02:00
remark_vars_test.go test(sub): align identity-token test with first-link-only EMAIL 2026-06-27 13:56:45 +02:00
service.go feat(wireguard): multi-client support 2026-06-28 00:44:38 +02:00
service_dedup_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
service_flow_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
service_orphaned_stats_test.go chore: bump deps and modernize test loops 2026-06-26 00:10:30 +02:00
service_property_test.go fix(nodes): stop multi-attached client traffic inflating across node inbounds 2026-06-15 19:31:57 +02:00
service_sharelink_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
service_sort_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
service_test.go feat(sub): add dynamic remark variables with Jalali date, transport, and status tokens (#5430) 2026-06-21 02:00:27 +02:00
service_userinfo_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
service_wireguard_test.go feat(wireguard): multi-client support 2026-06-28 00:44:38 +02:00
sub.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00