feat(docker-watcher): phase 2 - crypto & config seed loader

AES-256-GCM encryption for credential storage, YAML seed config
parser with validation, and transactional import into SQLite.
Credentials (registry tokens, NPM password) encrypted before storage.
This commit is contained in:
2026-03-27 21:01:16 +03:00
parent d63c831d15
commit cdf21682d6
10 changed files with 602 additions and 19 deletions
+7
View File
@@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
"github.com/alexei/docker-watcher/internal/config"
"github.com/alexei/docker-watcher/internal/store"
)
@@ -23,6 +24,12 @@ func main() {
}
defer db.Close()
// Import seed config on first launch (idempotent — skipped if DB has data).
seedPath := envOrDefault("SEED_FILE", "./docker-watcher.yaml")
if err := config.ImportSeed(db, seedPath); err != nil {
log.Fatalf("seed import: %v", err)
}
fmt.Printf("Docker Watcher started. Database: %s\n", dbPath)
// Future phases will wire up the HTTP server, deployer, poller, etc.