mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5409] [MERGED] feat(hosts): managed Hosts for per-host subscription link overrides #5873
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#5873
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/5409
Author: @MHSanaei
Created: 6/17/2026
Status: ✅ Merged
Merged: 6/17/2026
Merged by: @MHSanaei
Base:
main← Head:feat/hosts📝 Commits (10+)
2d1e6f6test(sub): characterize current link output (externalProxy + single-link baselines)4c243efrefactor(sub): unify external-proxy link building behind ShareEndpoint (TDD, snapshot-locked)fcb4836feat(model): Host entity + automigrate + openapi codegen (TDD)d38ca25feat(api): Host CRUD service + controller + routes (TDD)420a3f1feat(sub): render subscription links from hosts; legacy fallback when none (TDD, mutation-checked)7e1db8efeat(migration): seed hosts from inbound externalProxy (TDD, idempotent, dual-driver)efc322cfeat(ui): Hosts page + schema + query hooks + link preview helper (TDD on schema/helpers)821d547refactor(ui): remove the External Proxy form from the inbound stream settings6f1046afix(ui): use Alerttitleinstead of deprecatedmessage(antd 6)5d6ba4dstyle(ui): align Hosts page with Clients/Inbounds cards + reorder columns📊 Changes
115 files changed (+6482 additions, -1045 deletions)
View changed files
📝
frontend/public/openapi.json(+945 -26)➕
frontend/src/api/queries/useHostMutations.ts(+60 -0)➕
frontend/src/api/queries/useHostsQuery.ts(+33 -0)📝
frontend/src/api/queryKeys.ts(+6 -0)➕
frontend/src/components/form/RemarkTemplateField.tsx(+71 -0)➕
frontend/src/components/form/RemarkVarPicker.tsx(+43 -0)📝
frontend/src/components/form/index.ts(+3 -0)📝
frontend/src/generated/examples.ts(+47 -6)📝
frontend/src/generated/schemas.ts(+181 -26)📝
frontend/src/generated/types.ts(+38 -6)📝
frontend/src/generated/zod.ts(+39 -6)📝
frontend/src/layouts/AppSidebar.tsx(+6 -3)➕
frontend/src/lib/hosts/host-link.ts(+50 -0)➕
frontend/src/lib/remark/remarkVariables.ts(+70 -0)➕
frontend/src/lib/xray/forms/transport/CustomSockoptList.tsx(+76 -0)📝
frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx(+1 -1)📝
frontend/src/lib/xray/inbound-link.ts(+13 -28)📝
frontend/src/lib/xray/link-label.tsx(+10 -23)📝
frontend/src/models/setting.ts(+1 -3)📝
frontend/src/pages/api-docs/endpoints.ts(+93 -0)...and 80 more files
📄 Description
Summary
Introduces a first-class Hosts feature: a dedicated way to define per-host subscription link overrides, replacing the old inline "External Proxy" form on the inbound stream settings.
A Host is a managed entity (model + automigrate + API + UI) that the subscription server uses to render share links. When no hosts exist for an inbound, the legacy externalProxy behavior is preserved as a fallback, and existing externalProxy entries are seeded into hosts on migration (idempotent, dual-driver).
What's included
Backend
Hostentity + automigrate + OpenAPI codegenexternalProxy(idempotent, SQLite + Postgres)ShareEndpointallowInsecure, mux params, sockopt + xhttp-extra params,serverDescription,mihomoX25519,vlessRouteIdFrontend
Testing
TDD throughout the backend (schema, helpers, migration, sub rendering, CRUD); subscription output locked with characterization snapshots and mutation checks.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.