3x-ui/internal/sub
DIMFLIX 71e38367c1
feat(sub): add Incy app-management parameters (#6650)
* feat(sub): add Incy app-management parameters

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.

* fix(sub): keep Incy per-app list entries separate on the wire

The Incy settings textarea takes one package per line, as Incy documents for
per-app-proxy-list, but the header path ran the value through
sanitizeHeaderValue, which deletes CR/LF. "com.google.chrome\norg.telegram.messenger"
reached the client as the single bogus package
"com.google.chromeorg.telegram.messenger", so per-app split tunnelling silently
matched no app. Join comma- or line-separated entries as CSV instead.

Also drop three tests that could not fail: TestIncyExcludesHappOnlyHeaders
(ApplyIncyHeaders has no path that emits Happ headers, and the non-Happ UA
gate is already pinned by TestApplyHappHeaders_Gating) and two UI tests that
only asserted updateSetting received the key the JSX passes it.

---------

Co-authored-by: DIMFLIX <dimflix@users.noreply.github.com>
Co-authored-by: MHSanaei <ho3ein.sanaei@gmail.com>
2026-09-27 01:06:17 +02:00
..
build_urls_test.go fix: resolve a batch of open bug-tagged issues (traffic accounting, share strategy, sub address, CPU) (#5477) 2026-06-22 00:22:28 +02:00
calendar_expire.go feat(sub): add opt-in month-end expiry presentation (#6517) 2026-09-14 12:10:25 +02:00
calendar_expire_test.go feat(sub): add opt-in month-end expiry presentation (#6517) 2026-09-14 12:10:25 +02:00
characterization_test.go fix(sub): restore client email in panel copy/QR link remark (#5532) 2026-06-24 15:25:41 +02:00
clash_external.go fix(sub): preserve external VLESS encryption in Clash subscriptions (#6576) 2026-09-26 20:31:50 +02:00
clash_external_quota_test.go fix(sub): drop external Clash shadowsocks nodes the panel cannot express (#6508) 2026-09-13 20:01:58 +02:00
clash_external_shadowsocks_test.go fix(sub): drop external Clash shadowsocks nodes the panel cannot express (#6508) 2026-09-13 20:01:58 +02:00
clash_external_vless_test.go fix(sub): preserve external VLESS encryption in Clash subscriptions (#6576) 2026-09-26 20:31:50 +02:00
clash_info_node_test.go feat(sub): add dummy info node and status configs for subscriptions (#6412) 2026-09-08 17:14:01 +02:00
clash_service.go fix(sub): emit Hysteria certificate pin for Mihomo (#6651) 2026-09-26 20:31:42 +02:00
clash_service_test.go fix(sub): emit Hysteria certificate pin for Mihomo (#6651) 2026-09-26 20:31:42 +02:00
clash_yaml.go style: drop the line comments added with the triage fixes 2026-07-27 14:37:57 +02:00
clash_yaml_test.go style: drop the line comments added with the triage fixes 2026-07-27 14:37:57 +02:00
controller.go feat(sub): add Incy app-management parameters (#6650) 2026-09-27 01:06:17 +02:00
controller_test.go feat(sub): add legacy Clash subscription endpoint (#6338) 2026-09-10 21:58:55 +02:00
default.json fix(sub): drop legacy freedom.domainStrategy from JSON sub template (#6609) 2026-09-26 21:13:39 +02:00
default_json_test.go fix(sub): drop legacy freedom.domainStrategy from JSON sub template (#6609) 2026-09-26 21:13:39 +02:00
dist.go feat(sub): add raw subscription download actions (#6017) 2026-07-21 15:52:33 +02:00
endpoint.go feat(sub): refine Happ routing presets, serverDescription escaping, and auto-detect placement (#6488) 2026-09-13 12:53:57 +02:00
endpoint_test.go feat(sub): refine Happ routing presets, serverDescription escaping, and auto-detect placement (#6488) 2026-09-13 12:53:57 +02:00
export_all_links_test.go fix(inbounds): serve fresh client UUIDs for list and allLinks (#6458) 2026-09-12 11:12:13 +02:00
external_config.go fix(sub): keep serverDescription literal in external link fragments (#6580) 2026-09-26 22:00:09 +02:00
external_config_test.go Add per-client external link controls (#5650) 2026-08-18 13:55:04 +02:00
external_hwid_test.go fix(sub): send panel guid as X-HWID on outbound subscription fetch (#6579) 2026-09-26 21:59:29 +02:00
external_only_sub_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
external_remark_test.go fix(sub): keep serverDescription literal in external link fragments (#6580) 2026-09-26 22:00:09 +02:00
external_subscription.go feat(sub): make external subscription fetch User-Agent configurable (#6613) 2026-09-26 23:36:33 +02:00
external_subscription_test.go feat(sub): make external subscription fetch User-Agent configurable (#6613) 2026-09-26 23:36:33 +02:00
forwarded_trust.go fix(sub): honor trustedProxyCIDRs before forwarded URLs (#6135) 2026-07-29 21:01:59 +02:00
forwarded_trust_test.go fix(sub): never use X-Real-IP as the subscription host (#6608) 2026-09-26 21:13:46 +02:00
happ.go fix(sub): make Happ require auth on its local SOCKS/HTTP proxy (#6628) 2026-09-26 22:03:20 +02:00
happ_test.go fix(sub): make Happ require auth on its local SOCKS/HTTP proxy (#6628) 2026-09-26 22:03:20 +02:00
host_sub.go feat(hosts): add a cipher suites override and accept custom suites 2026-09-16 11:56:20 +02:00
host_sub_test.go feat(hosts): add a cipher suites override and accept custom suites 2026-09-16 11:56:20 +02:00
hwid_controller_test.go feat(sub): add read-only HWID device-slot status endpoint (#6380) 2026-09-11 11:59:35 +02:00
hysteria_geco_uri_test.go fix(hysteria): standard geco share links and persistent uTLS None (#6325) 2026-09-03 16:35:07 +02:00
inactive_external_sub_test.go Feature/fix external subscription client expiry (#6333) 2026-09-03 22:32:05 +02:00
incy.go feat(sub): add Incy app-management parameters (#6650) 2026-09-27 01:06:17 +02:00
incy_test.go feat(sub): add Incy app-management parameters (#6650) 2026-09-27 01:06:17 +02:00
info_endpoint_test.go feat(sub): redesign the subscription page around usage, tabs and app imports 2026-09-16 01:55:56 +02:00
json_dns.go feat(sub): let the panel set the JSON subscription DNS servers (#6485) 2026-09-13 11:51:56 +02:00
json_dns_controller_test.go feat(sub): let the panel set the JSON subscription DNS servers (#6485) 2026-09-13 11:51:56 +02:00
json_dns_test.go feat(sub): let the panel set the JSON subscription DNS servers (#6485) 2026-09-13 11:51:56 +02:00
json_flow_gate_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
json_info_node_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
json_routing.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
json_routing_baked_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
json_routing_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
json_service.go feat(sub): add opt-in month-end expiry presentation (#6517) 2026-09-14 12:10:25 +02:00
json_service_test.go Feature/tuic v5 (#6337) 2026-09-12 10:15:48 +02:00
links.go fix(mtproto): use hosts for public share links (#6369) 2026-09-08 15:36:57 +02:00
links_test.go fix(inbounds): serve fresh client UUIDs for list and allLinks (#6458) 2026-09-12 11:12:13 +02:00
mutation_audit_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
page_data_test.go feat(sub): expose live online status and add ?format=info endpoint 2026-07-23 23:57:29 +02:00
placeholders.go fix(sub): prevent default profile page URL disclosure (#6538) 2026-09-15 21:13:29 +02:00
placeholders_test.go fix(sub): prevent default profile page URL disclosure (#6538) 2026-09-15 21:13:29 +02:00
profile_mode_test.go fix(sub): prevent default profile page URL disclosure (#6538) 2026-09-15 21:13:29 +02:00
remark_vars.go feat(sub): add dummy info node and status configs for subscriptions (#6412) 2026-09-08 17:14:01 +02:00
remark_vars_test.go fix(sub): use a fullwidth percent in USAGE_PERCENTAGE (#6174) 2026-08-14 20:13:15 +02:00
remote_routing.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
remote_routing_test.go fix(hysteria): standard geco share links and persistent uTLS None (#6325) 2026-09-03 16:35:07 +02:00
salamander_uri_test.go fix(hysteria): standard geco share links and persistent uTLS None (#6325) 2026-09-03 16:35:07 +02:00
service.go fix(sub): keep serverDescription literal in external link fragments (#6580) 2026-09-26 22:00:09 +02:00
service_amneziawg_test.go fix(sub): preserve per-inbound tunnel identity in subscriptions (#6653) 2026-09-26 20:31:47 +02:00
service_dedup_test.go fix(sub): resolve subscription clients and stats from normalized tables 2026-07-02 16:58:00 +02:00
service_flow_test.go feat(inbound): DisableFlow — opt an inbound out of auto XTLS Vision (#5689) (#5698) 2026-08-15 23:09:16 +02:00
service_info_node_test.go feat(sub): add dummy info node and status configs for subscriptions (#6412) 2026-09-08 17:14:01 +02:00
service_mtproto_test.go fix(mtproto): use hosts for public share links (#6369) 2026-09-08 15:36:57 +02:00
service_orphaned_stats_test.go chore: bump deps and modernize test loops 2026-06-26 00:10:30 +02:00
service_property_test.go fix(nodes): stop multi-attached client traffic inflating across node inbounds 2026-06-15 19:31:57 +02:00
service_sharelink_test.go feat(reality): derive a stable per-client spiderX for shared links 2026-07-02 12:53:08 +02:00
service_sort_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
service_test.go feat(xray): update xray-core to v26.9.9 and follow the udpHop move 2026-09-09 01:53:00 +02:00
service_tuic_test.go Feature/tuic v5 (#6337) 2026-09-12 10:15:48 +02:00
service_userinfo_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
service_wireguard_test.go fix(sub): preserve per-inbound tunnel identity in subscriptions (#6653) 2026-09-26 20:31:47 +02:00
shadowsocks_plugin_import_test.go fix(link): rebuild shadowsocks tcp/http obfuscation on import (#6505) 2026-09-13 19:58:27 +02:00
sub.go feat(sub): add Incy app-management parameters (#6650) 2026-09-27 01:06:17 +02:00
sub_balancer_protocol_tag_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
sub_balancer_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
sub_fetch_test.go feat(sub): expose last subscription fetch time (#6217) 2026-08-15 15:22:11 +02:00
sub_json_observatory_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
sub_panic_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
sub_scale_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
vless_route.go fix(sub): bake Host VLESS Route into subscription UUIDs 2026-06-29 14:32:23 +02:00
vless_route_sub_test.go feat(sub): bake Happ/INCY routing profiles into the JSON subscription (#6402) 2026-09-10 17:05:54 +02:00
vless_route_test.go fix(sub): bake Host VLESS Route into subscription UUIDs 2026-06-29 14:32:23 +02:00
vmess_tls_import_test.go fix(link): read the vmess certificate checks on import (#6507) 2026-09-13 19:58:10 +02:00