feat: registry credentials from k8s Secret via env vars

- main.go: REGISTRY_USERNAME / REGISTRY_TOKEN env vars override config file
- manifests/hub.yaml: reference Secret/gitea-creds, remove plaintext creds from ConfigMap

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-20 14:11:10 +01:00
parent 0fcc7d8e6f
commit 95bb261fa8
2 changed files with 20 additions and 2 deletions
+8
View File
@@ -71,6 +71,14 @@ func main() {
// Load config
cfg := loadConfig(*configPath, logger)
// Environment variable overrides (for k8s Secrets)
if v := os.Getenv("REGISTRY_USERNAME"); v != "" {
cfg.Registry.Username = v
}
if v := os.Getenv("REGISTRY_TOKEN"); v != "" {
cfg.Registry.Token = v
}
// Ensure data dir exists
os.MkdirAll(cfg.Server.DataDir, 0755)