Skip to content

Commit d00dc59

Browse files
Add EAB Config options (#101)
1 parent 769911d commit d00dc59

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

charts/caddy-ingress-controller/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ The command removes all the Kubernetes components associated with the chart and
5353
| image.tag | string | `"latest"` | |
5454
| imagePullSecrets | list | `[]` | |
5555
| ingressController.config.acmeCA | string | `""` | |
56+
| ingressController.config.acmeEABKeyId | string | `""` | |
57+
| ingressController.config.acmeEABMacKey | string | `""` | |
5658
| ingressController.config.debug | bool | `false` | |
5759
| ingressController.config.email | string | `""` | |
5860
| ingressController.config.metrics | bool | `true` | |

charts/caddy-ingress-controller/values.schema.json

+8
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@
110110
}
111111
]
112112
},
113+
"acmeEABKeyId": {
114+
"$id": "#/properties/ingressController/properties/config/properties/acmeEABKeyId",
115+
"type": "string"
116+
},
117+
"acmeEABMacKey": {
118+
"$id": "#/properties/ingressController/properties/config/properties/acmeEABMacKey",
119+
"type": "string"
120+
},
113121
"debug": {
114122
"$id": "#/properties/ingressController/properties/config/properties/debug",
115123
"type": "boolean"

charts/caddy-ingress-controller/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ ingressController:
2525
classNameRequired: false
2626
leaseId: ""
2727
config:
28+
acmeEABKeyId: ""
29+
acmeEABMacKey: ""
2830
# -- Acme Server URL
2931
acmeCA: ""
3032
debug: false

internal/caddy/global/configmap.go

+9
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ package global
22

33
import (
44
"encoding/json"
5+
56
caddy2 "github.com/caddyserver/caddy/v2"
67
"github.com/caddyserver/caddy/v2/caddyconfig"
78
"github.com/caddyserver/caddy/v2/modules/caddytls"
89
"github.com/caddyserver/ingress/pkg/converter"
910
"github.com/caddyserver/ingress/pkg/store"
11+
"github.com/mholt/acmez/acme"
1012
)
1113

1214
type ConfigMapPlugin struct{}
@@ -39,6 +41,13 @@ func (p ConfigMapPlugin) GlobalHandler(config *converter.Config, store *store.St
3941
acmeIssuer.CA = cfgMap.AcmeCA
4042
}
4143

44+
if cfgMap.AcmeEABKeyId != "" && cfgMap.AcmeEABMacKey != "" {
45+
acmeIssuer.ExternalAccount = &acme.EAB{
46+
KeyID: cfgMap.AcmeEABKeyId,
47+
MACKey: cfgMap.AcmeEABMacKey,
48+
}
49+
}
50+
4251
if cfgMap.Email != "" {
4352
acmeIssuer.Email = cfgMap.Email
4453
}

pkg/store/configmap_parser.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
package store
22

33
import (
4+
"reflect"
5+
"time"
6+
47
"github.com/caddyserver/caddy/v2"
58
"github.com/mitchellh/mapstructure"
69
"github.com/pkg/errors"
710
apiv1 "k8s.io/api/core/v1"
8-
"reflect"
9-
"time"
1011
)
1112

1213
// ConfigMapOptions represents global options set through a configmap
1314
type ConfigMapOptions struct {
1415
Debug bool `json:"debug,omitempty"`
1516
AcmeCA string `json:"acmeCA,omitempty"`
17+
AcmeEABKeyId string `json:"acmeEABKeyId,omitempty"`
18+
AcmeEABMacKey string `json:"acmeEABMacKey,omitempty"`
1619
Email string `json:"email,omitempty"`
1720
ExperimentalSmartSort bool `json:"experimentalSmartSort,omitempty"`
1821
ProxyProtocol bool `json:"proxyProtocol,omitempty"`

0 commit comments

Comments
 (0)