[PR #6650] [MERGED] feat(sub): add Incy app-management parameters #6398

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6650
Author: @DIMFLIX
Created: 9/25/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @MHSanaei

Base: main ← Head: feat/incy-app-params


📝 Commits (3)

  • 767d49d feat(sub): add Incy app-management parameters
  • 819be19 Merge origin/main into pr/6650
  • fb8175a fix(sub): keep Incy per-app list entries separate on the wire

📊 Changes

30 files changed (+2994 additions, -37 deletions)

View changed files

📝 docs/public/openapi.json (+226 -0)
📝 frontend/public/openapi.json (+226 -0)
📝 frontend/src/generated/examples.ts (+56 -0)
📝 frontend/src/generated/schemas.ts (+226 -0)
📝 frontend/src/generated/types.ts (+56 -0)
📝 frontend/src/generated/zod.ts (+56 -0)
📝 frontend/src/models/setting.ts (+29 -0)
➕ frontend/src/pages/settings/IncySettingsContent.tsx (+488 -0)
📝 frontend/src/pages/settings/SubscriptionGeneralTab.tsx (+7 -24)
📝 frontend/src/schemas/setting.ts (+28 -0)
➕ frontend/src/test/incy-settings-content.test.tsx (+84 -0)
📝 internal/sub/controller.go (+8 -0)
➕ internal/sub/incy.go (+180 -0)
➕ internal/sub/incy_test.go (+208 -0)
📝 internal/sub/sub.go (+31 -0)
📝 internal/web/entity/entity.go (+31 -0)
📝 internal/web/service/setting.go (+144 -0)
📝 internal/web/translation/ar-EG.json (+70 -1)
📝 internal/web/translation/en-US.json (+70 -1)
📝 internal/web/translation/es-ES.json (+70 -1)

...and 10 more files

📄 Description

The panel already pushes a set of Happ headers, but INCY documents its own lowercase header names and its own value domains, so a Happ-shaped payload gets ignored by the client (per-app mode is bypass|proxy, not on|bypass, and per-app-proxy-enable has no Happ counterpart at all). Add a sibling Incy path that emits exactly the documented headers.

Covered, per https://docs.incy.cc/en/app-management/:

  • profile-description, sort-order, support-email, announce-url, premium-url
  • banner text/button/URL and the two hex colours
  • hide-url, hide-check, no-limit-enabled
  • per-app split tunnelling (enable/mode/list)
  • TCP fragmentation (enable/length/interval/packets)
  • UDP noise packets (enable/type/packet/delay)
  • DoH pre-resolution (enable/domain/IP)

Each string setting is tri-state: an empty value omits the header, so an untouched panel never overrides the subscriber's own choice in the app. Values are validated against the documented domains and dropped when they do not match, and non-ASCII text is base64-wrapped the way the docs require for Cyrillic. INCY identifies itself as INCY//, which gates the headers behind the same auto-detect switch the Happ path uses.

Headers the panel already emits for every client (Profile-Title, Support-Url, Profile-Web-Page-Url, Announce, Profile-Update-Interval, Subscription-Userinfo) and Incy's routing line are left as they are.

The Premium API (theme, defaultPingProtocol, fallbackHosts, ...) is a separate encrypted endpoint and stays out of scope here.

Summary

Adds a dedicated set of subscription parameters for the INCY client, mirroring what the panel already does for Happ. 28 settings turn 27 documented response headers on and off from Settings → Subscription → Incy, gated behind the same auto-detection switch and applied only to clients whose User-Agent is INCY//.

Why

The panel already pushes a set of Happ headers, but INCY documents its own names and its own value domains, so a Happ-shaped payload is silently ignored by the client. The clearest case is per-app split tunnelling: Happ uses Per-App-Proxy-Mode: on|bypass, while INCY documents per-app-proxy-mode: bypass|proxy plus a separate per-app-proxy-enable: 1|0. Reusing the Happ path would have shipped headers the client never reads.

INCY additionally documents a whole group of parameters the panel had no way to send at all: TCP fragmentation, UDP noise packets, DoH pre-resolution, the banner block, hide-url, hide-check, sort-order, support-email and premium-url.

Reference: https://docs.incy.cc/en/app-management/

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

Unit tests

  • internal/sub/incy_test.go — 9 tests: UA detection, all 27 documented headers asserted by exact value, unset values omitted, undocumented values rejected, non-ASCII → base64, and Happ-only headers not leaking to an INCY client.
  • frontend/src/test/incy-settings-content.test.tsx — 5 tests over the new settings component.

Local suite

  • go build ./... — pass
  • go test ./internal/sub/ ./internal/web/... — pass
  • npm run lint, npm run typecheck, npm run test (1641 tests), npm run build — pass
  • make gen-check — clean (generated Zod/OpenAPI files are committed)

Manual, against a live panel

Panel on Go 1.27 + a VLESS/Reality inbound, subscription served from the sub server, all Incy settings populated (including Cyrillic in the description and banner) and curl -D- against the subscription URL:

  • User-Agent INCY/3.x/android → 27 headers present, and the Cyrillic values arrive as base64:<...> as the docs require. (1/2)
  • User-Agent Happ/1.2.0, v2rayNG/1.8.5, and no UA → zero Incy headers, so the feature is strictly opt-in.
  • Browser-style Accept: text/html → the HTML subscription page is unaffected.

Two notes for the reviewer, both hit while testing:

  1. Subscription settings are baked when the sub server is constructed, so the panel needs a restart (SIGHUP is enough) before changes appear. That applies to the existing Happ settings too — not introduced here.
  2. The panel's setting/update endpoint takes the full settings blob, so partial updates silently revert unrelated keys. Unrelated to this change, but worth knowing when testing by API.

Breaking changes

None. All new settings default to an empty/unset state, which means no header is sent — an existing installation that never opens the new tab behaves exactly as before. The INCY client treats an absent header as "leave the subscriber's own choice alone", which is the intended default.

No database migration is needed: settings are stored as key/value rows and read back reflectively over the json struct tags.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 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/6650 **Author:** [@DIMFLIX](https://github.com/DIMFLIX) **Created:** 9/25/2026 **Status:** ✅ Merged **Merged:** 9/26/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/incy-app-params` --- ### 📝 Commits (3) - [`767d49d`](https://github.com/MHSanaei/3x-ui/commit/767d49d76d53d98146d94f20549567804d318fd3) feat(sub): add Incy app-management parameters - [`819be19`](https://github.com/MHSanaei/3x-ui/commit/819be19c4d4f92031ac5e363761f121f0c777cb7) Merge origin/main into pr/6650 - [`fb8175a`](https://github.com/MHSanaei/3x-ui/commit/fb8175a4a4d6188a2ab8879f504a1bacc850139e) fix(sub): keep Incy per-app list entries separate on the wire ### 📊 Changes **30 files changed** (+2994 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `docs/public/openapi.json` (+226 -0) 📝 `frontend/public/openapi.json` (+226 -0) 📝 `frontend/src/generated/examples.ts` (+56 -0) 📝 `frontend/src/generated/schemas.ts` (+226 -0) 📝 `frontend/src/generated/types.ts` (+56 -0) 📝 `frontend/src/generated/zod.ts` (+56 -0) 📝 `frontend/src/models/setting.ts` (+29 -0) ➕ `frontend/src/pages/settings/IncySettingsContent.tsx` (+488 -0) 📝 `frontend/src/pages/settings/SubscriptionGeneralTab.tsx` (+7 -24) 📝 `frontend/src/schemas/setting.ts` (+28 -0) ➕ `frontend/src/test/incy-settings-content.test.tsx` (+84 -0) 📝 `internal/sub/controller.go` (+8 -0) ➕ `internal/sub/incy.go` (+180 -0) ➕ `internal/sub/incy_test.go` (+208 -0) 📝 `internal/sub/sub.go` (+31 -0) 📝 `internal/web/entity/entity.go` (+31 -0) 📝 `internal/web/service/setting.go` (+144 -0) 📝 `internal/web/translation/ar-EG.json` (+70 -1) 📝 `internal/web/translation/en-US.json` (+70 -1) 📝 `internal/web/translation/es-ES.json` (+70 -1) _...and 10 more files_ </details> ### 📄 Description The panel already pushes a set of Happ headers, but INCY documents its own lowercase header names and its own value domains, so a Happ-shaped payload gets ignored by the client (per-app mode is bypass|proxy, not on|bypass, and per-app-proxy-enable has no Happ counterpart at all). Add a sibling Incy path that emits exactly the documented headers. Covered, per https://docs.incy.cc/en/app-management/: - profile-description, sort-order, support-email, announce-url, premium-url - banner text/button/URL and the two hex colours - hide-url, hide-check, no-limit-enabled - per-app split tunnelling (enable/mode/list) - TCP fragmentation (enable/length/interval/packets) - UDP noise packets (enable/type/packet/delay) - DoH pre-resolution (enable/domain/IP) Each string setting is tri-state: an empty value omits the header, so an untouched panel never overrides the subscriber's own choice in the app. Values are validated against the documented domains and dropped when they do not match, and non-ASCII text is base64-wrapped the way the docs require for Cyrillic. INCY identifies itself as INCY/<version>/<platform>, which gates the headers behind the same auto-detect switch the Happ path uses. Headers the panel already emits for every client (Profile-Title, Support-Url, Profile-Web-Page-Url, Announce, Profile-Update-Interval, Subscription-Userinfo) and Incy's routing line are left as they are. The Premium API (theme, defaultPingProtocol, fallbackHosts, ...) is a separate encrypted endpoint and stays out of scope here. ## Summary Adds a dedicated set of subscription parameters for the INCY client, mirroring what the panel already does for Happ. 28 settings turn 27 documented response headers on and off from Settings → Subscription → Incy, gated behind the same auto-detection switch and applied only to clients whose User-Agent is INCY/<version>/<platform>. ## Why The panel already pushes a set of Happ headers, but INCY documents its own names and its own value domains, so a Happ-shaped payload is silently ignored by the client. The clearest case is per-app split tunnelling: Happ uses Per-App-Proxy-Mode: on|bypass, while INCY documents per-app-proxy-mode: bypass|proxy plus a separate per-app-proxy-enable: 1|0. Reusing the Happ path would have shipped headers the client never reads. INCY additionally documents a whole group of parameters the panel had no way to send at all: TCP fragmentation, UDP noise packets, DoH pre-resolution, the banner block, hide-url, hide-check, sort-order, support-email and premium-url. Reference: https://docs.incy.cc/en/app-management/ ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [x] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) - [ ] Xray config generation - [x] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? ### Unit tests - internal/sub/incy_test.go — 9 tests: UA detection, all 27 documented headers asserted by exact value, unset values omitted, undocumented values rejected, non-ASCII → base64, and Happ-only headers not leaking to an INCY client. - frontend/src/test/incy-settings-content.test.tsx — 5 tests over the new settings component. ### Local suite - go build ./... — pass - go test ./internal/sub/ ./internal/web/... — pass - npm run lint, npm run typecheck, npm run test (1641 tests), npm run build — pass - make gen-check — clean (generated Zod/OpenAPI files are committed) ### Manual, against a live panel Panel on Go 1.27 + a VLESS/Reality inbound, subscription served from the sub server, all Incy settings populated (including Cyrillic in the description and banner) and curl -D- against the subscription URL: - User-Agent INCY/3.x/android → 27 headers present, and the Cyrillic values arrive as base64:<...> as the docs require. (1/2) - User-Agent Happ/1.2.0, v2rayNG/1.8.5, and no UA → zero Incy headers, so the feature is strictly opt-in. - Browser-style Accept: text/html → the HTML subscription page is unaffected. Two notes for the reviewer, both hit while testing: 1. Subscription settings are baked when the sub server is constructed, so the panel needs a restart (SIGHUP is enough) before changes appear. That applies to the existing Happ settings too — not introduced here. 2. The panel's setting/update endpoint takes the full settings blob, so partial updates silently revert unrelated keys. Unrelated to this change, but worth knowing when testing by API. ## Breaking changes None. All new settings default to an empty/unset state, which means no header is sent — an existing installation that never opens the new tab behaves exactly as before. The INCY client treats an absent header as "leave the subscriber's own choice alone", which is the intended default. No database migration is needed: settings are stored as key/value rows and read back reflectively over the json struct tags. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [x] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:08:28 +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#6398
No description provided.