summaryrefslogtreecommitdiff
path: root/caddyconfig/httpcaddyfile/directives.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2021-01-07 11:01:58 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2021-01-07 11:02:06 -0700
commitc2b91dbd65173d256e6fa4ddd3fec6ed2f6c87ef (patch)
tree6c229065d3687c33f2e53ee29b7f7deec1aaf0d5 /caddyconfig/httpcaddyfile/directives.go
parent8b6fdc04da5b31d8cb62b9d2574d16afe81ad549 (diff)
httpcaddyfile: Support repeated use of cert_issuer global option
This changes the signature of UnmarshalGlobalFunc but this is probably OK since it's only used by this repo as far as we know. We need this change in order to "remember" the previous value in case a global option appears more than once, which is now a possibility with the cert_issuer option since Caddy now supports multiple issuers in the order defined by the user. Bonus: the issuer subdirective of tls now supports one-liner for "acme" when all you need to set is the directory: issuer acme <dir>
Diffstat (limited to 'caddyconfig/httpcaddyfile/directives.go')
-rw-r--r--caddyconfig/httpcaddyfile/directives.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/caddyconfig/httpcaddyfile/directives.go b/caddyconfig/httpcaddyfile/directives.go
index 4ab8778..b79b811 100644
--- a/caddyconfig/httpcaddyfile/directives.go
+++ b/caddyconfig/httpcaddyfile/directives.go
@@ -498,9 +498,10 @@ type (
UnmarshalHandlerFunc func(h Helper) (caddyhttp.MiddlewareHandler, error)
// UnmarshalGlobalFunc is a function which can unmarshal Caddyfile
- // tokens into a global option config value using a Helper type.
- // These are passed in a call to RegisterGlobalOption.
- UnmarshalGlobalFunc func(d *caddyfile.Dispenser) (interface{}, error)
+ // tokens from a global option. It is passed the tokens to parse and
+ // existing value from the previous instance of this global option
+ // (if any). It returns the value to associate with this global option.
+ UnmarshalGlobalFunc func(d *caddyfile.Dispenser, existingVal interface{}) (interface{}, error)
)
var registeredDirectives = make(map[string]UnmarshalFunc)