Moved github PAT and storage path to env vars

This commit is contained in:
2026-03-30 22:02:39 +02:00
parent b1079efe58
commit bdf7d4f468
10 changed files with 35 additions and 32 deletions
+4 -3
View File
@@ -5,17 +5,18 @@ import (
"path/filepath"
"quay/app/handlers"
"quay/internal/config"
"quay/internal/envconfig"
"github.com/gofiber/fiber/v3"
)
func Register(app *fiber.App, cfg *config.Config) {
func Register(app *fiber.App, cfg *config.Config, envCfg *envconfig.EnvConfig) {
api := app.Group("/api")
api.Get("/health", handlers.HealthCheck)
api.Post("/update", handlers.NewUpdateSiteHandler(cfg))
api.Post("/update", handlers.NewUpdateSiteHandler(cfg, envCfg))
storagePath, err := filepath.Abs(cfg.Global.StoragePath)
storagePath, err := filepath.Abs(envCfg.StoragePath)
if err != nil {
log.Fatalf("Failed to resolve storage path: %v", err)
}