mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5227] [CLOSED] Add client outbound attachment support as external config #5825
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#5825
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/5227
Author: @saeedhasani
Created: 6/12/2026
Status: ❌ Closed
Base:
main← Head:main📝 Commits (5)
c9ac0e3feat: add client outbound attachment support as external config094ecd1Merge branch 'main' into mainbaccfc8Merge branch 'main' into main3d576eeMerge branch 'main' into main942a6b3fix(frontend): remove unused Option type📊 Changes
26 files changed (+1233 additions, -34 deletions)
View changed files
📝
frontend/public/openapi.json(+163 -1)📝
frontend/src/api/queryKeys.ts(+1 -0)📝
frontend/src/components/form/SelectAllClearButtons.tsx(+6 -10)📝
frontend/src/hooks/useClients.ts(+42 -1)📝
frontend/src/lib/xray/outbound-form-adapter.ts(+4 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+33 -3)📝
frontend/src/pages/clients/ClientFormModal.tsx(+80 -2)📝
frontend/src/pages/clients/ClientsPage.tsx(+19 -5)📝
frontend/src/pages/xray/outbounds/OutboundFormModal.tsx(+8 -0)📝
frontend/src/schemas/client.ts(+13 -0)📝
frontend/src/schemas/forms/outbound-form.ts(+1 -0)📝
internal/database/db.go(+1 -0)📝
internal/database/migrate_data.go(+1 -0)📝
internal/database/model/model.go(+8 -0)📝
internal/sub/json_service.go(+23 -1)➕
internal/sub/outbound_client.go(+366 -0)➕
internal/sub/outbound_client_test.go(+110 -0)📝
internal/sub/service.go(+19 -1)📝
internal/web/controller/client.go(+54 -1)📝
internal/web/service/client.go(+10 -7)...and 6 more files
📄 Description
Summary
This PR adds support for attaching selected outbound configurations to individual clients and exposing them through client subscriptions as external configurations.
A new "Attached Outbounds (External Config)" field has been added to the client create/edit form, supporting multi-select, select-all, and clear-all actions similar to attached inbounds.
Only outbounds explicitly marked with "Use as External Config" are available for client assignment and subscription generation.
Why
Many operators use 3x-ui alongside third-party or provider-managed nodes and would like to distribute those configurations through the same client subscription endpoint.
Before this change, subscriptions could only be generated from attached inbounds. There was no built-in way to include externally imported outbound configurations in a user's subscription feed.
This PR enables:
Implementation
Backend
Added a new
client_outboundsmodel/table for client-to-outbound associations.Added APIs:
GET /panel/api/clients/outboundOptionsPOST /panel/api/clients/:email/attachOutboundsPOST /panel/api/clients/:email/detachOutboundsExtended client create/edit flows to persist and hydrate outbound assignments.
Updated subscription generation to include attached external outbounds.
Updated JSON subscription generation to export selected outbounds as clean client-facing configurations.
Internal metadata fields are removed from generated subscription outputs.
Frontend
Subscription Output
Verification
Successfully verified with:
and
git diff --checkcompleted without issues.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.