Files
CaddyProxyManager/backend/internal/caddy/schema/cloudflare.go
Pacerino b4509d12e7 [Backend][Frontend] Add host plugins with module config and schema-driven UI
Introduce per-host plugin support: Caddy module discovery, module
config endpoints, plugin schemas (basicauth, cloudflare) and the
host plugins API. On the frontend, add the Plugins page, plugin/host
plugin dialogs and schema-driven form fields.
2026-06-15 14:17:34 +02:00

40 lines
1.0 KiB
Go

package schema
func init() {
Register(&Schema{
ModuleID: "dns.providers.cloudflare",
Title: "Cloudflare DNS",
Description: "DNS provider used for ACME DNS-01 challenges via the Cloudflare API.",
Scopes: []Scope{ScopeGlobal},
Path: "apps/tls/automation/policies",
Fields: []Field{
{
Key: "api_token",
Label: "API Token",
Description: "Cloudflare API token with DNS edit permissions.",
Type: FieldSecret,
Required: true,
},
},
build: func(values map[string]any) (any, error) {
// Caddy's tls automation policy referencing the cloudflare DNS
// provider for the ACME issuer's DNS-01 challenge.
return map[string]any{
"issuers": []any{
map[string]any{
"module": "acme",
"challenges": map[string]any{
"dns": map[string]any{
"provider": map[string]any{
"name": "cloudflare",
"api_token": values["api_token"],
},
},
},
},
},
}, nil
},
})
}