feat(settings): add setting for Reality scan candidates (#6471)

* feat(settings): allow customizing Reality scan candidate list

Persist a realityScanCandidates panel setting (defaulting to the previous
hardcoded list), expose it in General Settings with i18n, and have the
Find Targets scanner use it when the search box is empty.

Fixes #5847

* style(frontend): oxfmt realityScanCandidates in setting.ts

* Fix locale JSON syntax

This change removes the malformed duplicate key and missing comma in the Android per-app proxy translations across the bundled locale files. The JSON now parses correctly while preserving the translated labels for each language.

* docs(i18n): update Happ translations

Localize the remaining Happ subscription settings strings across the translation files and refine the English copy. This aligns the labels and descriptions with the current Happ behavior for notifications, TUN options, HWID enforcement, routing presets, and per-app proxy settings.

* refactor(reality): drop test-only scaffolding from the candidate setting

TestDefaultRealityScanCandidatesCSV compared the CSV against its own
initializer and a defaultValueMap lookup, and
TestRealityScanCandidateTokensFallsBackWithoutDB drove a no-database
state no production caller reaches (the only caller is the
scanRealityTargets handler, served after InitDB). The
s != nil && GetDB() != nil guard existed only for that second test.
None of them could fail except in lockstep with the code they restate.

* docs(api): describe the setting-driven scanRealityTargets fallback

An empty targets value now probes the realityScanCandidates setting,
but the endpoint summary, parameter description and handler comment
still promised the built-in seed list, so API consumers were told the
wrong target set. Regenerated openapi.json and synced the docs copy,
which also lacked the new AllSetting field in the settings reference.

---------

Co-authored-by: mrchatam <287639636+mrchatam@users.noreply.github.com>
Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
mrchatam
2026-09-13 16:18:28 +03:30
committed by GitHub
parent bf7ce2daaa
commit 768bbd2a29
29 changed files with 857 additions and 735 deletions
+71 -69
View File
@@ -1253,6 +1253,8 @@
"noisesSett": "Cài đặt Noises",
"trustedProxyCidrs": "CIDR proxy tin cậy",
"trustedProxyCidrsDesc": "IPs/CIDRs cách nhau bằng dấu phẩy được phép đặt header host, proto và IP client chuyển tiếp.",
"realityScanCandidates": "Danh sách ứng viên quét Reality",
"realityScanCandidatesDesc": "Danh sách host:port (hoặc CIDR) cách nhau bằng dấu phẩy dùng làm mặc định khi Tìm mục tiêu chạy với ô tìm kiếm trống. Tuỳ chỉnh theo các đích bạn dùng thường xuyên.",
"ldap": {
"enable": "Bật đồng bộ LDAP",
"host": "LDAP host",
@@ -1496,56 +1498,56 @@
"subExpiredTemplateDesc": "Mẫu cho cấu hình ảo khi tài khoản đăng ký đã hết hạn.",
"subTrafficDepletedTemplate": "Mẫu hết dung lượng",
"subTrafficDepletedTemplateDesc": "Mẫu cho cấu hình ảo khi tài khoản đăng ký đã dùng hết dung lượng.",
"subHappAutoDetect": "Happ Header Auto-Detection",
"subHappAutoDetectDesc": "Automatically inject Happ routing and headers when client User-Agent indicates Happ.",
"subHappProviderId": "Provider ID",
"subHappProviderIdDesc": "Unique provider identifier for Happ client management, remote configuration binding, and migration.",
"subHappNewUrl": "New Subscription URL",
"subHappNewUrlDesc": "Target URL for automatic client migration. When set, Happ clients will migrate to this subscription link.",
"subHappFallbackUrl": "Fallback Subscription URL",
"subHappFallbackUrlDesc": "Backup subscription address used by Happ if the primary subscription URL becomes unreachable.",
"subHappSubInfoText": "Banner Announcement Text",
"subHappSubInfoTextDesc": "Custom announcement banner displayed at the top of the Happ client (max 200 characters).",
"subHappSubInfoColor": "Banner Accent Color",
"subHappSubInfoColorDesc": "Color theme style for the announcement banner.",
"subHappSubInfoButtonText": "Banner Button Text",
"subHappSubInfoButtonTextDesc": "Button label displayed inside the announcement banner (max 25 characters).",
"subHappSubInfoButtonLink": "Banner Button Link",
"subHappSubInfoButtonLinkDesc": "Target URL opened when the user clicks the banner action button.",
"subHappSubExpire": "Expired Subscription Banner",
"subHappSubExpireDesc": "Show an expired subscription banner in Happ when the user's traffic or validity has ended.",
"subHappSubExpireButtonLink": "Renewal Link",
"subHappSubExpireButtonLinkDesc": "Target URL opened when the user clicks the renewal button on an expired subscription.",
"subHappNotificationExpire": "Expiration Notifications",
"subHappNotificationExpireDesc": "Instruct Happ to alert the user in advance before their subscription expires.",
"subHappNoLimit": "Bypass Rule Limit",
"subHappNoLimitDesc": "Allow routing rule count to exceed default mobile platform limits without truncation.",
"subHappAlwaysHwid": "Enforce Hardware ID (HWID)",
"subHappAlwaysHwidDesc": "Bind subscription sessions to client device hardware identifier for enhanced security.",
"subHappTunMode": "TUN Mode",
"subHappTunModeDesc": "TUN virtual network interface routing mode: default, system, or strict.",
"subHappTunType": "TUN Engine",
"subHappTunTypeDesc": "Underlying network stack implementation for TUN: system, gVisor, or mixed.",
"subHappExcludeRoutes": "Exclude CIDR Routes",
"subHappExcludeRoutesDesc": "Comma-separated IP CIDRs (e.g. 192.168.0.0/16, 10.0.0.0/8) to bypass the VPN tunnel.",
"subHappExcludeApns": "Exclude Apple APNs",
"subHappExcludeApnsDesc": "Bypass Apple Push Notification services to maintain reliable background notifications on iOS.",
"subHappColorProfile": "Client Color Theme",
"subHappColorProfileDesc": "Client color theme profile: default, violet, turquoise, cyberpunk, or custom JSON theme.",
"subHappPingType": "Latency Ping Method",
"subHappPingTypeDesc": "Measurement protocol used by Happ for node latency testing: icmp, tcp, or http.",
"subHappAutoConnect": "Auto-Connect on Launch",
"subHappAutoConnectDesc": "Instruct Happ to automatically connect to VPN when the application starts.",
"subHappAutoConnectType": "Auto-Connect Target",
"subHappAutoConnectTypeDesc": "Connection target strategy for auto-connect: fastest node or last used node.",
"subHappPerAppMode": "Android Per-App Proxy Mode",
"subHappPerAppModeDesc": "Control Android application routing: off, include (proxy only listed apps), or exclude (bypass listed apps).",
"subHappPerAppList": "Android Package Names",
"subHappPerAppListDesc": "Comma-separated package names of Android applications to include or exclude (e.g. com.telegram.messenger).",
"subHappPresetIran": "Iran Bypass",
"subHappPresetChina": "China Direct",
"subHappAutoDetect": "Tự động nhận diện header Happ",
"subHappAutoDetectDesc": "Tự động chèn định tuyến và header Happ khi User-Agent của ứng dụng khách cho thấy đó là Happ.",
"subHappProviderId": "ID nhà cung cấp (Provider ID)",
"subHappProviderIdDesc": "Mã định danh duy nhất của nhà cung cấp, dùng để quản lý ứng dụng khách Happ, liên kết cấu hình từ xa và di chuyển.",
"subHappNewUrl": "URL đăng ký mới",
"subHappNewUrlDesc": "URL đích để tự động di chuyển ứng dụng khách. Khi được đặt, ứng dụng Happ sẽ chuyển sang liên kết đăng ký này.",
"subHappFallbackUrl": "URL đăng ký dự phòng",
"subHappFallbackUrlDesc": "Địa chỉ đăng ký dự phòng mà Happ dùng khi không thể truy cập URL đăng ký chính.",
"subHappSubInfoText": "Nội dung biểu ngữ thông báo",
"subHappSubInfoTextDesc": "Biểu ngữ thông báo tùy chỉnh hiển thị ở đầu ứng dụng Happ (tối đa 200 ký tự).",
"subHappSubInfoColor": "Màu nhấn biểu ngữ",
"subHappSubInfoColorDesc": "Kiểu màu chủ đề cho biểu ngữ thông báo.",
"subHappSubInfoButtonText": "Chữ trên nút biểu ngữ",
"subHappSubInfoButtonTextDesc": "Nhãn nút hiển thị bên trong biểu ngữ thông báo (tối đa 25 ký tự).",
"subHappSubInfoButtonLink": "Liên kết nút biểu ngữ",
"subHappSubInfoButtonLinkDesc": "URL đích được mở khi người dùng nhấn nút hành động trên biểu ngữ.",
"subHappSubExpire": "Biểu ngữ đăng ký hết hạn",
"subHappSubExpireDesc": "Hiển thị biểu ngữ đăng ký hết hạn trong Happ khi lưu lượng hoặc thời hạn của người dùng đã hết.",
"subHappSubExpireButtonLink": "Liên kết gia hạn",
"subHappSubExpireButtonLinkDesc": "URL đích được mở khi người dùng nhấn nút gia hạn trên đăng ký đã hết hạn.",
"subHappNotificationExpire": "Thông báo hết hạn",
"subHappNotificationExpireDesc": "Yêu cầu Happ nhắc người dùng 3 ngày trước khi đăng ký hết hạn.",
"subHappNoLimit": "Chế độ không giới hạn",
"subHappNoLimitDesc": "Nâng giới hạn RAM của xray-core trong Happ để tăng độ ổn định và hiệu năng (beta).",
"subHappAlwaysHwid": "Bắt buộc ID phần cứng (HWID)",
"subHappAlwaysHwidDesc": "Ngăn người dùng tắt việc gửi HWID trong cài đặt Happ.",
"subHappTunMode": "Chế độ TUN",
"subHappTunModeDesc": "Ngăn xếp mạng mà TUN dùng trên máy tính: hệ thống (ngăn xếp của hệ điều hành) hoặc gVisor (ngăn xếp không gian người dùng).",
"subHappTunType": "Lõi TUN",
"subHappTunTypeDesc": "Lõi dùng cho kết nối TUN trên máy tính: sing-box, tun2proxy, mặc định (Happ TUN) hoặc Xray.",
"subHappExcludeRoutes": "Loại trừ tuyến CIDR",
"subHappExcludeRoutesDesc": "Các IP CIDR cách nhau bằng dấu phẩy (ví dụ 192.168.0.0/16, 10.0.0.0/8) sẽ bỏ qua đường hầm VPN.",
"subHappExcludeApns": "Loại trừ Apple APNs",
"subHappExcludeApnsDesc": "Bỏ qua dịch vụ Apple Push Notification để thông báo nền trên iOS luôn ổn định.",
"subHappColorProfile": "Chủ đề màu ứng dụng khách",
"subHappColorProfileDesc": "Chủ đề màu iOS tùy chỉnh dưới dạng chuỗi JSON, hoặc resetcolors để khôi phục màu mặc định.",
"subHappPingType": "Phương thức đo độ trễ",
"subHappPingTypeDesc": "Cách Happ đo độ trễ của nút: qua proxy (GET hoặc HEAD), TCP hoặc ICMP.",
"subHappAutoConnect": "Tự động kết nối khi khởi động",
"subHappAutoConnectDesc": "Yêu cầu Happ tự động kết nối VPN khi ứng dụng khởi động.",
"subHappAutoConnectType": "Mục tiêu tự động kết nối",
"subHappAutoConnectTypeDesc": "Máy chủ được chọn khi tự động kết nối: độ trễ thấp nhất, dùng gần nhất hoặc một nút ngẫu nhiên.",
"subHappPerAppMode": "Chế độ proxy theo ứng dụng Android",
"subHappPerAppModeDesc": "Kiểm soát định tuyến ứng dụng Android: tắt, bật (chỉ proxy ứng dụng trong danh sách) hoặc bỏ qua (loại trừ ứng dụng trong danh sách).",
"subHappPerAppList": "Tên gói Android",
"subHappPerAppListDesc": "Tên gói ứng dụng Android cách nhau bằng dấu phẩy để bao gồm hoặc loại trừ (ví dụ org.telegram.messenger).",
"subHappPresetIran": "Bỏ qua Iran",
"subHappPresetChina": "Trực tiếp Trung Quốc",
"subHappPresetAdblock": "AdBlock",
"subHappPresetGlobal": "Full Proxy",
"subHappPresetGlobal": "Proxy toàn bộ",
"subHappPresetOff": "Tắt định tuyến (happ://routing/off)",
"subHappColorBlue": "Xanh dương (Tiêu chuẩn / Mặc định)",
"subHappColorGreen": "Xanh lá (Thành công)",
@@ -1567,27 +1569,27 @@
"subHappPerAppOff": "Tắt",
"subHappPerAppOn": "Bật (Chỉ proxy ứng dụng trong danh sách)",
"subHappPerAppBypass": "Bỏ qua (Loại trừ ứng dụng trong danh sách)",
"subHappPresetApplied": "Happ preset applied to routing rules",
"subHappPresets": "Routing Presets",
"subHappPresetsDesc": "Pre-configured routing rule presets tailored for Happ clients.",
"subHappVisualBuilder": "Visual Rule Generator",
"subHappVisualBuilderDesc": "Create custom routing deeplink from domain and IP lists.",
"subHappBuildDeeplink": "Generate Deeplink",
"subHappModalTitle": "Happ Visual Routing Rule Generator",
"subHappDirectDomains": "Direct Domains (Bypass)",
"subHappProxyDomains": "Proxy Domains (Tunnel)",
"subHappBlockDomains": "Blocked Domains (Ad/Malware)",
"subHappDirectIPs": "Direct IPs / CIDRs",
"subHappProxyIPs": "Proxy IPs / CIDRs",
"subHappBlockIPs": "Blocked IPs / CIDRs",
"subHappDeeplinkGenerated": "Deeplink generated and applied to routing rules",
"subHappPresetApplied": "Đã áp dụng mẫu Happ vào quy tắc định tuyến",
"subHappPresets": "Mẫu định tuyến",
"subHappPresetsDesc": "Các mẫu quy tắc định tuyến cấu hình sẵn dành cho ứng dụng Happ.",
"subHappVisualBuilder": "Trình tạo quy tắc trực quan",
"subHappVisualBuilderDesc": "Tạo deeplink định tuyến tùy chỉnh từ danh sách tên miền và IP.",
"subHappBuildDeeplink": "Tạo deeplink",
"subHappModalTitle": "Trình tạo quy tắc định tuyến trực quan cho Happ",
"subHappDirectDomains": "Tên miền trực tiếp (bỏ qua)",
"subHappProxyDomains": "Tên miền proxy (đường hầm)",
"subHappBlockDomains": "Tên miền bị chặn (quảng cáo/mã độc)",
"subHappDirectIPs": "IP / CIDR trực tiếp",
"subHappProxyIPs": "IP / CIDR proxy",
"subHappBlockIPs": "IP / CIDR bị chặn",
"subHappDeeplinkGenerated": "Đã tạo deeplink và áp dụng vào quy tắc định tuyến",
"subHappGroupLinks": "Liên kết đăng ký",
"subHappGroupRouting": "Routing & Rules",
"subHappGroupBanners": "Banners & Announcements",
"subHappGroupNetwork": "Network & TUN Engine",
"subHappGroupThemes": "Appearance & Theme",
"subHappGroupFailover": "Migration & App Management",
"subHappGroupAndroid": "Android Per-App Proxy",
"subHappGroupRouting": "Định tuyến & quy tắc",
"subHappGroupBanners": "Biểu ngữ & thông báo",
"subHappGroupNetwork": "Mạng & lõi TUN",
"subHappGroupThemes": "Giao diện & chủ đề",
"subHappGroupFailover": "Di chuyển & quản lý ứng dụng",
"subHappGroupAndroid": "Proxy theo ứng dụng Android",
"discordSettings": "Bot Discord",
"discordBotEnable": "Bật thông báo Discord",
"discordBotEnableDesc": "Gửi cảnh báo hệ thống và sự kiện đến kênh Discord qua bot",