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": "Discord ボットが定期レポートを送信する頻度です。プリセットの間隔を選ぶか、「カスタム」を選んで crontab 式を入力します。",
"discordNotifyBackup": "データベースバックアップ",
"discordNotifyBackupDesc": "レポート付きのデータベースバックアップファイルを送信",
"discordEventBusNotifyDesc": "Discord通知をトリガーするイベントを選択してください"
"discordEventBusNotifyDesc": "Discord通知をトリガーするイベントを選択してください",
"subIncyAppAutoDetect": "Incy ヘッダー自動判別",
"subIncyAppAutoDetectDesc": "クライアントの User-Agent が INCY のとき Incy ヘッダーを送信します。",
"subIncyNotSet": "未設定",
"subIncyOn": "オン",
"subIncyOff": "オフ",
"subIncyGroupApp": "アプリ",
"subIncyProfileDescription": "プロファイルの説明",
"subIncyProfileDescriptionDesc": "購読とは別の説明文。非 ASCII は base64 で送信されます。",
"subIncySortOrder": "サーバーの並び順",
"subIncySortOrderDesc": "iOS/Android ではこの購読のみ、デスクトップでは全体設定です。",
"subIncySortNone": "購読順",
"subIncySortPing": "ping 順",
"subIncySortName": "名前順",
"subIncySupportEmail": "サポートメール",
"subIncySupportEmailDesc": "購読カードに Email ボタンを追加します。",
"subIncyAnnounceUrl": "お知らせリンク",
"subIncyAnnounceUrlDesc": "ホーム画面のお知らせの遷移先です。",
"subIncyPremiumUrl": "Premium リンク",
"subIncyPremiumUrlDesc": "カードの Premium ボタン。バナーのボタンでも優先されます。",
"subIncyGroupBanners": "バナー",
"subIncyBannerText": "バナーテキスト",
"subIncyBannerTextDesc": "バナーテキストを上書きします。Premium プロバイダーのみ。",
"subIncyBannerButtonText": "バナーボタンのテキスト",
"subIncyBannerButtonTextDesc": "バナーボタンのラベル。空にすると非表示になります。",
"subIncyBannerButtonUrl": "バナーボタンのリンク",
"subIncyBannerButtonUrlDesc": "バナーボタンの URL。",
"subIncyBannerBgColor": "バナーの背景色",
"subIncyBannerBgColorDesc": "16 進カラー、例 #E53E3E。",
"subIncyBannerButtonColor": "バナーボタンの色",
"subIncyBannerButtonColorDesc": "16 進カラー、例 #38A169。",
"subIncyGroupPrivacy": "プライバシー",
"subIncyHideUrl": "購読 URL を隠す",
"subIncyHideUrlDesc": "共有・コピー・QR・バックアップから URL を隠します。",
"subIncyHideCheck": "チェックボタンを隠す",
"subIncyHideCheckDesc": "ホーム画面から接続チェックボタンを削除します。",
"subIncyNoLimit": "No-Limit モード (iOS)",
"subIncyNoLimitDesc": "iOS の 50 MB 制限内でトンネルを維持する省メモリモードです。",
"subIncyPerAppEnable": "アプリ別モード (Android)",
"subIncyPerAppEnableDesc": "アプリ別スプリットトンネルを有効にします。オフはユーザー設定を上書きします。",
"subIncyPerAppMode": "アプリ別モードの種類",
"subIncyPerAppModeDesc": "proxy は指定アプリのみ VPN、bypass はその逆です。",
"subIncyPerAppModeProxy": "指定アプリのみ",
"subIncyPerAppModeBypass": "指定アプリを除外",
"subIncyPerAppList": "アプリ一覧",
"subIncyPerAppListDesc": "パッケージ名をカンマか改行で区切るか、テキストファイルの URL。",
"subIncyGroupNetwork": "ネットワーク",
"subIncyFragmentationEnable": "フラグメンテーション",
"subIncyFragmentationEnableDesc": "TCP フラグメンテーションを有効にし、全体設定を上書きします。",
"subIncyFragmentLength": "フラグメント長",
"subIncyFragmentLengthDesc": "バイト範囲、例 10-30。",
"subIncyFragmentInterval": "フラグメント間隔",
"subIncyFragmentIntervalDesc": "ミリ秒範囲、例 20-40。",
"subIncyFragmentPackets": "フラグメント対象パケット",
"subIncyFragmentPacketsDesc": "分割する TCP パケット: tlshello、1-3、1、all。",
"subIncyNoisesEnable": "ノイズパケット",
"subIncyNoisesEnableDesc": "VPN ハンドシェイク前にランダムな UDP ノイズを送信します。",
"subIncyNoisesType": "ノイズの種類",
"subIncyNoisesTypeDesc": "rand、str、hex。",
"subIncyNoisesPacket": "ノイズの内容",
"subIncyNoisesPacketDesc": "ペイロード。rand の場合は長さ範囲、例 10-20。",
"subIncyNoisesDelay": "ノイズ遅延",
"subIncyNoisesDelayDesc": "遅延範囲 (ミリ秒)、例 10-50。",
"subIncyResolveEnable": "サーバーアドレスの解決 (DoH)",
"subIncyResolveEnableDesc": "接続前に DoH でサーバーアドレスを解決します。",
"subIncyResolveDnsDomain": "DoH エンドポイント",
"subIncyResolveDnsDomainDesc": "DoH サーバー URL。通常は /dns-query で終わります。",
"subIncyResolveDnsIp": "DoH サーバー IP",
"subIncyResolveDnsIpDesc": "ブートストラップ用の DoH サーバー IP。",
"subIncyGroupRouting": "ルーティング"
},
"xray": {
"importRules": "ルールをインポート",