Hi,
This sounds like a silly question at first…
Is there a way to undo a previous call to RegisterServerType(), i.e. assuming a call was made, can a later call to caddy be made to undo this registration? E.g. clear it back to default or otherwise make Caddy forget that the server was registered, e.g. to allow it to be modified or otherwise re-registered.
Or
Is there a way to modify the registered server type? Specifically to change its list of Directives?
I.e. we would have been satisfied if RegisterServerType could be called more than once and the latest call wins (right now calling for the second time results in “panic: server type already registered”)
Why do we need that?
As part of (Knative Security-Guard), we are looking to use part of CoreDNS which is built on top of Caddy. Our aim is to import "github.com/coredns/coredns/core/dnsserver"
and then use it. I.e. we wish to register a server type named “DNS” and define our list of Directives.
Unfortunately, github.com/coredns/coredns/core/dnsserver uses init() to perform RegisterServerType() and registers Directives (which are the default for CoreDNS) before we ever get a chance to register our own.
We are trying to get the CoreDNS to change their code and not use init() but we are not sure if that will be accepted - e.g. if it affects others already relying on that init().
Thanks,
davidhadas