feat(admin): очистка всех сканов — POST /api/admin/purge-scans + UI (NETTOPO_RESET_DB_SECRET)

Made-with: Cursor
This commit is contained in:
Луценко Андрей Анатольевич
2026-04-10 16:08:35 +10:00
parent a7f80eac9a
commit a782d36af9
7 changed files with 117 additions and 12 deletions
+12 -7
View File
@@ -1,14 +1,18 @@
package config
import "os"
import (
"os"
"strings"
)
type Config struct {
HTTPAddr string
DBDSN string
StoreBackend string
RunMigrations bool
SNMPEnabled bool
SNMPCommunity string
HTTPAddr string
DBDSN string
StoreBackend string
RunMigrations bool
SNMPEnabled bool
SNMPCommunity string
ResetDBSecret string // NETTOPO_RESET_DB_SECRET — секрет для POST /api/admin/purge-scans
}
func FromEnv() Config {
@@ -47,5 +51,6 @@ func FromEnv() Config {
RunMigrations: runMigrations,
SNMPEnabled: snmpEnabled,
SNMPCommunity: snmpCommunity,
ResetDBSecret: strings.TrimSpace(os.Getenv("NETTOPO_RESET_DB_SECRET")),
}
}