[PR #5690] [CLOSED] feat(inbound): DisableFlow — opt an inbound out of auto XTLS Vision (#5689) #5962

Closed
opened 2026-11-02 04:05:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5690
Author: @FZ1010
Created: 6/30/2026
Status: ❌ Closed

Base: main ← Head: feat/inbound-disable-flow


📝 Commits (5)

  • 6f90191 feat(inbound): add DisableFlow to opt an inbound out of auto XTLS Vision
  • 605e8a9 feat(inbound): DisableFlow toggle in the inbound form (frontend)
  • a38a1bb fix(inbound): honor DisableFlow in all emitters + on toggle; regen OpenAPI
  • c3a07f6 fix(inbound): make DisableFlow durable, clamp on create, guard live config
  • e16acf4 style(inbound): drop // line comments per repo CLAUDE.md

📊 Changes

38 files changed (+415 additions, -10 deletions)

View changed files

📝 frontend/public/openapi.json (+6 -0)
📝 frontend/src/generated/examples.ts (+1 -0)
📝 frontend/src/generated/schemas.ts (+5 -0)
📝 frontend/src/generated/types.ts (+1 -0)
📝 frontend/src/generated/zod.ts (+1 -0)
📝 frontend/src/lib/xray/inbound-form-adapter.ts (+4 -0)
📝 frontend/src/models/dbinbound.ts (+3 -0)
📝 frontend/src/pages/inbounds/form/InboundFormModal.tsx (+13 -0)
📝 frontend/src/schemas/forms/inbound-form.ts (+1 -0)
📝 frontend/src/test/inbound-form-adapter.test.ts (+30 -0)
📝 internal/database/model/model.go (+2 -0)
📝 internal/sub/clash_service.go (+1 -1)
📝 internal/sub/clash_service_test.go (+25 -0)
📝 internal/sub/json_service.go (+1 -1)
📝 internal/sub/json_service_test.go (+10 -0)
📝 internal/sub/service.go (+2 -2)
📝 internal/sub/service_flow_test.go (+10 -0)
📝 internal/web/service/client_bulk.go (+2 -1)
📝 internal/web/service/client_crud.go (+1 -1)
📝 internal/web/service/inbound.go (+21 -4)

...and 18 more files

📄 Description

Implements approach (2) from #5689 — an inbound-level opt-out from automatic XTLS Vision (xtls-rprx-vision) injection.

Why

VLESS-over-XHTTP with vlessenc is (correctly) reported flow-capable, so a client on both a Reality inbound and a tunneled/CDN-fronted XHTTP+vlessenc inbound gets xtls-rprx-vision on both, with no way to opt the tunnel inbound out (single client-level flow; the panel clamps per its own capability). Some deployments specifically don't want Vision on the tunneled inbound. See #5689 for the full write-up.

What this does

Adds a panel-only DisableFlow flag to model.Inbound (disable_flow column, GORM AutoMigrate). When set, the inbound behaves as not-flow-capable without changing its transport/encryption:

  • GetInboundOptions reports tlsFlowCapable=false.
  • The write-path clamp (clientWithInboundFlow) stores an empty flow for clients attached to it (so client_inbounds.flow_override is "").
  • genVlessLink never emits flow= for it (sub/share links stay clean).
  • The client move/copy path, the post-edit Vision restore (restoreVisionFlowForEligibleInbound callers), the migration restore, and bulk flow-set all honor it.

The flag is never sent to xray (panel metadata only). The default (false) preserves all existing behavior — this is purely additive.

Verification

  • go build ./internal/... (affected packages) — clean.
  • go test ./internal/sub/... flow suite passes, including a new TestGenVlessLink_DisableFlowSuppressesFlow (a capable xhttp+reality+vlessenc inbound with DisableFlow=true emits no flow=), alongside the existing positive cases.
  • The DB-integration tests under internal/web/service weren't run in my local env (CGO_ENABLED=0, so go-sqlite3 can't init) — they'll run in CI.

Status — draft

  • Frontend toggle (React, frontend/src/pages/inbounds/…) — follow-up commit; the field is already settable via the inbound add/update API in the meantime.
  • Runtime verification on a live panel (I implemented from source; haven't run a built panel).

Marking draft pending the frontend toggle + a maintainer's nod on placement/naming (DisableFlow vs e.g. NoFlow). Happy to adjust to fit your conventions. Closes part of #5689.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5690 **Author:** [@FZ1010](https://github.com/FZ1010) **Created:** 6/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/inbound-disable-flow` --- ### 📝 Commits (5) - [`6f90191`](https://github.com/MHSanaei/3x-ui/commit/6f901915ada5bb6902dfd29b527a758607f9723e) feat(inbound): add DisableFlow to opt an inbound out of auto XTLS Vision - [`605e8a9`](https://github.com/MHSanaei/3x-ui/commit/605e8a9f5d4aacf81fe0ec1c4147f3a09e462713) feat(inbound): DisableFlow toggle in the inbound form (frontend) - [`a38a1bb`](https://github.com/MHSanaei/3x-ui/commit/a38a1bb02e9e59e18b4f16f11186f069a7927eb4) fix(inbound): honor DisableFlow in all emitters + on toggle; regen OpenAPI - [`c3a07f6`](https://github.com/MHSanaei/3x-ui/commit/c3a07f634f465b5dffac783ff1ee46fc7179bef7) fix(inbound): make DisableFlow durable, clamp on create, guard live config - [`e16acf4`](https://github.com/MHSanaei/3x-ui/commit/e16acf4dcabdc3c6a8c961e4f8cc14341238b8f6) style(inbound): drop // line comments per repo CLAUDE.md ### 📊 Changes **38 files changed** (+415 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `frontend/public/openapi.json` (+6 -0) 📝 `frontend/src/generated/examples.ts` (+1 -0) 📝 `frontend/src/generated/schemas.ts` (+5 -0) 📝 `frontend/src/generated/types.ts` (+1 -0) 📝 `frontend/src/generated/zod.ts` (+1 -0) 📝 `frontend/src/lib/xray/inbound-form-adapter.ts` (+4 -0) 📝 `frontend/src/models/dbinbound.ts` (+3 -0) 📝 `frontend/src/pages/inbounds/form/InboundFormModal.tsx` (+13 -0) 📝 `frontend/src/schemas/forms/inbound-form.ts` (+1 -0) 📝 `frontend/src/test/inbound-form-adapter.test.ts` (+30 -0) 📝 `internal/database/model/model.go` (+2 -0) 📝 `internal/sub/clash_service.go` (+1 -1) 📝 `internal/sub/clash_service_test.go` (+25 -0) 📝 `internal/sub/json_service.go` (+1 -1) 📝 `internal/sub/json_service_test.go` (+10 -0) 📝 `internal/sub/service.go` (+2 -2) 📝 `internal/sub/service_flow_test.go` (+10 -0) 📝 `internal/web/service/client_bulk.go` (+2 -1) 📝 `internal/web/service/client_crud.go` (+1 -1) 📝 `internal/web/service/inbound.go` (+21 -4) _...and 18 more files_ </details> ### 📄 Description Implements **approach (2)** from #5689 — an inbound-level opt-out from automatic XTLS Vision (`xtls-rprx-vision`) injection. ### Why VLESS-over-XHTTP with vlessenc is (correctly) reported flow-capable, so a client on both a Reality inbound and a tunneled/CDN-fronted XHTTP+vlessenc inbound gets `xtls-rprx-vision` on **both**, with no way to opt the tunnel inbound out (single client-level flow; the panel clamps per its own capability). Some deployments specifically don't want Vision on the tunneled inbound. See #5689 for the full write-up. ### What this does Adds a panel-only `DisableFlow` flag to `model.Inbound` (`disable_flow` column, GORM AutoMigrate). When set, the inbound behaves as not-flow-capable **without** changing its transport/encryption: - `GetInboundOptions` reports `tlsFlowCapable=false`. - The write-path clamp (`clientWithInboundFlow`) stores an empty flow for clients attached to it (so `client_inbounds.flow_override` is `""`). - `genVlessLink` never emits `flow=` for it (sub/share links stay clean). - The client move/copy path, the post-edit Vision restore (`restoreVisionFlowForEligibleInbound` callers), the migration restore, and bulk flow-set all honor it. The flag is never sent to xray (panel metadata only). The default (`false`) preserves all existing behavior — this is purely additive. ### Verification - `go build ./internal/...` (affected packages) — clean. - `go test ./internal/sub/...` flow suite passes, including a new `TestGenVlessLink_DisableFlowSuppressesFlow` (a capable xhttp+reality+vlessenc inbound with `DisableFlow=true` emits no `flow=`), alongside the existing positive cases. - The DB-integration tests under `internal/web/service` weren't run in my local env (`CGO_ENABLED=0`, so `go-sqlite3` can't init) — they'll run in CI. ### Status — draft - [ ] **Frontend toggle** (React, `frontend/src/pages/inbounds/…`) — follow-up commit; the field is already settable via the inbound add/update API in the meantime. - [ ] Runtime verification on a live panel (I implemented from source; haven't run a built panel). Marking draft pending the frontend toggle + a maintainer's nod on placement/naming (`DisableFlow` vs e.g. `NoFlow`). Happy to adjust to fit your conventions. Closes part of #5689. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:05:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5962
No description provided.