Add scan queue execution and listing endpoint.

Run scans in background with progress/status updates and store scan metrics in memory or PostgreSQL.

Made-with: Cursor
This commit is contained in:
Andrey Lutsenko
2026-04-09 21:49:38 +10:00
parent 284794ec8d
commit 43cb339605
12 changed files with 753 additions and 23 deletions
+23 -2
View File
@@ -3,7 +3,10 @@ package config
import "os"
type Config struct {
HTTPAddr string
HTTPAddr string
DBDSN string
StoreBackend string
RunMigrations bool
}
func FromEnv() Config {
@@ -12,7 +15,25 @@ func FromEnv() Config {
addr = ":8080"
}
dbDSN := os.Getenv("DB_DSN")
storeBackend := os.Getenv("STORE_BACKEND")
if storeBackend == "" {
if dbDSN != "" {
storeBackend = "postgres"
} else {
storeBackend = "memory"
}
}
runMigrations := true
if os.Getenv("RUN_MIGRATIONS") == "false" {
runMigrations = false
}
return Config{
HTTPAddr: addr,
HTTPAddr: addr,
DBDSN: dbDSN,
StoreBackend: storeBackend,
RunMigrations: runMigrations,
}
}