mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5963
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5691
Author: @FZ1010
Created: 6/30/2026
Status: ❌ Closed
Base:
main← Head:feat/per-inbound-flow-override📝 Commits (4)
c57944cfeat(clients): writable per-(client,inbound) XTLS flow override87dfe06fix(clients): validate flow + register route; drop redundant flow_override write2a95c1efeat(clients): make per-inbound flow override durable via flowLockc5c9431feat(clients): add per-inbound flow override UI to the client info modal📊 Changes
14 files changed (+469 additions, -6 deletions)
View changed files
📝
frontend/public/openapi.json(+61 -0)📝
frontend/src/generated/examples.ts(+1 -0)📝
frontend/src/generated/schemas.ts(+3 -0)📝
frontend/src/generated/types.ts(+1 -0)📝
frontend/src/generated/zod.ts(+1 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+12 -0)📝
frontend/src/pages/inbounds/info/InboundInfoModal.tsx(+33 -3)📝
internal/database/model/model.go(+3 -2)📝
internal/web/controller/client.go(+25 -0)📝
internal/web/service/client_crud.go(+14 -1)➕
internal/web/service/client_flow_override.go(+52 -0)➕
internal/web/service/client_flow_override_durability_test.go(+224 -0)➕
internal/web/service/client_flow_override_test.go(+33 -0)📝
internal/web/service/inbound_flow_restore.go(+6 -0)📄 Description
Implements approach (1) from #5689 — a writable per-
(client, inbound)XTLS flow, so a client can keep Vision on some flow-capable inbounds and an empty flow on others in the same subscription.Why
A client delivered on both a Reality inbound (Vision wanted) and a tunneled XHTTP+vlessenc inbound (Vision not wanted) currently gets
xtls-rprx-visionon both — the single client-level flow is clamped per inbound by capability, but there's no way to clear it on one capable inbound while keeping it on another. See #5689.What this does
The relational per-membership store already exists (
client_inbounds.flow_override) and is resolved byEffectiveFlow/EffectiveFlowsByEmails. This PR makes it settable:ClientService.SetInboundClientFlow(inboundSvc, inboundId, email, flow)— sets the flow for one client on one inbound, bypassing theclientWithInboundFlowcapability clamp. It writes the inboundsettings.clients[].flow(what subscription generation reads) via the existingUpdateInboundClient, then mirrors the value ontoclient_inbounds.flow_override.POST …/clients/:email/flowwith body{ "inboundId": <id>, "flow": "xtls-rprx-vision" | "" }.clientWithFlow(returns a copy with the flow applied) so the core is unit-testable without a DB.Open question for maintainers (the one design decision)
An explicit empty flow set here can be re-populated by
restoreVisionFlowForEligibleInbound(#4792) if the inbound is later edited into a newly flow-eligible state, since that path treats an empty settings flow as "restore the intended Vision from a sibling". Making an explicit clear durable across such edits needs a small marker — e.g. a sentinelflow_overridevalue ("none") meaning explicitly off, or a per-membership lock flag. I left that out deliberately because it's a model/semantics choice that's yours to make; happy to implement whichever you prefer.Verification
go build ./internal/web/service/... ./internal/web/controller/...— clean.go test ./internal/web/service -run TestClientWithFlow— passes (covers the override-clears-on-one-inbound and missing-email cases).CGO_ENABLED=0) or boot a panel — so this is draft pending runtime verification.Status — draft
Alternative to #5690 (the inbound-level
DisableFlowtoggle) — both close part of #5689; pick whichever fits the design.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.