From 740bdce21530da6d6ea9e6b9f5ac70bad06061bc Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Thu, 25 Sep 2025 16:05:16 +0200 Subject: [PATCH] enable or disable services Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- back/search/search.go | 19 +- .../components/index/search/searchbar.svelte | 60 +++-- front/src/lib/types.ts | 4 + front/src/routes/search/[id]/index.svelte | 214 +++++++++--------- 4 files changed, 176 insertions(+), 121 deletions(-) diff --git a/back/search/search.go b/back/search/search.go index 7677096..31605cb 100644 --- a/back/search/search.go +++ b/back/search/search.go @@ -16,6 +16,10 @@ type Query struct { Text string Column string // The column to search in (e.g., "email", "password", etc. ExactMatch bool // Whether to search for an exact match + + // Services + Datawells bool // Whether to include datawells in the search + GithubRecon bool // Whether to include github-recon in the search } type Result struct { @@ -38,8 +42,14 @@ func Search(s *server.Server, q Query, r *Result, mu *sync.RWMutex) { mu.Unlock() wg.Add(2) - go func() { + if !q.Datawells { + mu.Lock() + r.LeakResult = dataleak.LeakResult{Error: "not enabled"} + mu.Unlock() + wg.Done() + return + } leakResult := dataleak.Search(s, q.Text, q.Column, q.ExactMatch) mu.Lock() r.LeakResult = leakResult @@ -48,6 +58,13 @@ func Search(s *server.Server, q Query, r *Result, mu *sync.RWMutex) { }() go func() { + if !q.GithubRecon { + mu.Lock() + r.GithubResult = osint.GithubResult{Error: "not enabled"} + mu.Unlock() + wg.Done() + return + } githubResult := osint.Search(s, q.Text, q.Column) mu.Lock() r.GithubResult = *githubResult diff --git a/front/src/lib/components/index/search/searchbar.svelte b/front/src/lib/components/index/search/searchbar.svelte index a07f05f..e6ad673 100644 --- a/front/src/lib/components/index/search/searchbar.svelte +++ b/front/src/lib/components/index/search/searchbar.svelte @@ -1,19 +1,22 @@
- {result.LeakResult.Rows.length} results in {convertNanoSeconds( - result.LeakResult.Duration, - )} -
- {#if result.LeakResult.LimitHit} -+ {result.LeakResult.Rows.length} results in {convertNanoSeconds( + result.LeakResult.Duration, + )} +
+ {#if result.LeakResult.LimitHit} +- Found a result in {convertNanoSeconds( - result.GithubResult.Duration, - )} -
-+ Found a result in {convertNanoSeconds( + result.GithubResult.Duration, + )} +
+