From d0c0ba43deeb062058973d70a699366dd1852fad Mon Sep 17 00:00:00 2001 From: ahrav Date: Sat, 13 Jan 2024 16:52:41 -0800 Subject: [PATCH] [feat] - Provide CLI flag to only use custom verifiers (#2299) * Provide CLI flag to only use custom verifiers * address comments --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index be1f3df961af..ff1651c78ff8 100644 --- a/main.go +++ b/main.go @@ -57,6 +57,7 @@ var ( noUpdate = cli.Flag("no-update", "Don't check for updates.").Bool() fail = cli.Flag("fail", "Exit with code 183 if results are found.").Bool() verifiers = cli.Flag("verifier", "Set custom verification endpoints.").StringMap() + customVerifiersOnly = cli.Flag("custom-verifiers-only", "Only use custom verification endpoints.").Bool() archiveMaxSize = cli.Flag("archive-max-size", "Maximum size of archive to scan. (Byte units eg. 512B, 2KB, 4MB)").Bytes() archiveMaxDepth = cli.Flag("archive-max-depth", "Maximum depth of archive to scan.").Int() archiveTimeout = cli.Flag("archive-timeout", "Maximum time to spend extracting an archive.").Duration() @@ -365,8 +366,9 @@ func run(state overseer.State) { "detector", id, ) } - // TODO: Add flag to ignore the default endpoint. - urls = append(urls, customizer.DefaultEndpoint()) + if !*customVerifiersOnly || len(urls) == 0 { + urls = append(urls, customizer.DefaultEndpoint()) + } if err := customizer.SetEndpoints(urls...); err != nil { logFatal(err, "failed configuring custom endpoint for detector", "detector", id) }