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>
This commit is contained in:
DIMFLIX
2026-09-27 02:06:17 +03:00
committed by GitHub
parent bd9ccde1f4
commit 71e38367c1
30 changed files with 2994 additions and 37 deletions
+70 -1
View File
@@ -1670,7 +1670,76 @@
"discordNotifyTimeDesc": "Tần suất bot Discord gửi báo cáo định kỳ. Chọn một khoảng thời gian có sẵn, hoặc chọn Tùy chỉnh để nhập biểu thức crontab.",
"discordNotifyBackup": "Sao lưu Cơ sở dữ liệu",
"discordNotifyBackupDesc": "Bao gồm tệp sao lưu cơ sở dữ liệu với thông báo báo cáo.",
"discordEventBusNotifyDesc": "Chọn những sự kiện nào sẽ kích hoạt thông báo qua Discord"
"discordEventBusNotifyDesc": "Chọn những sự kiện nào sẽ kích hoạt thông báo qua Discord",
"subIncyAppAutoDetect": "Tự nhận diện header Incy",
"subIncyAppAutoDetectDesc": "Gửi header Incy khi User-Agent của client là INCY.",
"subIncyNotSet": "Chưa đặt",
"subIncyOn": "Bật",
"subIncyOff": "Tắt",
"subIncyGroupApp": "Ứng dụng",
"subIncyProfileDescription": "Mô tả hồ sơ",
"subIncyProfileDescriptionDesc": "Mô tả riêng cho gói đăng ký. Văn bản không phải ASCII gửi dạng base64.",
"subIncySortOrder": "Thứ tự máy chủ",
"subIncySortOrderDesc": "Cho gói này trên iOS/Android, toàn cục trên desktop.",
"subIncySortNone": "Theo thứ tự gói",
"subIncySortPing": "Theo ping",
"subIncySortName": "Theo tên",
"subIncySupportEmail": "Email hỗ trợ",
"subIncySupportEmailDesc": "Thêm nút Email vào thẻ đăng ký.",
"subIncyAnnounceUrl": "Link thông báo",
"subIncyAnnounceUrlDesc": "Đích của thông báo trên màn hình chính.",
"subIncyPremiumUrl": "Link Premium",
"subIncyPremiumUrlDesc": "Nút Premium trong thẻ; cũng ưu tiên cho nút banner.",
"subIncyGroupBanners": "Banner",
"subIncyBannerText": "Chữ trên banner",
"subIncyBannerTextDesc": "Ghi đè chữ banner. Chỉ nhà cung cấp premium.",
"subIncyBannerButtonText": "Chữ nút banner",
"subIncyBannerButtonTextDesc": "Nhãn nút banner. Để trống sẽ ẩn nút.",
"subIncyBannerButtonUrl": "Link nút banner",
"subIncyBannerButtonUrlDesc": "URL của nút banner.",
"subIncyBannerBgColor": "Nền banner",
"subIncyBannerBgColorDesc": "Màu hex, ví dụ #E53E3E.",
"subIncyBannerButtonColor": "Màu nút banner",
"subIncyBannerButtonColorDesc": "Màu hex, ví dụ #38A169.",
"subIncyGroupPrivacy": "Riêng tư",
"subIncyHideUrl": "Ẩn URL đăng ký",
"subIncyHideUrlDesc": "Ẩn URL khỏi chia sẻ, sao chép, QR và bản sao lưu.",
"subIncyHideCheck": "Ẩn nút kiểm tra",
"subIncyHideCheckDesc": "Bỏ nút kiểm tra kết nối khỏi màn hình chính.",
"subIncyNoLimit": "Chế độ No-Limit (iOS)",
"subIncyNoLimitDesc": "Chế độ tiết kiệm bộ nhớ để tunnel sống trong giới hạn 50 MB của iOS.",
"subIncyPerAppEnable": "Chế độ per-app (Android)",
"subIncyPerAppEnableDesc": "Bật split tunnel theo ứng dụng. Tắt sẽ ghi đè lựa chọn của người dùng.",
"subIncyPerAppMode": "Kiểu chế độ per-app",
"subIncyPerAppModeDesc": "proxy: chỉ ứng dụng trong danh sách đi qua VPN; bypass thì ngược lại.",
"subIncyPerAppModeProxy": "Chỉ ứng dụng trong danh sách",
"subIncyPerAppModeBypass": "Ứng dụng trong danh sách đi thẳng",
"subIncyPerAppList": "Danh sách ứng dụng",
"subIncyPerAppListDesc": "Tên gói cách nhau bằng dấu phẩy hoặc xuống dòng, hoặc URL tới file văn bản.",
"subIncyGroupNetwork": "Mạng",
"subIncyFragmentationEnable": "Phân mảnh",
"subIncyFragmentationEnableDesc": "Bật phân mảnh TCP và ghi đè cấu hình chung.",
"subIncyFragmentLength": "Độ dài mảnh",
"subIncyFragmentLengthDesc": "Khoảng theo byte, ví dụ 10-30.",
"subIncyFragmentInterval": "Khoảng cách mảnh",
"subIncyFragmentIntervalDesc": "Khoảng theo mili giây, ví dụ 20-40.",
"subIncyFragmentPackets": "Gói phân mảnh",
"subIncyFragmentPacketsDesc": "Phân mảnh gói TCP nào: tlshello, 1-3, 1 hoặc all.",
"subIncyNoisesEnable": "Gói nhiễu",
"subIncyNoisesEnableDesc": "Gửi nhiễu UDP ngẫu nhiên trước khi bắt tay VPN.",
"subIncyNoisesType": "Kiểu nhiễu",
"subIncyNoisesTypeDesc": "rand, str hoặc hex.",
"subIncyNoisesPacket": "Nội dung gói nhiễu",
"subIncyNoisesPacketDesc": "Nội dung; với rand là khoảng độ dài, ví dụ 10-20.",
"subIncyNoisesDelay": "Độ trễ nhiễu",
"subIncyNoisesDelayDesc": "Khoảng trễ theo mili giây, ví dụ 10-50.",
"subIncyResolveEnable": "Phân giải địa chỉ máy chủ (DoH)",
"subIncyResolveEnableDesc": "Phân giải địa chỉ máy chủ qua DoH trước khi kết nối.",
"subIncyResolveDnsDomain": "Endpoint DoH",
"subIncyResolveDnsDomainDesc": "URL máy chủ DoH, thường kết thúc bằng /dns-query.",
"subIncyResolveDnsIp": "IP máy chủ DoH",
"subIncyResolveDnsIpDesc": "IP máy chủ DoH để khởi tạo.",
"subIncyGroupRouting": "Định tuyến"
},
"xray": {
"importRules": "Nhập quy tắc",