[PR #5037] [MERGED] feat: add support for subscription-based outbounds with auto-update #5756

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5037
Author: @rqzbeh
Created: 6/7/2026
Status: ✅ Merged
Merged: 6/8/2026
Merged by: @MHSanaei

Base: main ← Head: main


📝 Commits (10+)

  • 900c080 feat: add support for subscription-based outbounds with auto-update
  • 9f8a186 Merge pull request #1 from rqzbeh/feat/outbound-subscriptions
  • cbb0653 Merge branch 'main' into main
  • 37d2cb7 Merge branch 'main' into main
  • f9dbf1f fix: resolve frontend lint/type errors and Go build break
  • 5c7c72a fix(xray): make outbound subscription creation work end-to-end
  • 602162e feat(xray): show traffic/test for subscription outbounds; harden + test the feature
  • 837286c fix(xray): make outbound-subs feature pass CI (test compile, route docs, openapi)
  • ddbb1be feat(xray): per-subscription allow-private, gap-filled tags, UI tweaks, delete refresh
  • b3d97c6 i18n(xray): translate outbound-subscription UI into all locales

📊 Changes

37 files changed (+3612 additions, -50 deletions)

View changed files

📝 CONTRIBUTING.md (+1 -1)
📝 database/db.go (+1 -0)
📝 database/migrate_data.go (+15 -3)
📝 database/model/model.go (+22 -0)
📝 frontend/public/openapi.json (+291 -0)
📝 frontend/src/hooks/useXraySetting.ts (+62 -30)
📝 frontend/src/layouts/AppSidebar.tsx (+6 -3)
📝 frontend/src/pages/api-docs/endpoints.ts (+68 -0)
📝 frontend/src/pages/xray/XrayPage.tsx (+15 -0)
📝 frontend/src/pages/xray/balancers/BalancersTab.tsx (+6 -1)
📝 frontend/src/pages/xray/outbounds/OutboundsTab.css (+14 -0)
📝 frontend/src/pages/xray/outbounds/OutboundsTab.tsx (+421 -5)
➕ frontend/src/pages/xray/outbounds/SubscriptionOutbounds.tsx (+207 -0)
📝 frontend/src/pages/xray/outbounds/outbounds-tab-helpers.ts (+2 -2)
📝 frontend/src/pages/xray/routing/RoutingTab.tsx (+6 -1)
📝 frontend/src/schemas/xray.ts (+5 -0)
➕ util/link/outbound.go (+809 -0)
➕ util/link/outbound_test.go (+62 -0)
📝 web/controller/xray_setting.go (+173 -4)
➕ web/job/outbound_subscription_job.go (+48 -0)

...and 17 more files

📄 Description

  • New OutboundSubscription model (full support on both SQLite and PostgreSQL)
  • Go subscription link parser (vmess/vless/trojan/ss/hysteria2/wireguard) matching frontend behavior
  • Stable tag assignment across refreshes (designed for balancer + routing use)
  • Runtime merge of subscription outbounds into Xray config (additive only)
  • Full CRUD + manual refresh + preview API
  • Background auto-update job (per-subscription interval)
  • Frontend management UI in Outbounds tab (Subscriptions drawer) + tag integration in balancers/routing rules
  • Proper dual-database support including CLI migration path

Review & hardening notes:

  • Fixed merge logic bug that could drop manual outbounds
  • Added SSRF/private-IP protection on subscription URLs using SanitizePublicHTTPURL
  • Improved update interval UX (hours + minutes)
  • Auto-fetch on first subscription creation
  • Added detailed comments on tag stability strategy and balancer implications when servers are added/removed/rotated
  • Updated migrationModels() for CLI migrate-db support

🔄 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/5037 **Author:** [@rqzbeh](https://github.com/rqzbeh) **Created:** 6/7/2026 **Status:** ✅ Merged **Merged:** 6/8/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`900c080`](https://github.com/MHSanaei/3x-ui/commit/900c08042b89eed95a5b4bf9af25dfac39e7a2d6) feat: add support for subscription-based outbounds with auto-update - [`9f8a186`](https://github.com/MHSanaei/3x-ui/commit/9f8a186cd4acdfc6989171faea5076e6983ac250) Merge pull request #1 from rqzbeh/feat/outbound-subscriptions - [`cbb0653`](https://github.com/MHSanaei/3x-ui/commit/cbb0653eeebd9f2810096249f49fd33a2a08a103) Merge branch 'main' into main - [`37d2cb7`](https://github.com/MHSanaei/3x-ui/commit/37d2cb786c2ff59c4d8a43609f965eed1cb582f9) Merge branch 'main' into main - [`f9dbf1f`](https://github.com/MHSanaei/3x-ui/commit/f9dbf1f1e0257a4d45a5112fd604b8641a490c92) fix: resolve frontend lint/type errors and Go build break - [`5c7c72a`](https://github.com/MHSanaei/3x-ui/commit/5c7c72a3e3c22cacb9054bb9c3d07c5d1498609a) fix(xray): make outbound subscription creation work end-to-end - [`602162e`](https://github.com/MHSanaei/3x-ui/commit/602162e7eca576828bd622b78de27787adfa8284) feat(xray): show traffic/test for subscription outbounds; harden + test the feature - [`837286c`](https://github.com/MHSanaei/3x-ui/commit/837286cb51933f1425f6d56c9843f91565fc6070) fix(xray): make outbound-subs feature pass CI (test compile, route docs, openapi) - [`ddbb1be`](https://github.com/MHSanaei/3x-ui/commit/ddbb1befe5caa5fe990f44aab01202436a99318e) feat(xray): per-subscription allow-private, gap-filled tags, UI tweaks, delete refresh - [`b3d97c6`](https://github.com/MHSanaei/3x-ui/commit/b3d97c6f036799eed0032160ec46dbdccd1173d3) i18n(xray): translate outbound-subscription UI into all locales ### 📊 Changes **37 files changed** (+3612 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTING.md` (+1 -1) 📝 `database/db.go` (+1 -0) 📝 `database/migrate_data.go` (+15 -3) 📝 `database/model/model.go` (+22 -0) 📝 `frontend/public/openapi.json` (+291 -0) 📝 `frontend/src/hooks/useXraySetting.ts` (+62 -30) 📝 `frontend/src/layouts/AppSidebar.tsx` (+6 -3) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+68 -0) 📝 `frontend/src/pages/xray/XrayPage.tsx` (+15 -0) 📝 `frontend/src/pages/xray/balancers/BalancersTab.tsx` (+6 -1) 📝 `frontend/src/pages/xray/outbounds/OutboundsTab.css` (+14 -0) 📝 `frontend/src/pages/xray/outbounds/OutboundsTab.tsx` (+421 -5) ➕ `frontend/src/pages/xray/outbounds/SubscriptionOutbounds.tsx` (+207 -0) 📝 `frontend/src/pages/xray/outbounds/outbounds-tab-helpers.ts` (+2 -2) 📝 `frontend/src/pages/xray/routing/RoutingTab.tsx` (+6 -1) 📝 `frontend/src/schemas/xray.ts` (+5 -0) ➕ `util/link/outbound.go` (+809 -0) ➕ `util/link/outbound_test.go` (+62 -0) 📝 `web/controller/xray_setting.go` (+173 -4) ➕ `web/job/outbound_subscription_job.go` (+48 -0) _...and 17 more files_ </details> ### 📄 Description - New OutboundSubscription model (full support on both SQLite and PostgreSQL) - Go subscription link parser (vmess/vless/trojan/ss/hysteria2/wireguard) matching frontend behavior - Stable tag assignment across refreshes (designed for balancer + routing use) - Runtime merge of subscription outbounds into Xray config (additive only) - Full CRUD + manual refresh + preview API - Background auto-update job (per-subscription interval) - Frontend management UI in Outbounds tab (Subscriptions drawer) + tag integration in balancers/routing rules - Proper dual-database support including CLI migration path Review & hardening notes: - Fixed merge logic bug that could drop manual outbounds - Added SSRF/private-IP protection on subscription URLs using SanitizePublicHTTPURL - Improved update interval UX (hours + minutes) - Auto-fetch on first subscription creation - Added detailed comments on tag stability strategy and balancer implications when servers are added/removed/rotated - Updated migrationModels() for CLI migrate-db support --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:03:52 +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#5756
No description provided.