Add Certificates page and Traefik API frontend client

This commit is contained in:
backup 2026-09-02 12:42:52 -05:00
commit 7fc90524b5
40 changed files with 6585 additions and 359 deletions

View file

@ -21,10 +21,15 @@ func (e ValidationError) Error() string {
return e.Message
}
// ValidateContent checks YAML content before write.
// ValidateContent performs syntax and structural validation of Traefik dynamic file-provider content.
// NOTE: This is NOT complete Traefik schema validation — it checks YAML syntax, top-level keys,
// and structural invariants (e.g., router requires rule+service, service requires loadBalancer/weighted,
// loadBalancer servers require url). Full Traefik CRD/schema validation (e.g., router rule grammar,
// middleware option types, TLS option values, unknown deeply-nested fields) is not exhaustive and
// should be considered syntax+structural validation. Traefik itself will still reject semantically
// invalid configs on reload; the GUI surfaces unified diff and Traefik status via /api/traefik/*.
// Rejects empty, dangerous, or structurally invalid configs.
// Allows only dynamic config top-level keys: http, tcp, udp, tls.
// Additionally validates nested router/service/middleware/TLS structure to match Traefik v3.7 dynamic schema.
func ValidateContent(filename, content string) []ValidationError {
var errs []ValidationError