[PR #6471] [MERGED] feat(settings): add setting for Reality scan candidates #6293

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6471
Author: @mrchatam
Created: 9/11/2026
Status: ✅ Merged
Merged: 9/13/2026
Merged by: @MHSanaei

Base: main ← Head: feat/reality-scan-candidates-setting


📝 Commits (7)

  • d0f29e7 feat(settings): allow customizing Reality scan candidate list
  • 4a28a8a style(frontend): oxfmt realityScanCandidates in setting.ts
  • 3db6b22 Merge branch 'main' into feat/reality-scan-candidates-setting
  • cb853e1 Fix locale JSON syntax
  • 0c510e4 docs(i18n): update Happ translations
  • a52e7de refactor(reality): drop test-only scaffolding from the candidate setting
  • 006ec26 docs(api): describe the setting-driven scanRealityTargets fallback

📊 Changes

29 files changed (+857 additions, -735 deletions)

View changed files

📝 docs/content/docs/en/reference/api/server.mdx (+8 -6)
📝 docs/public/openapi.json (+10 -2)
📝 frontend/public/openapi.json (+10 -2)
📝 frontend/src/generated/examples.ts (+2 -0)
📝 frontend/src/generated/schemas.ts (+8 -0)
📝 frontend/src/generated/types.ts (+2 -0)
📝 frontend/src/generated/zod.ts (+2 -0)
📝 frontend/src/models/setting.ts (+2 -0)
📝 frontend/src/pages/api-docs/endpoints.ts (+2 -2)
📝 frontend/src/pages/settings/GeneralTab.tsx (+19 -0)
📝 frontend/src/schemas/setting.ts (+1 -0)
📝 internal/web/controller/server.go (+2 -3)
📝 internal/web/entity/entity.go (+11 -10)
📝 internal/web/service/reality_scan.go (+24 -3)
📝 internal/web/service/reality_scan_test.go (+16 -0)
📝 internal/web/service/setting.go (+5 -0)
📝 internal/web/translation/ar-EG.json (+74 -72)
📝 internal/web/translation/en-US.json (+13 -11)
📝 internal/web/translation/es-ES.json (+72 -70)
📝 internal/web/translation/fa-IR.json (+16 -14)

...and 9 more files

📄 Description

Summary

  • Adds a persisted realityScanCandidates panel setting (comma-separated host:port / CIDR list), defaulting to the previous hardcoded defaultRealityScanCandidates.
  • Surfaces the setting in General Settings with i18n for all locales.
  • The Find Targets scanner (ScanRealityTargets) uses the saved list when the search box is empty, instead of only the compile-time constant.

Test plan

  • Open General Settings, confirm Reality scan candidates shows the default list and the Default tag.
  • Change the list, save settings, reopen Find Targets with an empty search — scanner should probe the customized candidates.
  • Clear the search override and confirm invalid/custom entries still behave as before for one-off scans.
  • go test ./internal/web/service/ -run 'TestDefaultRealityScanCandidatesCSV|TestParseRealityScanCandidateCSV|TestRealityScanCandidateTokensFallsBackWithoutDB|TestScanRealityTargets'

Fixes #5847


🔄 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/6471 **Author:** [@mrchatam](https://github.com/mrchatam) **Created:** 9/11/2026 **Status:** ✅ Merged **Merged:** 9/13/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/reality-scan-candidates-setting` --- ### 📝 Commits (7) - [`d0f29e7`](https://github.com/MHSanaei/3x-ui/commit/d0f29e79e4757dbcf2988e77e43ea20d026b2407) feat(settings): allow customizing Reality scan candidate list - [`4a28a8a`](https://github.com/MHSanaei/3x-ui/commit/4a28a8a934ffe12f72badee9d225f0a65e44c19c) style(frontend): oxfmt realityScanCandidates in setting.ts - [`3db6b22`](https://github.com/MHSanaei/3x-ui/commit/3db6b226500799cfadec7ca3098eb90c3533498a) Merge branch 'main' into feat/reality-scan-candidates-setting - [`cb853e1`](https://github.com/MHSanaei/3x-ui/commit/cb853e1faee47713bd1c11d22f6021190d352014) Fix locale JSON syntax - [`0c510e4`](https://github.com/MHSanaei/3x-ui/commit/0c510e47f2965cbac72d6f09a67097ab8a0bd531) docs(i18n): update Happ translations - [`a52e7de`](https://github.com/MHSanaei/3x-ui/commit/a52e7de3b123c074f407aed80725f18c8a0e3dfb) refactor(reality): drop test-only scaffolding from the candidate setting - [`006ec26`](https://github.com/MHSanaei/3x-ui/commit/006ec26d03196183d811b1512f6015bab15f9408) docs(api): describe the setting-driven scanRealityTargets fallback ### 📊 Changes **29 files changed** (+857 additions, -735 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/en/reference/api/server.mdx` (+8 -6) 📝 `docs/public/openapi.json` (+10 -2) 📝 `frontend/public/openapi.json` (+10 -2) 📝 `frontend/src/generated/examples.ts` (+2 -0) 📝 `frontend/src/generated/schemas.ts` (+8 -0) 📝 `frontend/src/generated/types.ts` (+2 -0) 📝 `frontend/src/generated/zod.ts` (+2 -0) 📝 `frontend/src/models/setting.ts` (+2 -0) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+2 -2) 📝 `frontend/src/pages/settings/GeneralTab.tsx` (+19 -0) 📝 `frontend/src/schemas/setting.ts` (+1 -0) 📝 `internal/web/controller/server.go` (+2 -3) 📝 `internal/web/entity/entity.go` (+11 -10) 📝 `internal/web/service/reality_scan.go` (+24 -3) 📝 `internal/web/service/reality_scan_test.go` (+16 -0) 📝 `internal/web/service/setting.go` (+5 -0) 📝 `internal/web/translation/ar-EG.json` (+74 -72) 📝 `internal/web/translation/en-US.json` (+13 -11) 📝 `internal/web/translation/es-ES.json` (+72 -70) 📝 `internal/web/translation/fa-IR.json` (+16 -14) _...and 9 more files_ </details> ### 📄 Description ## Summary - Adds a persisted `realityScanCandidates` panel setting (comma-separated `host:port` / CIDR list), defaulting to the previous hardcoded `defaultRealityScanCandidates`. - Surfaces the setting in General Settings with i18n for all locales. - The Find Targets scanner (`ScanRealityTargets`) uses the saved list when the search box is empty, instead of only the compile-time constant. ## Test plan - [ ] Open General Settings, confirm Reality scan candidates shows the default list and the Default tag. - [ ] Change the list, save settings, reopen Find Targets with an empty search — scanner should probe the customized candidates. - [ ] Clear the search override and confirm invalid/custom entries still behave as before for one-off scans. - [ ] `go test ./internal/web/service/ -run 'TestDefaultRealityScanCandidatesCSV|TestParseRealityScanCandidateCSV|TestRealityScanCandidateTokensFallsBackWithoutDB|TestScanRealityTargets'` Fixes #5847 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:44 +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#6293
No description provided.