chore: build
This commit is contained in:
@@ -3,7 +3,6 @@ package config
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -31,13 +30,8 @@ type Config struct {
|
||||
|
||||
// Projets vitrine (abonnements de 1 à 12 mois, voir internal/projects).
|
||||
VitrineDomain string // OMNEX_VITRINE_DOMAIN : les projets sont servis sur <namespace>.<domaine>
|
||||
VitrineChartsDir string // OMNEX_VITRINE_CHARTS_DIR : charts backend/frontend/postgresql/redis/ingressroute du projet vitrine
|
||||
VitrineBackendImage string // VITRINE_BACKEND_IMAGE, ex. registry/vitrine-backend:1.0.0
|
||||
VitrineFrontendImage string // VITRINE_FRONTEND_IMAGE
|
||||
// VitrineGraceDays : jours pendant lesquels un projet dont l'abonnement
|
||||
// a expiré reste suspendu (données et sauvegardes conservées) avant sa
|
||||
// suppression définitive. Un renouvellement pendant ce délai le relance.
|
||||
VitrineGraceDays int
|
||||
}
|
||||
|
||||
// Load lit la config. Fail-secure : secret JWT obligatoire ; en prod base + Redis aussi.
|
||||
@@ -66,17 +60,8 @@ func Load() (Config, error) {
|
||||
DockerHubPassword: os.Getenv("OMNEX_DOCKERHUB_PASSWORD"),
|
||||
|
||||
VitrineDomain: getenv("OMNEX_VITRINE_DOMAIN", "vitrine-omnex.club"),
|
||||
VitrineChartsDir: getenv("OMNEX_VITRINE_CHARTS_DIR", "/charts-vitrine"),
|
||||
VitrineBackendImage: os.Getenv("VITRINE_BACKEND_IMAGE"),
|
||||
VitrineFrontendImage: os.Getenv("VITRINE_FRONTEND_IMAGE"),
|
||||
VitrineGraceDays: 7,
|
||||
}
|
||||
if v := os.Getenv("OMNEX_VITRINE_GRACE_DAYS"); v != "" {
|
||||
days, err := strconv.Atoi(v)
|
||||
if err != nil || days < 0 || days > 365 {
|
||||
return Config{}, errors.New("OMNEX_VITRINE_GRACE_DAYS doit être un entier entre 0 et 365")
|
||||
}
|
||||
cfg.VitrineGraceDays = days
|
||||
}
|
||||
|
||||
if cfg.Env == "prod" {
|
||||
|
||||
Reference in New Issue
Block a user