From dd4948114bc990192da18e36c174978f19c443f1 Mon Sep 17 00:00:00 2001 From: Marco Vito Moscaritolo Date: Sun, 5 Jan 2025 15:56:27 +0100 Subject: [PATCH] feat: remove unsupported features As consequence of: * https://github.com/caddyserver/caddy/pull/6611 support for OnDemandRateLimitBurst and OnDemandRateLimitInterval has been removed. --- README.md | 2 +- .../values.schema.json | 8 ------- charts/caddy-ingress-controller/values.yaml | 2 -- internal/caddy/global/configmap.go | 6 +---- pkg/store/configmap_parser.go | 24 +++++++++---------- 5 files changed, 13 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 275bf33..62264af 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ helm install ...\ ``` > You can also specify options -> for the on-demand config: `onDemandRateLimitInterval`, `onDemandRateLimitBurst` and `onDemandAsk` +> for the on-demand config: `onDemandAsk` ## Bringing Your Own Certificates diff --git a/charts/caddy-ingress-controller/values.schema.json b/charts/caddy-ingress-controller/values.schema.json index 652a7c0..f959a20 100644 --- a/charts/caddy-ingress-controller/values.schema.json +++ b/charts/caddy-ingress-controller/values.schema.json @@ -150,14 +150,6 @@ "$id": "#/properties/ingressController/properties/config/properties/onDemandTLS", "type": "boolean" }, - "onDemandRateLimitInterval": { - "$id": "#/properties/ingressController/properties/config/properties/onDemandRateLimitInterval", - "type": "string" - }, - "onDemandRateLimitBurst": { - "$id": "#/properties/ingressController/properties/config/properties/onDemandRateLimitBurst", - "type": "number" - }, "onDemandAsk": { "$id": "#/properties/ingressController/properties/config/properties/onDemandAsk", "type": "string" diff --git a/charts/caddy-ingress-controller/values.yaml b/charts/caddy-ingress-controller/values.yaml index 2c6767e..a3d980f 100644 --- a/charts/caddy-ingress-controller/values.yaml +++ b/charts/caddy-ingress-controller/values.yaml @@ -35,8 +35,6 @@ ingressController: proxyProtocol: false experimentalSmartSort: false onDemandTLS: false - # onDemandRateLimitInterval: - # onDemandRateLimitBurst: # onDemandAsk: loadBalancer: diff --git a/internal/caddy/global/configmap.go b/internal/caddy/global/configmap.go index 507e90f..ad9fa7e 100644 --- a/internal/caddy/global/configmap.go +++ b/internal/caddy/global/configmap.go @@ -8,7 +8,7 @@ import ( "github.com/caddyserver/caddy/v2/modules/caddytls" "github.com/caddyserver/ingress/pkg/converter" "github.com/caddyserver/ingress/pkg/store" - "github.com/mholt/acmez/v2/acme" + "github.com/mholt/acmez/v3/acme" ) type ConfigMapPlugin struct{} @@ -55,10 +55,6 @@ func (p ConfigMapPlugin) GlobalHandler(config *converter.Config, store *store.St var onDemandConfig *caddytls.OnDemandConfig if cfgMap.OnDemandTLS { onDemandConfig = &caddytls.OnDemandConfig{ - RateLimit: &caddytls.RateLimit{ - Interval: cfgMap.OnDemandRateLimitInterval, - Burst: cfgMap.OnDemandRateLimitBurst, - }, Ask: cfgMap.OnDemandAsk, } } diff --git a/pkg/store/configmap_parser.go b/pkg/store/configmap_parser.go index e7fb98c..7d4b46c 100644 --- a/pkg/store/configmap_parser.go +++ b/pkg/store/configmap_parser.go @@ -12,19 +12,17 @@ import ( // ConfigMapOptions represents global options set through a configmap type ConfigMapOptions struct { - Debug bool `json:"debug,omitempty"` - AcmeCA string `json:"acmeCA,omitempty"` - AcmeEABKeyId string `json:"acmeEABKeyId,omitempty"` - AcmeEABMacKey string `json:"acmeEABMacKey,omitempty"` - Email string `json:"email,omitempty"` - ExperimentalSmartSort bool `json:"experimentalSmartSort,omitempty"` - ProxyProtocol bool `json:"proxyProtocol,omitempty"` - Metrics bool `json:"metrics,omitempty"` - OnDemandTLS bool `json:"onDemandTLS,omitempty"` - OnDemandRateLimitInterval caddy.Duration `json:"onDemandRateLimitInterval,omitempty"` - OnDemandRateLimitBurst int `json:"onDemandRateLimitBurst,omitempty"` - OnDemandAsk string `json:"onDemandAsk,omitempty"` - OCSPCheckInterval caddy.Duration `json:"ocspCheckInterval,omitempty"` + Debug bool `json:"debug,omitempty"` + AcmeCA string `json:"acmeCA,omitempty"` + AcmeEABKeyId string `json:"acmeEABKeyId,omitempty"` + AcmeEABMacKey string `json:"acmeEABMacKey,omitempty"` + Email string `json:"email,omitempty"` + ExperimentalSmartSort bool `json:"experimentalSmartSort,omitempty"` + ProxyProtocol bool `json:"proxyProtocol,omitempty"` + Metrics bool `json:"metrics,omitempty"` + OnDemandTLS bool `json:"onDemandTLS,omitempty"` + OnDemandAsk string `json:"onDemandAsk,omitempty"` + OCSPCheckInterval caddy.Duration `json:"ocspCheckInterval,omitempty"` } func stringToCaddyDurationHookFunc() mapstructure.DecodeHookFunc {