mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
feat(api): add /api/system and per-package verdicts
Add a read-only /api/system endpoint with the effective scan policy, scanner health, rescan, cache and pre-warming settings. It exposes no credentials or paths. The package list now carries a verdict (cleared, held, bypassed or pending) with the reason and the applied bypass. /api/stats adds bypassed_packages. The vulnerability detail response adds the decision, a per-scanner severity breakdown and detected_by on each finding.
This commit is contained in:
Vendored
+3
-2
@@ -95,7 +95,8 @@ type Config struct {
|
||||
RescanAfter time.Duration // Rescan a cache hit whose scan result is older than this before serving (0 = off)
|
||||
}
|
||||
|
||||
const defaultScanWaitTimeout = 30 * time.Second
|
||||
// DefaultScanWaitTimeout is how long a first download waits for its scan when none is configured.
|
||||
const DefaultScanWaitTimeout = 30 * time.Second
|
||||
|
||||
// cleanupBatchSize bounds how many rows one cleanup query reads.
|
||||
const cleanupBatchSize = metadata.DefaultBatchSize
|
||||
@@ -196,7 +197,7 @@ func New(storage storage.StorageBackend, metadata metadata.MetadataStore, scanne
|
||||
}
|
||||
|
||||
if config.ScanWaitTimeout == 0 {
|
||||
config.ScanWaitTimeout = defaultScanWaitTimeout
|
||||
config.ScanWaitTimeout = DefaultScanWaitTimeout
|
||||
}
|
||||
|
||||
if config.MaxPackageSize == 0 {
|
||||
|
||||
Reference in New Issue
Block a user