chore: update
ci-api / test (push) Successful in 21m59s
ci-web / test (push) Successful in 13m44s

This commit is contained in:
Xor290
2026-08-02 21:31:29 +02:00
parent ca14327ea2
commit 2592ea1c6f
15 changed files with 338 additions and 1629 deletions
+19
View File
@@ -4,6 +4,7 @@ package demos
import (
"errors"
"regexp"
"strings"
"time"
)
@@ -33,8 +34,26 @@ const (
var (
ErrInvalidStorageDriver = errors.New("storage_driver doit être 'local' ou 's3'")
ErrS3ConfigIncomplete = errors.New("s3_bucket et s3_endpoint sont requis pour le stockage S3")
ErrInvalidDomain = errors.New("nom de domaine invalide")
)
// domainPattern : nom d'hôte RFC 1123 (labels alphanumériques + tirets,
// séparés par des points, au moins un point — pas de protocole ni de chemin).
var domainPattern = regexp.MustCompile(`^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$`)
// ValidateDomain vérifie le format d'un domaine personnalisé. Une chaîne
// vide est valide : elle signifie "revenir au domaine par défaut" (voir
// Service.SetDomain).
func ValidateDomain(domain string) error {
if domain == "" {
return nil
}
if len(domain) > 253 || !domainPattern.MatchString(domain) {
return ErrInvalidDomain
}
return nil
}
// ProvisionConfig : réglages saisis par l'admin à la création (popup de
// déploiement), propagés jusqu'au chart backend. Jamais persisté en base —
// notamment les secrets (token Telegram, clés NowPayments), qui ne